From 3b50883734c3e5c69491486c94ee9770b8bae61f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 14 Nov 2016 11:34:56 -0600 Subject: [PATCH] FS-9638 passing codec through on unanswered channels too (late neg) --- src/switch_core_media.c | 6 ++++++ src/switch_core_session.c | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index bce932b77c..037f3218b9 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -12426,6 +12426,12 @@ static void switch_core_media_set_r_sdp_codec_string(switch_core_session_t *sess } } } + } else if (m->m_proto == sdp_proto_msrp) { + switch_channel_set_flag(channel, CF_WANT_MSRP); + } else if (m->m_proto == sdp_proto_msrps) { + switch_channel_set_flag(channel, CF_WANT_MSRPS); + } else if (m->m_type == sdp_media_text) { + switch_channel_set_flag(channel, CF_WANT_RTT); } } diff --git a/src/switch_core_session.c b/src/switch_core_session.c index 2e84dd7b5e..4dd2e2a6c0 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -647,7 +647,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_ if (channel) { const char *val; switch_codec_t *vid_read_codec = NULL, *read_codec = switch_core_session_get_read_codec(session); - const char *ep, *max_forwards = switch_core_session_sprintf(session, "%d", forwardval); + const char *ep = NULL, *max_forwards = switch_core_session_sprintf(session, "%d", forwardval); switch_channel_set_variable(peer_channel, SWITCH_MAX_FORWARDS_VARIABLE, max_forwards); @@ -655,6 +655,8 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_ vid_read_codec = switch_core_session_get_video_read_codec(session); + ep = switch_channel_get_variable(channel, "ep_codec_string"); + if (read_codec && read_codec->implementation && switch_core_codec_ready(read_codec)) { char rc[80] = "", vrc[80] = "", tmp[160] = ""; @@ -667,18 +669,18 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_ switch_snprintf(tmp, sizeof(tmp), "%s%s", rc, vrc); switch_channel_set_variable(peer_channel, SWITCH_ORIGINATOR_CODEC_VARIABLE, tmp); - } else if ((ep = switch_channel_get_variable(channel, "ep_codec_string"))) { + } else if (ep) { switch_channel_set_variable(peer_channel, SWITCH_ORIGINATOR_CODEC_VARIABLE, ep); } - if (switch_channel_test_flag(channel, CF_MSRPS)) { + if (switch_channel_test_flag(channel, CF_MSRPS) || switch_channel_test_flag(channel, CF_WANT_MSRPS)) { switch_channel_set_flag(peer_channel, CF_WANT_MSRPS); - } else if (switch_channel_test_flag(channel, CF_MSRP)) { + } else if (switch_channel_test_flag(channel, CF_MSRP) || switch_channel_test_flag(channel, CF_WANT_MSRP)) { switch_channel_set_flag(peer_channel, CF_WANT_MSRP); } - if (switch_channel_test_flag(channel, CF_RTT)) { + if (switch_channel_test_flag(channel, CF_RTT) || switch_channel_test_flag(channel, CF_WANT_RTT)) { switch_channel_set_flag(peer_channel, CF_WANT_RTT); }