From 9414f2dac6f0e78ebd11d1f71b3fdafbfeac66da Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 7 Dec 2007 16:14:09 +0000 Subject: [PATCH] don't hangup when transfering git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6566 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr_bridge.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index 70479e185f..f8e48446b5 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -464,13 +464,14 @@ static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session) switch_channel_set_variable(channel, SWITCH_BRIDGE_VARIABLE, NULL); switch_channel_set_variable(other_channel, SWITCH_BRIDGE_VARIABLE, NULL); - if (switch_channel_test_flag(other_channel, CF_ANSWERED) && - switch_channel_get_state(other_channel) < CS_HANGUP && - !switch_channel_test_flag(other_channel, CF_TRANSFER) && - 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); + if (!switch_channel_test_flag(other_channel, CF_TRANSFER)) { + if (switch_channel_test_flag(other_channel, CF_ANSWERED) && + switch_channel_get_state(other_channel) < CS_HANGUP && + 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); + } } switch_core_session_rwunlock(other_session); } @@ -684,11 +685,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses done: - if (switch_channel_test_flag(peer_channel, CF_ANSWERED) && - switch_channel_get_state(caller_channel) < CS_HANGUP && - !switch_channel_test_flag(caller_channel, CF_TRANSFER) && - switch_true(switch_channel_get_variable(caller_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE))) { - switch_channel_hangup(caller_channel, switch_channel_get_cause(peer_channel)); + if (!switch_channel_test_flag(caller_channel, CF_TRANSFER)) { + if (switch_channel_test_flag(peer_channel, CF_ANSWERED) && + switch_channel_get_state(caller_channel) < 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)); + } } return status;