From ed5266d3ca944036165a26d06eac3a3fcd0b88a5 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 29 Nov 2010 15:34:27 -0600 Subject: [PATCH] don't parse events for b legs from a leg thread in case they are using a monolothic python script as a group_confirm exec over socket to send it messages while the call is ringing --- src/switch_ivr_originate.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index da76cf6cbc..f99ac69188 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -635,8 +635,15 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat } } } - - switch_ivr_parse_all_events(originate_status[i].peer_session); + + if (!switch_channel_test_flag(originate_status[i].peer_channel, CF_PARK) && + !switch_channel_test_flag(originate_status[i].peer_channel, CF_CONSUME_ON_ORIGINATE)) { + if (switch_channel_test_flag(originate_status[i].peer_channel, CF_THREAD_SLEEPING)) { + switch_core_session_wake_session_thread(originate_status[i].peer_session); + } else { + switch_ivr_parse_all_events(originate_status[i].peer_session); + } + } state = switch_channel_get_state(originate_status[i].peer_channel); if (state >= CS_HANGUP || state == CS_RESET || switch_channel_test_flag(originate_status[i].peer_channel, CF_TRANSFER) ||