diff --git a/src/switch_core_io.c b/src/switch_core_io.c index e1e61f902b..cecf6dea78 100644 --- a/src/switch_core_io.c +++ b/src/switch_core_io.c @@ -730,7 +730,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_kill_channel(switch_ switch_io_event_hook_kill_channel_t *ptr; switch_status_t status = SWITCH_STATUS_FALSE; - switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_INFO, "Kill %s [%s]\n", switch_channel_get_name(session->channel), + switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_DEBUG, "Kill %s [%s]\n", switch_channel_get_name(session->channel), SIG_NAMES[sig]); if (session->endpoint_interface->io_routines->kill_channel) { diff --git a/src/switch_core_session.c b/src/switch_core_session.c index bf842b496e..66e92fe699 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -626,7 +626,7 @@ SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session { switch_status_t status = SWITCH_STATUS_SUCCESS; switch_io_event_hook_state_change_t *ptr; - + /* If trylock fails the signal is already awake so we needn't bother */ if (switch_mutex_trylock(session->mutex) == SWITCH_STATUS_SUCCESS) { switch_thread_cond_signal(session->cond); @@ -644,6 +644,7 @@ SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session } } } + switch_core_session_kill_channel(session, SWITCH_SIG_BREAK); } SWITCH_DECLARE(unsigned int) switch_core_session_running(switch_core_session_t *session) diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 70e1638205..f96fe4fdcf 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -749,7 +749,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_media(char *uuid, switch_media_flag_t if (switch_channel_test_flag(channel, CF_BYPASS_MEDIA)) { status = SWITCH_STATUS_SUCCESS; - switch_channel_clear_flag(channel, CF_BYPASS_MEDIA); switch_core_session_receive_message(session, &msg); if ((flags & SMF_REBRIDGE) @@ -765,7 +764,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_media(char *uuid, switch_media_flag_t switch_channel_clear_state_handler(channel, NULL); } } - + switch_core_session_rwunlock(session); if (other_channel) { @@ -803,22 +802,21 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(char *uuid, switch_media_flag } if ((flags & SMF_FORCE) || !switch_channel_test_flag(channel, CF_BYPASS_MEDIA)) { - switch_ivr_parse_all_events(session); - + //switch_ivr_parse_all_events(session); + switch_core_session_receive_message(session, &msg); + if ((flags & SMF_REBRIDGE) && (other_uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(other_uuid))) { other_channel = switch_core_session_get_channel(other_session); assert(other_channel != NULL); - - switch_ivr_parse_all_events(other_session); + //switch_ivr_parse_all_events(other_session); switch_core_session_receive_message(other_session, &msg); switch_channel_clear_state_handler(other_channel, NULL); } - switch_channel_set_flag(channel, CF_BYPASS_MEDIA); - switch_core_session_receive_message(session, &msg); + if (other_channel) { switch_channel_clear_state_handler(channel, NULL); diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index c13b73813d..9e2904df11 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -98,7 +98,7 @@ static void *audio_bridge_thread(switch_thread_t * thread, void *obj) break; } - if (loop_count > 10 && switch_core_session_private_event_count(session_a)) { + if (loop_count > 50 && switch_core_session_private_event_count(session_a)) { switch_channel_set_flag(chan_b, CF_SUSPEND); msg.string_arg = data->b_uuid; msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE; @@ -491,7 +491,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t * switch_channel_set_state_flag(caller_channel, CF_TRANSFER); switch_channel_set_state_flag(peer_channel, CF_TRANSFER); - + switch_channel_set_state(caller_channel, CS_HIBERNATE); switch_channel_set_state(peer_channel, CS_HIBERNATE);