[svn-commits] mjordan: branch 1.8 r373236 - /branches/1.8/res/res_rtp_asterisk.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Sep 20 13:41:53 CDT 2012


Author: mjordan
Date: Thu Sep 20 13:41:45 2012
New Revision: 373236

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=373236
Log:
When processing RFC 2833 DTMF, accomodate increasing timestamps in End events

While endpoints should not be changing the source timestamp between DTMF event
packets, the fact is there exists those endpoints that do exactly that.  To
work around this, we absorb timestamps within the expected re-transmit period.
Note that this period only affects End of Event packets, so it should not
prevent the detection of new DTMF digits that happen to arrive right on top
of each other.

(closes issue ASTERISK-20424)
Reported by: Vladimir Mikhelson
Tested by: mjordan, Vladimir Mikhelson

Review: https://reviewboard.asterisk.org/r/2124

Modified:
    branches/1.8/res/res_rtp_asterisk.c

Modified: branches/1.8/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/res/res_rtp_asterisk.c?view=diff&rev=373236&r1=373235&r2=373236
==============================================================================
--- branches/1.8/res/res_rtp_asterisk.c (original)
+++ branches/1.8/res/res_rtp_asterisk.c Thu Sep 20 13:41:45 2012
@@ -1587,8 +1587,9 @@
 		new_duration = (new_duration & ~0xFFFF) | samples;
 
 		if (event_end & 0x80) {
-			/* End event */
-			if ((rtp->last_seqno != seqno) && (timestamp > rtp->last_end_timestamp)) {
+			/* End event.  Absorb re-transmits, and account for some endpoints
+			 * that erroneously increment the timestamp during re-transmissions */
+			if ((seqno != rtp->last_seqno) && (timestamp > rtp->last_end_timestamp + 320)) {
 				rtp->last_end_timestamp = timestamp;
 				rtp->dtmf_duration = new_duration;
 				rtp->resp = resp;
@@ -1598,7 +1599,7 @@
 				rtp->dtmf_duration = rtp->dtmf_timeout = 0;
 				AST_LIST_INSERT_TAIL(frames, f, frame_list);
 			} else if (rtpdebug) {
-				ast_debug(1, "Dropping duplicate or out of order DTMF END frame (seqno: %d, ts %d, digit %c)\n",
+				ast_debug(1, "Dropping re-transmitted, duplicate, or out of order DTMF END frame (seqno: %d, ts %d, digit %c)\n",
 					seqno, timestamp, resp);
 			}
 		} else {




More information about the svn-commits mailing list