[asterisk-commits] file: branch certified-1.8.15 r376409 - in /certified/branches/1.8.15: ./ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 16 15:24:40 CST 2012


Author: file
Date: Fri Nov 16 15:24:35 2012
New Revision: 376409

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=376409
Log:
Fix Incrementing Sequence Number For Retransmitted DTMF End Packets

In Asterisk 1.4+, a fix was put in place to increment the sequence number for
retransmitted DTMF end packets.  With the introduction of the RTP engine API in
1.8, the sequence number was no longer being incremented.  This patch fixes this
regression as well as cleans up a few lines that were not doing anything.

(closes issue ASTERISK-20295)
Reported by: Nitesh Bansal
Tested by: Michael L. Young
Patches: 
01_rtp_event_seq_num.patch uploaded by Nitesh Bansal (license 6418)
asterisk-20295-dtmf-fix-cleanup.diff uploaded by Michael L. Young (license 5026)

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

Merged revisions 372185 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    certified/branches/1.8.15/   (props changed)
    certified/branches/1.8.15/res/res_rtp_asterisk.c

Propchange: certified/branches/1.8.15/
            ('branch-1.6.2-blocked' removed)

Propchange: certified/branches/1.8.15/
            ('branch-1.6.2-merged' removed)

Propchange: certified/branches/1.8.15/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: certified/branches/1.8.15/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/certified/branches/1.8.15/res/res_rtp_asterisk.c?view=diff&rev=376409&r1=376408&r2=376409
==============================================================================
--- certified/branches/1.8.15/res/res_rtp_asterisk.c (original)
+++ certified/branches/1.8.15/res/res_rtp_asterisk.c Fri Nov 16 15:24:35 2012
@@ -717,11 +717,10 @@
 	}
 
 	/* Actually create the packet we will be sending */
-	rtpheader[0] = htonl((2 << 30) | (1 << 23) | (rtp->send_payload << 16) | (rtp->seqno));
+	rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) | (rtp->seqno));
 	rtpheader[1] = htonl(rtp->lastdigitts);
 	rtpheader[2] = htonl(rtp->ssrc);
 	rtpheader[3] = htonl((rtp->send_digit << 24) | (0xa << 16) | (rtp->send_duration));
-	rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) | (rtp->seqno));
 
 	/* Boom, send it on out */
 	res = rtp_sendto(instance, (void *) rtpheader, hdrlen + 4, 0, &remote_address);
@@ -784,15 +783,16 @@
 	}
 
 	/* Construct the packet we are going to send */
-	rtpheader[0] = htonl((2 << 30) | (1 << 23) | (rtp->send_payload << 16) | (rtp->seqno));
 	rtpheader[1] = htonl(rtp->lastdigitts);
 	rtpheader[2] = htonl(rtp->ssrc);
 	rtpheader[3] = htonl((digit << 24) | (0xa << 16) | (rtp->send_duration));
 	rtpheader[3] |= htonl((1 << 23));
-	rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) | (rtp->seqno));
 
 	/* Send it 3 times, that's the magical number */
 	for (i = 0; i < 3; i++) {
+
+		rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) | (rtp->seqno));
+
 		res = rtp_sendto(instance, (void *) rtpheader, hdrlen + 4, 0, &remote_address);
 		if (res < 0) {
 			ast_log(LOG_ERROR, "RTP Transmission error to %s: %s\n",
@@ -804,6 +804,8 @@
 				    ast_sockaddr_stringify(&remote_address),
 				    rtp->send_payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
 		}
+
+		rtp->seqno++;
 	}
 
 	/* Oh and we can't forget to turn off the stuff that says we are sending DTMF */




More information about the asterisk-commits mailing list