[asterisk-commits] elguero: trunk r388113 - in /trunk: ./ res/res_rtp_asterisk.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 8 23:12:02 CDT 2013


Author: elguero
Date: Wed May  8 23:11:59 2013
New Revision: 388113

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388113
Log:
Fix The Payload Being Set On CN Packets And Do Not Set Marker Bit

When we send out a CN packet (for instance, in the case of using rtpkeepalives),
we are not setting the payload code properly.  Also, we are setting the marker
bit when we shouldn't be according to RFC 3389, section 4.

AST_RTP_CN is not defined by AST_FORMAT codes.  Therefore, we should be using
ast_rtp_codecs_payload_code() rather than ast_rtp_codecs_payload_lookup().

11 and trunk already use the appropriate function.

* In 1.8, use ast_rtp_codecs_payload_code()

* Remove the setting of the marker bit

* Fix the debug message by incrementing the seqno after the debug message is set
  in order to display the correct seqno that was sent out

(closes issue ASTERISK-21246)
Reported by: Peter Katzmann
Tested by: Peter Katzmann, Michael L. Young
Patches:
    asterisk-21246-rtp-cng-payload-error_1.8_v2.diff
                                     uploaded by Michael L. Young (license 5026)

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

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

Merged revisions 388112 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/res/res_rtp_asterisk.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_rtp_asterisk.c?view=diff&rev=388113&r1=388112&r2=388113
==============================================================================
--- trunk/res/res_rtp_asterisk.c (original)
+++ trunk/res/res_rtp_asterisk.c Wed May  8 23:11:59 2013
@@ -4184,8 +4184,7 @@
 {
 	unsigned int *rtpheader;
 	int hdrlen = 12;
-	int res;
-	int payload;
+	int res, payload = 0;
 	char data[256];
 	struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
 	struct ast_sockaddr remote_address = { {0,} };
@@ -4205,7 +4204,7 @@
 
 	/* Get a pointer to the header */
 	rtpheader = (unsigned int *)data;
-	rtpheader[0] = htonl((2 << 30) | (1 << 23) | (payload << 16) | (rtp->seqno++));
+	rtpheader[0] = htonl((2 << 30) | (payload << 16) | (rtp->seqno));
 	rtpheader[1] = htonl(rtp->lastts);
 	rtpheader[2] = htonl(rtp->ssrc); 
 	data[12] = level;
@@ -4225,6 +4224,8 @@
 			    ice ? " (via ICE)" : "",
 			    AST_RTP_CN, rtp->seqno, rtp->lastdigitts, res - hdrlen);
 	}
+
+	rtp->seqno++;
 
 	return res;
 }




More information about the asterisk-commits mailing list