<div dir="ltr">Perhaps try setting based on the UUID, rather than the leg:<div><br></div><div><a href="http://wiki.freeswitch.org/wiki/Mod_commands#uuid_setvar">http://wiki.freeswitch.org/wiki/Mod_commands#uuid_setvar</a><br>
<br><action application="export" data="nolocal:execute_on_answer=uuid_setvar ${uuid} bridged=1"/></div><div><br></div><div><br></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">
<span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small">-Avi<br>
</span></div></div>
<br><br><div class="gmail_quote">On Mon, Jun 30, 2014 at 12:38 PM, Grant Bagdasarian <span dir="ltr"><<a href="mailto:GB@cm.nl" target="_blank">GB@cm.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal">Hello,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I’m first doing a originate which hits the below dialplan when answered. When it’s answered I’m setting a variable named “bridged” to 0.<u></u><u></u></p>
<p class="MsoNormal">When the user presses the “critical_option_digit” the call is bridged to another destination. <u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I need to know if this bridge was answered or not. <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I tried different ways of execute_on_answer but that didn’t work:<u></u><u></u></p><p class="MsoNormal"><action application="set" data="execute_on_answer=set bridged=1"/><u></u><u></u></p>
<p class="MsoNormal"><action application="set" data="nolocal:execute_on_answer=set bridged=1"/><u></u><u></u></p><p class="MsoNormal"><action application="export" data="execute_on_answer=set bridged=1"/><u></u><u></u></p>
<p class="MsoNormal"><action application="export" data="nolocal:execute_on_answer=set bridged=1"/><u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">It is important the bridged variable is set to 1 on the first leg and a header is appended to the BYE/200 OK(BYE) of the first leg containing this new value.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Any ideas how to fix this?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><?xml version="1.0" encoding="utf-8"?><u></u><u></u></p>
<p class="MsoNormal"><include><u></u><u></u></p><p class="MsoNormal"> <context name="outbound_cc"><u></u><u></u></p><p class="MsoNormal"> <extension name="start"><u></u><u></u></p>
<p class="MsoNormal"> <condition field="destination_number" expression="^(start)$" require-nested="false"><u></u><u></u></p><p class="MsoNormal"> <action application="answer" /><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> <action application="set" data="bridge_early_media=true" /><u></u><u></u></p><p class="MsoNormal"> <action application="set" data="hangup_after_bridge=false" /><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"> <action application="set" data="critical_option_digit=1" /><u></u><u></u></p><p class="MsoNormal"> <action application="set" data="transfer_destination=0031123456789" /><u></u><u></u></p>
<p class="MsoNormal"> <action application="set" data="bridged=0" /><u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> <!--Ask And Collect Message--><u></u><u></u></p>
<p class="MsoNormal"> <action application="play_and_get_digits" data="1 1 2 5000 # welcome.wav invalid.wav dtmfInput \d 2500"/><u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">
<action application="transfer" data="act_on_input XML outbound_cc" /><u></u><u></u></p><p class="MsoNormal"> </condition><u></u><u></u></p><p class="MsoNormal"> </extension><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> <extension name="act_on_input"><u></u><u></u></p><p class="MsoNormal"> <condition field="${dtmfInput}" expression="${critical_option_digit}" break="never"><u></u><u></u></p>
<p class="MsoNormal"> <!--Bridge--><u></u><u></u></p><p class="MsoNormal"> <action application="set" data="execute_on_answer=set bridged=1"/><u></u><u></u></p><p class="MsoNormal">
<action application="bridge" data="{sip_copy_custom_headers=false}sofia/outbound/${transfer_destination}@$${outbound_load_balancer_sip_ip}:$${outbound_load_balancer_sip_port}" /><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> <action application="export" data="sip_bye_h_X-CollectedData=&lt;CollectedData&gt;&lt;DTMFInput&gt;${dtmfInput}&lt;/DTMFInput&gt;&lt;BridgeSucceeded&gt;${bridged}&lt;/BridgeSucceeded&gt;&lt;/CollectedData&gt;"/><u></u><u></u></p>
<p class="MsoNormal"> <action application="export" data="sip_rh_X-CollectedData=&lt;CollectedData&gt;&lt;DTMFInput&gt;${dtmfInput}&lt;/DTMFInput&gt;&lt;BridgeSucceeded&gt;${bridged}&lt;/BridgeSucceeded&gt;&lt;/CollectedData&gt;"/><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> <!--Hangup the channel--><u></u><u></u></p><p class="MsoNormal"> <anit-action application="export" data="sip_bye_h_X-CollectedData=&lt;CollectedData&gt;&lt;DTMFInput&gt;${dtmfInput}&lt;/DTMFInput&gt;&lt;BridgeSucceeded&gt;${bridged}&lt;/BridgeSucceeded&gt;&lt;/CollectedData&gt;"/><u></u><u></u></p>
<p class="MsoNormal"> <anit-action application="export" data="sip_rh_X-CollectedData=&lt;CollectedData&gt;&lt;DTMFInput&gt;${dtmfInput}&lt;/DTMFInput&gt;&lt;BridgeSucceeded&gt;${bridged}&lt;/BridgeSucceeded&gt;&lt;/CollectedData&gt;"/><u></u><u></u></p>
<p class="MsoNormal"> <anti-action application="hangup"/><u></u><u></u></p><p class="MsoNormal"> </condition><u></u><u></u></p><p class="MsoNormal"> </extension><u></u><u></u></p>
<p class="MsoNormal"> </context><u></u><u></u></p><p class="MsoNormal"></include><u></u><u></u></p></div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div>