]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4470 --resolve 2 for one fix
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 27 Jul 2012 15:44:16 +0000 (10:44 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 27 Jul 2012 15:44:16 +0000 (10:44 -0500)
src/switch_ivr.c

index 69f77808c1328c3e74af3dee8a9e3125da497be6..8c0f3226c93bb57186e65da2bfc36f2c3e99c14a 100644 (file)
@@ -1690,6 +1690,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_
 
                switch_channel_set_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE, NULL);
 
+               /* Set CF_TRANSFER flag before hanging up bleg to avoid race condition */
+               switch_channel_set_flag(channel, CF_TRANSFER);
+
                /* If HANGUP_AFTER_BRIDGE is set to 'true', SWITCH_SIGNAL_BRIDGE_VARIABLE 
                 * will not have a value, so we need to check SWITCH_BRIDGE_VARIABLE */
 
@@ -1725,8 +1728,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_
                }
 
                switch_channel_set_caller_profile(channel, new_profile);
-               switch_channel_set_flag(channel, CF_TRANSFER);
-               
+
                switch_channel_set_state(channel, CS_ROUTING);
 
                msg.message_id = SWITCH_MESSAGE_INDICATE_TRANSFER;