[Asterisk-code-review] chan_sip: Handle invalid SDP answer to T.38 re-invite (...asterisk[certified/13.21])

Benjamin Keith Ford asteriskteam at digium.com
Thu Jul 11 14:01:01 CDT 2019


Benjamin Keith Ford has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/11551 )

Change subject: chan_sip: Handle invalid SDP answer to T.38 re-invite
......................................................................

chan_sip: Handle invalid SDP answer to T.38 re-invite

The chan_sip module performs a T.38 re-invite using a single media
stream of udptl, and expects the SDP answer to be the same.

If an SDP answer is received instead that contains an additional
media stream with no joint codec a crash will occur as the code
assumes that at least one joint codec will exist in this
scenario.

This change removes this assumption.

ASTERISK-28465

Change-Id: I8b02845b53344c6babe867a3f0a5231045c7ac87
---
M channels/chan_sip.c
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Benjamin Keith Ford: Looks good to me, approved; Approved for Submit



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 0f64309..f154f59 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -10910,7 +10910,13 @@
 			    ast_rtp_lookup_mime_multiple2(s3, NULL, newnoncodeccapability, 0, 0));
 	}
 
-	if (portno != -1 || vportno != -1 || tportno != -1) {
+	/* When UDPTL is negotiated it is expected that there are no compatible codecs as audio or
+	 * video is not being transported, thus we continue in this function further up if that is
+	 * the case. If we receive an SDP answer containing both a UDPTL stream and another media
+	 * stream however we need to check again to ensure that there is at least one joint codec
+	 * instead of assuming there is one.
+	 */
+	if ((portno != -1 || vportno != -1 || tportno != -1) && ast_format_cap_count(newjointcapability)) {
 		/* We are now ready to change the sip session and RTP structures with the offered codecs, since
 		   they are acceptable */
 		unsigned int framing;

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11551
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: certified/13.21
Gerrit-Change-Id: I8b02845b53344c6babe867a3f0a5231045c7ac87
Gerrit-Change-Number: 11551
Gerrit-PatchSet: 1
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Francesco Castellano <francesco.castellano at messagenet.it>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190711/b52a85ec/attachment.html>


More information about the asterisk-code-review mailing list