From 4a4670a71ea43306c944ebe87828f105fcc59451 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 3 Jun 2010 10:16:47 -0500 Subject: [PATCH] FSCORE-615 --- src/switch_ivr.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/switch_ivr.c b/src/switch_ivr.c index b466ef0feb..3e143cf3d2 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -1284,6 +1284,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(const char *uuid, switch_medi switch_channel_set_flag(other_channel, CF_RESET); switch_channel_set_flag(other_channel, CF_REDIRECT); + + if (!switch_core_session_in_thread(session)) { + switch_channel_set_state(channel, CS_PARK); + } switch_channel_set_state(other_channel, CS_PARK); if (switch_core_session_in_thread(session)) { switch_yield(100000); @@ -1298,15 +1302,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(const char *uuid, switch_medi switch_core_session_receive_message(session, &msg); - if (!switch_core_session_in_thread(session)) { - switch_channel_set_state(channel, CS_PARK); - switch_channel_wait_for_state(channel, channel, CS_PARK); - 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); - } - if (other_channel) { + if (!switch_core_session_in_thread(session)) { + switch_channel_wait_for_state(channel, channel, CS_PARK); + 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); + } + if (swap) { switch_ivr_signal_bridge(other_session, session); } else {