[asterisk-commits] kpfleming: trunk r368269 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 1 15:42:18 CDT 2012


Author: kpfleming
Date: Fri Jun  1 15:42:10 2012
New Revision: 368269

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=368269
Log:
Improve SDP offer/answer RFC compliance

Asterisk should not accept SDP offers that contain unknown RTP profiles (for
audio/video streams) or unknown top-level media types. When it does, it answers
with an SDP that does not match the offer properly, and this will nearly
always result in a broken call. This patch causes such offers to be rejected.

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


Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=368269&r1=368268&r2=368269
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Jun  1 15:42:10 2012
@@ -9225,7 +9225,8 @@
 					secure_audio = 1;
 				} else if (strcmp(protocol, "AVP")) {
 					ast_log(LOG_WARNING, "Unknown RTP profile in audio offer: %s\n", m);
-					continue;
+					res = -1;
+					goto process_sdp_cleanup;
 				}
 
 				if (p->offered_media[SDP_AUDIO].order_offered) {
@@ -9277,7 +9278,8 @@
 					secure_video = 1;
 				} else if (strcmp(protocol, "AVP")) {
 					ast_log(LOG_WARNING, "Unknown RTP profile in video offer: %s\n", m);
-					continue;
+					res = -1;
+					goto process_sdp_cleanup;
 				}
 
 				if (p->offered_media[SDP_VIDEO].order_offered) {
@@ -9398,7 +9400,8 @@
 			}
 		} else {
 			ast_log(LOG_WARNING, "Unsupported top-level media type in offer: %s\n", m);
-			continue;
+			res = -1;
+			goto process_sdp_cleanup;
 		}
 
 		/* Media stream specific parameters */




More information about the asterisk-commits mailing list