fix MODAPP-3

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6037 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-10-23 21:32:17 +00:00
parent 2414ad8c69
commit 673b1cff3b
2 changed files with 13 additions and 1 deletions

View File

@ -632,6 +632,7 @@ SFF_CNG = (1 << 0) - Frame represents comfort noise
SFF_RAW_RTP = (1 << 1) - Frame has raw rtp accessible SFF_RAW_RTP = (1 << 1) - Frame has raw rtp accessible
SFF_RTP_HEADER = (1 << 2) - Get the rtp header from the frame header SFF_RTP_HEADER = (1 << 2) - Get the rtp header from the frame header
SFF_PLC = (1 << 3) - Frame has generated PLC data SFF_PLC = (1 << 3) - Frame has generated PLC data
SFF_RFC2833 = (1 << 4) - Frame has rfc2833 dtmf data
</pre> </pre>
*/ */
typedef enum { typedef enum {
@ -639,7 +640,8 @@ typedef enum {
SFF_CNG = (1 << 0), SFF_CNG = (1 << 0),
SFF_RAW_RTP = (1 << 1), SFF_RAW_RTP = (1 << 1),
SFF_RTP_HEADER = (1 << 2), SFF_RTP_HEADER = (1 << 2),
SFF_PLC = (1 << 3) SFF_PLC = (1 << 3),
SFF_RFC2833 = (1 << 4)
} switch_frame_flag_t; } switch_frame_flag_t;

View File

@ -1219,6 +1219,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp
frame->packetlen = bytes; frame->packetlen = bytes;
frame->source = __FILE__; frame->source = __FILE__;
frame->flags |= SFF_RAW_RTP; frame->flags |= SFF_RAW_RTP;
if (frame->payload == rtp_session->te) {
frame->flags |= SFF_RFC2833;
}
frame->timestamp = ntohl(rtp_session->recv_msg.header.ts); frame->timestamp = ntohl(rtp_session->recv_msg.header.ts);
frame->seq = (uint16_t)ntohs((u_short)rtp_session->recv_msg.header.seq); frame->seq = (uint16_t)ntohs((u_short)rtp_session->recv_msg.header.seq);
frame->ssrc = ntohl(rtp_session->recv_msg.header.ssrc); frame->ssrc = ntohl(rtp_session->recv_msg.header.ssrc);
@ -1282,8 +1285,15 @@ static int rtp_common_write(switch_rtp_t *rtp_session, void *data, uint32_t data
if (fwd) { if (fwd) {
bytes = datalen; bytes = datalen;
send_msg = (rtp_msg_t *) data; send_msg = (rtp_msg_t *) data;
if (*flags & SFF_RFC2833) {
send_msg->header.pt = rtp_session->te;
}
} else { } else {
uint8_t m = 0; uint8_t m = 0;
if (*flags & SFF_RFC2833) {
payload = rtp_session->te;
}
if ((rtp_session->ts > (rtp_session->last_write_ts + (rtp_session->samples_per_interval * 10))) if ((rtp_session->ts > (rtp_session->last_write_ts + (rtp_session->samples_per_interval * 10)))
|| rtp_session->ts == rtp_session->samples_per_interval) { || rtp_session->ts == rtp_session->samples_per_interval) {