From dd2ad0e3005bb371a622a07ac95eb512a23f5a69 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 4 Feb 2016 15:25:33 -0600 Subject: [PATCH] FS-6833 --- src/mod/endpoints/mod_sofia/sofia.c | 6 ++++-- src/switch_ivr.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 8cf8abb0aa..053c1c5b25 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -6978,7 +6978,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } if (switch_channel_test_flag(channel, CF_3P_NOMEDIA_REQUESTED)) { - switch_channel_clear_flag(channel, CF_3P_NOMEDIA_REQUESTED); + if (switch_channel_test_flag(channel, CF_3P_NOMEDIA_REQUESTED_BLEG)) { switch_core_session_t *other_session; @@ -7010,12 +7010,12 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, switch_channel_set_variable(channel, SWITCH_R_SDP_VARIABLE, r_sdp); } + switch_channel_clear_flag(channel, CF_3P_NOMEDIA_REQUESTED); goto done; } else if (switch_channel_test_flag(channel, CF_3P_MEDIA_REQUESTED)) { uint8_t match = 0; - switch_channel_clear_flag(channel, CF_3P_MEDIA_REQUESTED); switch_channel_clear_flag(channel, CF_PROXY_MODE); switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0); @@ -7055,12 +7055,14 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, //TAG_IF(sofia_test_pflag(tech_pvt->profile, PFLAG_DISABLE_100REL), NUTAG_INCLUDE_EXTRA_SDP(1)), TAG_END()); + switch_channel_clear_flag(channel, CF_3P_MEDIA_REQUESTED); goto done; } switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "NO CODECS"); switch_channel_hangup(channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION); + switch_channel_clear_flag(channel, CF_3P_MEDIA_REQUESTED); goto done; //ss_state = nua_callstate_ready; //goto state_process; diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 8cd8325d1b..649debd65a 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -1623,6 +1623,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_3p_media(const char *uuid, switch_med switch_channel_wait_for_flag(channel, CF_REQ_MEDIA, SWITCH_FALSE, 10000, NULL); switch_channel_wait_for_flag(channel, CF_MEDIA_ACK, SWITCH_TRUE, 10000, NULL); switch_channel_wait_for_flag(channel, CF_MEDIA_SET, SWITCH_TRUE, 10000, NULL); + switch_channel_wait_for_flag(channel, CF_3P_MEDIA_REQUESTED, SWITCH_FALSE, 10000, NULL); //switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); } @@ -1640,6 +1641,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_3p_media(const char *uuid, switch_med switch_channel_wait_for_flag(other_channel, CF_REQ_MEDIA, SWITCH_FALSE, 10000, NULL); switch_channel_wait_for_flag(other_channel, CF_MEDIA_ACK, SWITCH_TRUE, 10000, NULL); switch_channel_wait_for_flag(other_channel, CF_MEDIA_SET, SWITCH_TRUE, 10000, NULL); + switch_channel_wait_for_flag(other_channel, CF_3P_MEDIA_REQUESTED, SWITCH_FALSE, 10000, NULL); //switch_core_session_read_frame(other_session, &read_frame, SWITCH_IO_FLAG_NONE, 0); switch_channel_clear_state_handler(other_channel, NULL); switch_core_session_rwunlock(other_session);