FS-8118 #resolve [Verto calls do not properly reject video when video is offered but only audio is accepted]

This commit is contained in:
Anthony Minessale 2015-09-02 18:07:58 -05:00
parent b92d4c2a59
commit 8ee69ead0d
2 changed files with 14 additions and 3 deletions

View File

@ -1494,6 +1494,7 @@ typedef enum {
CF_3P_MEDIA_REQUESTED,
CF_3P_NOMEDIA_REQUESTED,
CF_3P_NOMEDIA_REQUESTED_BLEG,
CF_VIDEO_SDP_RECVD,
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
/* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
CF_FLAG_MAX

View File

@ -4432,6 +4432,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
memset(near_matches, 0, sizeof(near_matches[0]) * MAX_MATCHES);
switch_channel_set_variable(session->channel, "video_possible", "true");
switch_channel_set_flag(session->channel, CF_VIDEO_SDP_RECVD);
connection = sdp->sdp_connection;
if (m->m_connections) {
@ -7722,7 +7723,16 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
}
if (switch_channel_test_flag(session->channel, CF_VIDEO_POSSIBLE)) {
if (!switch_channel_test_flag(session->channel, CF_VIDEO_POSSIBLE)) {
if (switch_channel_test_flag(session->channel, CF_VIDEO_SDP_RECVD)) {
switch_channel_clear_flag(session->channel, CF_VIDEO_SDP_RECVD);
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "m=video 0 %s 19\n",
get_media_profile_name(session,
(switch_channel_test_flag(session->channel, CF_SECURE)
&& switch_channel_direction(session->channel) == SWITCH_CALL_DIRECTION_OUTBOUND) ||
a_engine->crypto_type != CRYPTO_INVALID || switch_channel_test_flag(session->channel, CF_DTLS)));
}
} else {
if (switch_channel_direction(session->channel) == SWITCH_CALL_DIRECTION_INBOUND) {
if (switch_channel_test_flag(smh->session->channel, CF_DTLS)) {
v_engine->no_crypto = 1;