[asterisk-commits] file: trunk r41632 - /trunk/main/rtp.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Aug 31 14:00:17 MST 2006


Author: file
Date: Thu Aug 31 16:00:16 2006
New Revision: 41632

URL: http://svn.digium.com/view/asterisk?rev=41632&view=rev
Log:
Tweak the DTMF muting stuff a bit to take into account VLDTMF and compensation.

Modified:
    trunk/main/rtp.c

Modified: trunk/main/rtp.c
URL: http://svn.digium.com/view/asterisk/trunk/main/rtp.c?rev=41632&r1=41631&r2=41632&view=diff
==============================================================================
--- trunk/main/rtp.c (original)
+++ trunk/main/rtp.c Thu Aug 31 16:00:16 2006
@@ -545,7 +545,8 @@
 
 static struct ast_frame *send_dtmf(struct ast_rtp *rtp, enum ast_frame_type type)
 {
-	if (ast_tvcmp(ast_tvnow(), rtp->dtmfmute) < 0) {
+	if (((ast_test_flag(rtp, FLAG_DTMF_COMPENSATE) && type == AST_FRAME_DTMF_END) ||
+	     (type == AST_FRAME_DTMF_BEGIN)) && ast_tvcmp(ast_tvnow(), rtp->dtmfmute) < 0) {
 		if (option_debug)
 			ast_log(LOG_DEBUG, "Ignore potential DTMF echo from '%s'\n", ast_inet_ntoa(rtp->them.sin_addr));
 		rtp->resp = 0;
@@ -2078,6 +2079,8 @@
 	if (digit_convert(digit))
 		return -1;
 
+	rtp->dtmfmute = ast_tvadd(ast_tvnow(), ast_tv(0, 500000));
+
 	rtpheader = (unsigned int *)data;
 	rtpheader[0] = htonl((2 << 30) | (1 << 23) | (rtp->send_payload << 16) | (rtp->seqno));
 	rtpheader[1] = htonl(rtp->lastdigitts);



More information about the asterisk-commits mailing list