[asterisk-commits] russell: branch 1.4 r178373 - /branches/1.4/main/rtp.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 24 14:36:19 CST 2009


Author: russell
Date: Tue Feb 24 14:36:19 2009
New Revision: 178373

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=178373
Log:
Only set dtmfcount on BEGIN, and ensure it gets reset to 0 properly.

(issue #14460)
Reported by: moliveras
Tested by: russell

Modified:
    branches/1.4/main/rtp.c

Modified: branches/1.4/main/rtp.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/main/rtp.c?view=diff&rev=178373&r1=178372&r2=178373
==============================================================================
--- branches/1.4/main/rtp.c (original)
+++ branches/1.4/main/rtp.c Tue Feb 24 14:36:19 2009
@@ -745,6 +745,7 @@
 	if (ast_test_flag(rtp, FLAG_DTMF_COMPENSATE)) {
 		if ((rtp->lastevent != timestamp) || (rtp->resp && rtp->resp != resp)) {
 			rtp->resp = resp;
+			rtp->dtmfcount = 0;
 			f = send_dtmf(rtp, AST_FRAME_DTMF_END);
 			f->len = 0;
 			rtp->lastevent = timestamp;
@@ -753,15 +754,15 @@
 		if ((!(rtp->resp) && (!(event_end & 0x80))) || (rtp->resp && rtp->resp != resp)) {
 			rtp->resp = resp;
 			f = send_dtmf(rtp, AST_FRAME_DTMF_BEGIN);
+			rtp->dtmfcount = dtmftimeout;
 		} else if ((event_end & 0x80) && (rtp->lastevent != seqno) && rtp->resp) {
 			f = send_dtmf(rtp, AST_FRAME_DTMF_END);
 			f->len = ast_tvdiff_ms(ast_samp2tv(samples, 8000), ast_tv(0, 0)); /* XXX hard coded 8kHz */
 			rtp->resp = 0;
+			rtp->dtmfcount = 0;
 			rtp->lastevent = seqno;
 		}
 	}
-
-	rtp->dtmfcount = dtmftimeout;
 
 	return f;
 }
@@ -1332,7 +1333,6 @@
 		rtp->f.delivery.tv_usec = 0;
 		if (mark)
 			rtp->f.subclass |= 0x1;
-		
 	}
 	rtp->f.src = "RTP";
 	return &rtp->f;




More information about the asterisk-commits mailing list