From 5d70df9b1cd038a59f45a261d9b83421051ab725 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 1 Jul 2014 22:31:55 +0500 Subject: [PATCH] FS-6637 try this patch --- src/switch_ivr_bridge.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index b2f1d56375..89fa4d933b 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -1141,10 +1141,18 @@ static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session) } switch_channel_hangup(other_channel, switch_channel_get_cause(channel)); } else { + const char *var; + if (!switch_channel_test_flag(channel, CF_ANSWERED)) { switch_channel_handle_cause(other_channel, switch_channel_get_cause(channel)); + } + + if (switch_channel_test_flag(channel, CF_ANSWERED) && + (var = switch_channel_get_variable(other_channel, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) { + transfer_after_bridge(other_session, var); + } else { + switch_channel_set_state(other_channel, CS_EXECUTE); } - switch_channel_set_state(other_channel, CS_EXECUTE); } } else { switch_channel_hangup(other_channel, switch_channel_get_cause(channel));