From: Anthony Minessale Date: Wed, 10 Jun 2015 21:18:32 +0000 (-0500) Subject: FS-7636 #resolve X-Git-Tag: v1.6.2~522 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b47692597c0f49a738d8380541edad15237ce8d;p=thirdparty%2Ffreeswitch.git FS-7636 #resolve --- diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index a39de8d31e..0a242b0796 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -724,27 +724,30 @@ static switch_status_t audio_bridge_on_exchange_media(switch_core_session_t *ses state = switch_channel_get_state(channel); - if (state < CS_HANGUP && switch_true(switch_channel_get_variable(channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) { - switch_ivr_park_session(session); - } else if (state < CS_HANGUP && (var = switch_channel_get_variable(channel, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) { - transfer_after_bridge(session, var); - } else { - if (!switch_channel_test_flag(channel, CF_TRANSFER) && !switch_channel_test_flag(channel, CF_REDIRECT) && - !switch_channel_test_flag(channel, CF_XFER_ZOMBIE) && bd && !bd->clean_exit - && state != CS_PARK && state != CS_ROUTING && state == CS_EXCHANGE_MEDIA && !switch_channel_test_flag(channel, CF_INNER_BRIDGE)) { - if (switch_channel_test_flag(channel, CF_INTERCEPTED)) { - switch_channel_clear_flag(channel, CF_INTERCEPT); - switch_channel_clear_flag(channel, CF_INTERCEPTED); - return SWITCH_STATUS_FALSE; + if (!switch_channel_test_flag(channel, CF_TRANSFER) && !switch_channel_test_flag(channel, CF_REDIRECT) && + !switch_channel_test_flag(channel, CF_XFER_ZOMBIE) && bd && !bd->clean_exit && state != CS_PARK && state != CS_ROUTING && + state == CS_EXCHANGE_MEDIA && !switch_channel_test_flag(channel, CF_INNER_BRIDGE)) { + + if (state < CS_HANGUP && switch_true(switch_channel_get_variable(channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) { + switch_ivr_park_session(session); + return SWITCH_STATUS_FALSE; + } else if (state < CS_HANGUP && (var = switch_channel_get_variable(channel, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) { + transfer_after_bridge(session, var); + return SWITCH_STATUS_FALSE; + } + + if (switch_channel_test_flag(channel, CF_INTERCEPTED)) { + switch_channel_clear_flag(channel, CF_INTERCEPT); + switch_channel_clear_flag(channel, CF_INTERCEPTED); + return SWITCH_STATUS_FALSE; + } else { + if (switch_channel_test_flag(channel, CF_INTERCEPT)) { + switch_channel_hangup(channel, SWITCH_CAUSE_PICKED_OFF); } else { - if (switch_channel_test_flag(channel, CF_INTERCEPT)) { - switch_channel_hangup(channel, SWITCH_CAUSE_PICKED_OFF); + if (!switch_channel_test_flag(channel, CF_ANSWERED)) { + switch_channel_hangup(channel, SWITCH_CAUSE_ORIGINATOR_CANCEL); } else { - if (!switch_channel_test_flag(channel, CF_ANSWERED)) { - switch_channel_hangup(channel, SWITCH_CAUSE_ORIGINATOR_CANCEL); - } else { - switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); - } + switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); } } }