switch_channel_set_flag(other_channel, CF_RESET);
switch_channel_set_flag(other_channel, CF_REDIRECT);
switch_channel_set_state(other_channel, CS_PARK);
- switch_channel_wait_for_state(other_channel, channel, CS_PARK);
+ if (switch_core_session_in_thread(session)) {
+ switch_yield(100000);
+ } else {
+ switch_channel_wait_for_state(other_channel, channel, CS_PARK);
+ }
switch_core_session_receive_message(other_session, &msg);
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_ivr_signal_bridge(session, other_session);
}
- switch_channel_wait_for_state(other_channel, channel, CS_HIBERNATE);
+ if (switch_core_session_in_thread(session)) {
+ switch_yield(100000);
+ } else {
+ switch_channel_wait_for_state(other_channel, channel, CS_HIBERNATE);
+ }
if (!switch_core_session_in_thread(session)) {
switch_channel_wait_for_state(channel, other_channel, CS_HIBERNATE);
switch_ivr_nomedia(switch_core_session_get_uuid(session_a), SMF_REBRIDGE);
bypass_media_after_bridge = 0;
switch_channel_clear_flag(chan_a, CF_BYPASS_MEDIA_AFTER_BRIDGE);
+ goto end_of_bridge_loop;
}
/* if 1 channel has DTMF pass it to the other */