diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 93f50a97a3..926c8a6bea 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -1366,6 +1366,7 @@ CF_ACCEPT_CNG - Channel will accept CNG frames CF_REDIRECT - Channel is being redirected CF_BRIDGED - Channel in a bridge CF_HOLD - Channel is on hold +CF_HOLD_BLEG - B leg is on hold CF_SERVICE - Channel has a service thread CF_TAGGED - Channel is tagged CF_WINNER - Channel is the winner @@ -1417,6 +1418,7 @@ typedef enum { CF_REDIRECT, CF_BRIDGED, CF_HOLD, + CF_HOLD_BLEG, CF_SERVICE, CF_TAGGED, CF_WINNER, diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 47e4105fb6..920e4edb4a 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -572,7 +572,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se switch_channel_clear_flag(channel, CF_STOP_BROADCAST); - if (!switch_channel_test_flag(channel, CF_BRIDGED) || switch_channel_test_flag(channel, CF_BROADCAST)) { + if (!switch_channel_test_flag(channel, CF_BRIDGED) || switch_channel_test_flag(channel, CF_HOLD_BLEG)) { inner++; hold_bleg = NULL; } @@ -597,6 +597,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se if ((b_session = switch_core_session_locate(b_uuid))) { switch_channel_t *b_channel = switch_core_session_get_channel(b_session); switch_status_t st; + switch_channel_set_flag(channel, CF_HOLD_BLEG); switch_ivr_broadcast(b_uuid, stream, SMF_ECHO_ALEG | SMF_LOOP); st = switch_channel_wait_for_flag(b_channel, CF_BROADCAST, SWITCH_TRUE, 5000, NULL); @@ -649,6 +650,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se if (b_uuid) { if ((b_session = switch_core_session_locate(b_uuid))) { switch_channel_t *b_channel = switch_core_session_get_channel(b_session); + switch_channel_clear_flag(channel, CF_HOLD_BLEG); switch_channel_stop_broadcast(b_channel); switch_channel_wait_for_flag(b_channel, CF_BROADCAST, SWITCH_FALSE, 5000, NULL); switch_core_session_rwunlock(b_session);