From 673b1cff3b1102b954c8c198c96b22369f6151f6 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 23 Oct 2007 21:32:17 +0000 Subject: [PATCH] fix MODAPP-3 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6037 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_types.h | 4 +++- src/switch_rtp.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 9cb8a09623..4ecf00b362 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -632,6 +632,7 @@ SFF_CNG = (1 << 0) - Frame represents comfort noise SFF_RAW_RTP = (1 << 1) - Frame has raw rtp accessible SFF_RTP_HEADER = (1 << 2) - Get the rtp header from the frame header SFF_PLC = (1 << 3) - Frame has generated PLC data +SFF_RFC2833 = (1 << 4) - Frame has rfc2833 dtmf data */ typedef enum { @@ -639,7 +640,8 @@ typedef enum { SFF_CNG = (1 << 0), SFF_RAW_RTP = (1 << 1), SFF_RTP_HEADER = (1 << 2), - SFF_PLC = (1 << 3) + SFF_PLC = (1 << 3), + SFF_RFC2833 = (1 << 4) } switch_frame_flag_t; diff --git a/src/switch_rtp.c b/src/switch_rtp.c index a78ec50e0c..60f3ae8d4c 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1219,6 +1219,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp frame->packetlen = bytes; frame->source = __FILE__; 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->seq = (uint16_t)ntohs((u_short)rtp_session->recv_msg.header.seq); 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) { bytes = datalen; send_msg = (rtp_msg_t *) data; + if (*flags & SFF_RFC2833) { + send_msg->header.pt = rtp_session->te; + } } else { 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))) || rtp_session->ts == rtp_session->samples_per_interval) {