diff options
author | Michael Kuron <m.kuron@gmx.de> | 2016-10-15 11:58:05 +0200 |
---|---|---|
committer | Michael Kuron <m.kuron@gmx.de> | 2016-10-15 12:17:12 +0200 |
commit | f1fd873df059277131e82f5ee716bb1631428d95 (patch) | |
tree | 21bc6a796606e628b17234bd406b336aa553c123 /channels | |
parent | d1d446b23795baa73969f725a1231dff6e0b0538 (diff) |
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
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 50183c288..63bfd1989 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -8148,12 +8148,17 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit 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) { |