diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 34e05da683..4fd03d387c 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -153,6 +153,7 @@ SWITCH_BEGIN_EXTERN_C #define SWITCH_LOCAL_VIDEO_IP_VARIABLE "local_video_ip" #define SWITCH_LOCAL_VIDEO_PORT_VARIABLE "local_video_port" #define SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE "hangup_after_bridge" +#define SWITCH_PARK_AFTER_BRIDGE_VARIABLE "park_after_bridge" #define SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE "exec_after_bridge_app" #define SWITCH_EXEC_AFTER_BRIDGE_ARG_VARIABLE "exec_after_bridge_arg" #define SWITCH_MAX_FORWARDS_VARIABLE "max_forwards" diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index 9c9baf4edc..643c4848c4 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -939,9 +939,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses if (!switch_channel_test_flag(caller_channel, CF_TRANSFER) && !a_leg->clean_exit && !inner_bridge) { if ((state != CS_EXECUTE && state != CS_SOFT_EXECUTE && state != CS_PARK && state != CS_ROUTING) || - (switch_channel_test_flag(peer_channel, CF_ANSWERED) && state < CS_HANGUP && - switch_true(switch_channel_get_variable(caller_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE)))) { - switch_channel_hangup(caller_channel, switch_channel_get_cause(peer_channel)); + (switch_channel_test_flag(peer_channel, CF_ANSWERED) && state < CS_HANGUP)) { + if (switch_true(switch_channel_get_variable(caller_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE))) { + switch_channel_hangup(caller_channel, switch_channel_get_cause(peer_channel)); + } else if (switch_true(switch_channel_get_variable(caller_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) { + switch_ivr_park_session(session); + } } }