[Asterisk-code-review] res_pjsip_sdp_rtp: Fix return code from apply_negotiated_sdp_stream (...asterisk[15.7])

Kevin Harwell asteriskteam at digium.com
Thu Feb 28 12:21:20 CST 2019


Kevin Harwell has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/11072 )

Change subject: res_pjsip_sdp_rtp:  Fix return code from apply_negotiated_sdp_stream
......................................................................

res_pjsip_sdp_rtp:  Fix return code from apply_negotiated_sdp_stream

apply_negotiated_sdp_stream was returning a "1" when no joint
capabilities were found on an outgoing call instead of a "-1".
This indicated to res_pjsip_session that the handler DID handle
the sdp when in fact it didn't.  Without the appropriate setup,
a subsequent media frame coming in would have an invalid stream_num
and cause a seg fault when the stream was attempted to be retrieved.

apply_negotiated_sdp_stream now returns the correct "-1" and any
media is now discarded before it reaches the core stream processing.

ASTERISK-28260
Reported by: Sotiris Ganouris

Change-Id: Ia095cb16b4862f2f6ad6d2d2a77453fa2542371f
---
M res/res_pjsip_sdp_rtp.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve; Verified
  Kevin Harwell: Looks good to me, approved; Approved for Submit



diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index e2067cc..7f5a859 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -1941,7 +1941,7 @@
 	}
 
 	if (set_caps(session, session_media, session_media_transport, remote_stream, 0, asterisk_stream)) {
-		return 1;
+		return -1;
 	}
 
 	/* Set the channel uniqueid on the RTP instance now that it is becoming active */

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

Gerrit-Project: asterisk
Gerrit-Branch: 15.7
Gerrit-Change-Id: Ia095cb16b4862f2f6ad6d2d2a77453fa2542371f
Gerrit-Change-Number: 11072
Gerrit-PatchSet: 2
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190228/a066a8cc/attachment.html>


More information about the asterisk-code-review mailing list