[Asterisk-code-review] chan sip: Only send video on outgoing channel if incoming ch... (asterisk[master])

Anonymous Coward asteriskteam at digium.com
Mon Oct 17 10:37:51 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: chan_sip: Only send video on outgoing channel if incoming channel supports it
......................................................................


chan_sip: Only send video on outgoing channel if incoming channel supports it

Previously, the settings videosupport=always and videosupport=yes behaved
identically and unconditionally caused a video offer to be sent in the SDP on
an outgoing call. This was a regression introduced with commit
5a1d90e1fbfc4b48927aad55311f3b38efbf1f54 in Asterisk 1.6.1.

This commit restores correct behavior: videosupport=always causes a video offer
to be sent unconditionally, while videosupport=yes will only offer video on an
outbound channel if the incoming channel it is bridged to also supports video.
That way, the device receiving the outgoing call can display the correct user
interface elements for audio or video and will not unnecessarily show a blank
video window on an audio-only call.

ASTERISK-17470 #close

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

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 47b90d7..7801681 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -8153,12 +8153,17 @@
 	   We also check for vrtp. If it's not there, we are not allowed do any video anyway.
 	 */
 	if (i->vrtp) {
-		if (ast_test_flag(&i->flags[1], SIP_PAGE2_VIDEOSUPPORT))
+		if (ast_test_flag(&i->flags[1], SIP_PAGE2_VIDEOSUPPORT_ALWAYS))
 			needvideo = 1;
 		else if (ast_format_cap_count(i->prefcaps))
 			needvideo = ast_format_cap_has_type(i->prefcaps, AST_MEDIA_TYPE_VIDEO);	/* Outbound call */
 		else
 			needvideo = ast_format_cap_has_type(i->jointcaps, AST_MEDIA_TYPE_VIDEO);	/* Inbound call */
+
+		if (!needvideo) {
+			ast_rtp_instance_destroy(i->vrtp);
+			i->vrtp = NULL;
+		}
 	}
 
 	if (i->trtp) {

-- 
To view, visit https://gerrit.asterisk.org/4114
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I782f4409d436114dbc97061c3570c0cd24f7c3ae
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Michael Kuron <m.kuron at gmx.de>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list