From: Brian West Date: Sat, 6 Jul 2013 00:50:43 +0000 (-0500) Subject: fix race X-Git-Tag: v1.5.3~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ed53db590ae63ed941a9fe48e56435a903d07a0;p=thirdparty%2Ffreeswitch.git fix race --- diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index c271cc39d3..0da3c398ff 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -3087,16 +3087,21 @@ SWITCH_STANDARD_APP(fifo_function) switch_channel_set_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(other_session)); switch_channel_set_variable(other_channel, SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(session)); + switch_channel_set_variable(switch_core_session_get_channel(other_session), "fifo_initiated_bridge", "true"); + switch_channel_set_variable(switch_core_session_get_channel(other_session), "fifo_bridge_role", "caller"); + switch_channel_set_variable(switch_core_session_get_channel(session), "fifo_initiated_bridge", "true"); + switch_channel_set_variable(switch_core_session_get_channel(session), "fifo_bridge_role", "consumer"); + switch_ivr_multi_threaded_bridge(session, other_session, on_dtmf, other_session, session); - if (!switch_channel_test_flag(other_channel, CF_TRANSFER) || !switch_channel_up(other_channel)) { - switch_channel_set_variable(other_channel, "fifo_initiated_bridge", "true"); - switch_channel_set_variable(other_channel, "fifo_bridge_role", "caller"); + if (switch_channel_test_flag(other_channel, CF_TRANSFER) || switch_channel_up(other_channel)) { + switch_channel_set_variable(switch_core_session_get_channel(other_session), "fifo_initiated_bridge", NULL); + switch_channel_set_variable(switch_core_session_get_channel(other_session), "fifo_bridge_role", NULL); } - - if (!switch_channel_test_flag(channel, CF_TRANSFER) || !switch_channel_up(channel)) { - switch_channel_set_variable(channel, "fifo_initiated_bridge", "true"); - switch_channel_set_variable(channel, "fifo_bridge_role", "consumer"); + + if (switch_channel_test_flag(channel, CF_TRANSFER) || switch_channel_up(channel)) { + switch_channel_set_variable(switch_core_session_get_channel(other_session), "fifo_initiated_bridge", NULL); + switch_channel_set_variable(switch_core_session_get_channel(other_session), "fifo_bridge_role", NULL); } if (outbound_id) {