[asterisk-commits] dvossel: trunk r314018 - in /trunk: ./ channels/ include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 18 08:42:57 CDT 2011


Author: dvossel
Date: Mon Apr 18 08:42:51 2011
New Revision: 314018

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=314018
Log:
Merged revisions 314017 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r314017 | dvossel | 2011-04-18 08:41:06 -0500 (Mon, 18 Apr 2011) | 17 lines
  
  sip codec negotiation of dynamic rtp payloads error fix
  
  This patch fixes how chan_sip handles dynamic rtp payload types
  it does not understand.  At the moment if a dynamic payload's mime
  type does not match one we understand, the payload does not get
  removed from our payload table.  As a result of this, the payload
  is set to whatever dynamic codec we use internally for that payload
  number on outgoing INVITES.  This is incorrect.
  
  This patch fixes this by properly checking the rtpmap set function's
  return code to make sure it was found.  The function can return both
  -1 and -2 depending on the source of the mismatch.  We were just
  checking -1 explicitly.
  
  Review: https://reviewboard.asterisk.org/r/1169/
........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c
    trunk/include/asterisk/rtp_engine.h
    trunk/main/rtp_engine.c

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

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=314018&r1=314017&r2=314018
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Apr 18 08:42:51 2011
@@ -9092,8 +9092,8 @@
 	} else if (sscanf(a, "rtpmap: %30u %127[^/]/%30u", &codec, mimeSubtype, &sample_rate) == 3) {
 		/* We have a rtpmap to handle */
 		if (*last_rtpmap_codec < SDP_MAX_RTPMAP_CODECS) {
-			if (ast_rtp_codecs_payloads_set_rtpmap_type_rate(newaudiortp, NULL, codec, "audio", mimeSubtype,
-			    ast_test_flag(&p->flags[0], SIP_G726_NONSTANDARD) ? AST_RTP_OPT_G726_NONSTANDARD : 0, sample_rate) != -1) {
+			if (!(ast_rtp_codecs_payloads_set_rtpmap_type_rate(newaudiortp, NULL, codec, "audio", mimeSubtype,
+			    ast_test_flag(&p->flags[0], SIP_G726_NONSTANDARD) ? AST_RTP_OPT_G726_NONSTANDARD : 0, sample_rate))) {
 				if (debug)
 					ast_verbose("Found audio description format %s for ID %d\n", mimeSubtype, codec);
 				//found_rtpmap_codecs[last_rtpmap_codec] = codec;
@@ -9179,7 +9179,7 @@
 		if (*last_rtpmap_codec < SDP_MAX_RTPMAP_CODECS) {
 			/* Note: should really look at the '#chans' params too */
 			if (!strncasecmp(mimeSubtype, "H26", 3) || !strncasecmp(mimeSubtype, "MP4", 3)) {
-				if (ast_rtp_codecs_payloads_set_rtpmap_type_rate(newvideortp, NULL, codec, "video", mimeSubtype, 0, sample_rate) != -1) {
+				if (!(ast_rtp_codecs_payloads_set_rtpmap_type_rate(newvideortp, NULL, codec, "video", mimeSubtype, 0, sample_rate))) {
 					if (debug)
 						ast_verbose("Found video description format %s for ID %d\n", mimeSubtype, codec);
 					//found_rtpmap_codecs[last_rtpmap_codec] = codec;

Modified: trunk/include/asterisk/rtp_engine.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/rtp_engine.h?view=diff&rev=314018&r1=314017&r2=314018
==============================================================================
--- trunk/include/asterisk/rtp_engine.h (original)
+++ trunk/include/asterisk/rtp_engine.h Mon Apr 18 08:42:51 2011
@@ -968,7 +968,8 @@
  * \param options Optional options that may change the behavior of this specific payload
  *
  * \retval 0 success
- * \retval -1 failure
+ * \retval -1 failure, invalid payload numbe
+ * \retval -2 failure, unknown mimetype
  *
  * Example usage:
  *

Modified: trunk/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/rtp_engine.c?view=diff&rev=314018&r1=314017&r2=314018
==============================================================================
--- trunk/main/rtp_engine.c (original)
+++ trunk/main/rtp_engine.c Mon Apr 18 08:42:51 2011
@@ -501,8 +501,8 @@
 		}
 
 		/* if both sample rates have been supplied, and they don't match,
-		                      then this not a match; if one has not been supplied, then the
-				      rates are not compared */
+		 * then this not a match; if one has not been supplied, then the
+		 * rates are not compared */
 		if (sample_rate && t->sample_rate &&
 		    (sample_rate != t->sample_rate)) {
 			continue;




More information about the asterisk-commits mailing list