diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index e885adc307..2893461974 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -785,6 +785,7 @@ static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session) if (uuid && (other_session = switch_core_session_locate(uuid))) { switch_channel_t *other_channel = switch_core_session_get_channel(other_session); const char *sbv = switch_channel_get_variable(other_channel, SWITCH_SIGNAL_BRIDGE_VARIABLE); + const char *var; if (!switch_strlen_zero(sbv) && !strcmp(sbv, switch_core_session_get_uuid(session))) { @@ -792,7 +793,19 @@ static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session) switch_channel_set_variable(other_channel, SWITCH_BRIDGE_VARIABLE, NULL); if (switch_channel_up(other_channel)) { - switch_channel_hangup(other_channel, switch_channel_get_cause(channel)); + + if (switch_true(switch_channel_get_variable(other_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) { + switch_ivr_park_session(other_session); + } else if ((var = switch_channel_get_variable(other_channel, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) { + transfer_after_bridge(other_session, var); + } + + if (switch_channel_test_flag(other_channel, CF_BRIDGE_ORIGINATOR) && + switch_true(switch_channel_get_variable(other_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE))) { + switch_channel_hangup(other_channel, switch_channel_get_cause(channel)); + } else { + switch_channel_set_state(other_channel, CS_EXECUTE); + } } }