From 40fbe50662244a4bd9d92f3cea6dde15fa34476e Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Thu, 9 Dec 2004 14:54:13 +0000 Subject: [PATCH] Update comment for fmtp 16, implement in RTP (bug #2999) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4409 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 2 +- rtp.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 4189b8bd7a..f8ae0961ae 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3442,7 +3442,7 @@ static int add_sdp(struct sip_request *resp, struct sip_pvt *p) snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/8000\r\n", codec, ast_rtp_lookup_mime_subtype(0, x)); strncat(a, costr, sizeof(a) - strlen(a) - 1); if (x == AST_RTP_DTMF) { - /* Indicate we support DTMF... Not sure about 16, but MSN supports it so dang it, we will too... */ + /* Indicate we support DTMF and FLASH... */ snprintf(costr, sizeof costr, "a=fmtp:%d 0-16\r\n", codec); strncat(a, costr, sizeof(a) - strlen(a) - 1); diff --git a/rtp.c b/rtp.c index d79309312b..55d79ca305 100755 --- a/rtp.c +++ b/rtp.c @@ -192,8 +192,13 @@ static struct ast_frame *send_dtmf(struct ast_rtp *rtp) return &null_frame; } ast_log(LOG_DEBUG, "Sending dtmf: %d (%c), at %s\n", rtp->resp, rtp->resp, ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->them.sin_addr)); - rtp->f.frametype = AST_FRAME_DTMF; - rtp->f.subclass = rtp->resp; + if (rtp->resp == 'X') { + rtp->f.frametype = AST_FRAME_CONTROL; + rtp->f.subclass = AST_CONTROL_FLASH; + } else { + rtp->f.frametype = AST_FRAME_DTMF; + rtp->f.subclass = rtp->resp; + } rtp->f.datalen = 0; rtp->f.samples = 0; rtp->f.mallocd = 0; @@ -235,6 +240,8 @@ static struct ast_frame *process_cisco_dtmf(struct ast_rtp *rtp, unsigned char * resp = '#'; } else if (event < 16) { resp = 'A' + (event - 12); + } else if (event < 17) { + resp = 'X'; } if (rtp->resp && (rtp->resp != resp)) { f = send_dtmf(rtp); @@ -269,6 +276,8 @@ static struct ast_frame *process_rfc2833(struct ast_rtp *rtp, unsigned char *dat resp = '#'; } else if (event < 16) { resp = 'A' + (event - 12); + } else if (event < 17) { + resp = 'X'; } if (rtp->resp && (rtp->resp != resp)) { f = send_dtmf(rtp);