<div dir="ltr">try not nesting your conditions and stack them instead.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 23, 2016 at 2:12 PM, Varsha Agarwal <span dir="ltr">&lt;<a href="mailto:vagarwal@vertical.com" target="_blank">vagarwal@vertical.com</a>&gt;</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"><span style="color:#1f497d">Thanks for the reply. I changed dialplan as following and still same results<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">&lt;!--Sample load balancing--&gt;<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="color:#1f497d">    &lt;extension name=&quot;balance_load&quot;&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">      &lt;condition field=&quot;destination_number&quot; expression=&quot;^5050$&quot;&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">                &lt;action application=&quot;set&quot; data=&quot;continue_on_fail=true&quot;/&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">                &lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;/&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">                &lt;action application=&quot;log&quot; data=&quot;INFO *********LOG LEVEL******** [${current_node}]&quot;/&gt;<u></u><u></u></span></p>
</span><p class="MsoNormal"><span style="color:#1f497d">                &lt;condition field=&quot;${current_node}&quot; expression=&quot;^1$&quot;&gt;
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">                                &lt;action=&quot;set&quot; data=&quot;current_node=2&quot;  inline=&quot;true&quot;/&gt;<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="color:#1f497d">                                &lt;action application=&quot;log&quot; data=&quot;INFO *********LOG LEVEL******** [${current_node}]&quot;/&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">                                &lt;action application=&quot;bridge&quot; data=&quot;loopback/5000&quot;/&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">                &lt;/condition&gt;<u></u><u></u></span></p>
</span><p class="MsoNormal"><span style="color:#1f497d">                &lt;condition field=&quot;${current_node}&quot; expression=&quot;^2$&quot;&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">                                &lt;action=&quot;set&quot; data=&quot;current_node=1&quot;  inline=&quot;true&quot;/&gt;<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="color:#1f497d">                                &lt;action application=&quot;log&quot; data=&quot;INFO *********LOG LEVEL******** [${current_node}]&quot;/&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">                                &lt;action application=&quot;bridge&quot; data=&quot;sofia/external/<a href="mailto:5000@172.18.19.72" target="_blank">5000@172.18.19.72</a>&quot;/&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">                &lt;/condition&gt;<u></u><u></u></span></p>
</span><p class="MsoNormal"><span style="color:#1f497d">                &lt;action=&quot;set&quot; data=&quot;current_node=2&quot;  inline=&quot;true&quot;/&gt;<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="color:#1f497d">                &lt;action application=&quot;log&quot; data=&quot;INFO *********LOG LEVEL AFTER******** [${current_node}]&quot;/&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">                &lt;action application=&quot;bridge&quot; data=&quot;loopback/5000&quot;/&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">                <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">      &lt;/condition&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">    &lt;/extension&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
</span><p class="MsoNormal"><span style="color:#1f497d">Interestingly this is what I see in Freeswitch traces<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">2016-03-23 11:07:22.895579 [INFO] mod_dptools.c:1692 *********LOG LEVEL******** [1]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">2016-03-23 11:07:22.895579 [INFO] mod_dptools.c:1692 *********LOG LEVEL AFTER******** [1]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">2016-03-23 11:07:22.895579 [INFO] mod_loopback.c:1075 Sending early media<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">Even if value for &quot;current_node&quot; is 1 it does not go to &lt;condition field=&quot;${current_node}&quot; expression=&quot;^1$&quot;&gt; condition. At least it should go there.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>]
<b>On Behalf Of </b>Ken Rice<br>
<b>Sent:</b> Wednesday, March 23, 2016 6:07 AM<br>
<b>To:</b> &#39;FreeSWITCH Users Help&#39;<br>
<b>Subject:</b> Re: [Freeswitch-users] Need to set and get Global vairables from dialplan<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">As with any variables (channel or global) variables are expanded when the dialplan is processed, then a list of actions is built, based on conditions that are met. This is called the Routing Stage in FreeSWITCH Call Processing.<u></u><u></u></p>
<p class="MsoNormal">One that Routing Stage is completed, then we move to the Execute Stage where the Actions (or anti-actions) that were added to the list of things to do are executed.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">In your example the vars are expanded before the set and log application actions are actually executed.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">See <a href="https://freeswitch.org/confluence/display/FREESWITCH/XML+Dialplan" target="_blank">
https://freeswitch.org/confluence/display/FREESWITCH/XML+Dialplan</a> and look for inline=”true” for a more complete explanation on way to do what you are trying.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">
freeswitch-users-bounces@lists.freeswitch.org</a> [<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">mailto:freeswitch-users-bounces@lists.freeswitch.org</a>]
<b>On Behalf Of </b>Varsha Agarwal<br>
<b>Sent:</b> Wednesday, March 23, 2016 12:47 AM<br>
<b>To:</b> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<b>Subject:</b> [Freeswitch-users] Need to set and get Global vairables from dialplan<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have created a variable in var.xml, current_node. I am trying to use it in dialplan as below, is this something I can do?
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">&lt;extension name=&quot;balance_load&quot;&gt;<u></u><u></u></p>
<p class="MsoNormal">      &lt;condition field=&quot;destination_number&quot; expression=&quot;^5050$&quot;&gt;<u></u><u></u></p>
<p class="MsoNormal">                &lt;action application=&quot;set&quot; data=&quot;continue_on_fail=true&quot;/&gt;<u></u><u></u></p>
<p class="MsoNormal">                &lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;/&gt;<u></u><u></u></p>
<p class="MsoNormal">                &lt;action application=&quot;log&quot; data=&quot;INFO *********LOG LEVEL******** [${current_node}]&quot;/&gt;<u></u><u></u></p>
<p class="MsoNormal">                &lt;condition field=&quot;current_node&quot; expression=&quot;^1$&quot;&gt;<u></u><u></u></p>
<p class="MsoNormal">                                &lt;action=&quot;set_global&quot; data=&quot;current_node=2&quot;/&gt;<u></u><u></u></p>
<p class="MsoNormal">                                &lt;action application=&quot;log&quot; data=&quot;INFO *********LOG LEVEL******** [${current_node}]&quot;/&gt;<u></u><u></u></p>
<p class="MsoNormal">                                &lt;action application=&quot;bridge&quot; data=&quot;loopback/5000&quot;/&gt;<u></u><u></u></p>
<p class="MsoNormal">                &lt;/condition&gt;<u></u><u></u></p>
<p class="MsoNormal">                &lt;condition field=&quot;current_node&quot; expression=&quot;^2$&quot;&gt;<u></u><u></u></p>
<p class="MsoNormal">                                &lt;action=&quot;set_global&quot; data=&quot;current_node=2&quot;/&gt;<u></u><u></u></p>
<p class="MsoNormal">                                &lt;action application=&quot;log&quot; data=&quot;INFO *********LOG LEVEL******** [${current_node}]&quot;/&gt;<u></u><u></u></p>
<p class="MsoNormal">                                &lt;action application=&quot;bridge&quot; data=&quot;<a href="mailto:sofia/external/5000@172.18.19.72" target="_blank">sofia/external/5000@172.18.19.72</a>&quot;/&gt;<u></u><u></u></p>
<p class="MsoNormal">                &lt;/condition&gt;<u></u><u></u></p>
<p class="MsoNormal">                &lt;action=&quot;set_global&quot; data=&quot;current_node=2&quot;/&gt;<u></u><u></u></p>
<p class="MsoNormal">                &lt;action application=&quot;log&quot; data=&quot;INFO *********LOG LEVEL AFTER******** [${current_node}]&quot;/&gt;<u></u><u></u></p>
<p class="MsoNormal">                &lt;action application=&quot;bridge&quot; data=&quot;loopback/5000&quot;/&gt;<u></u><u></u></p>
<p class="MsoNormal">                <u></u><u></u></p>
<p class="MsoNormal">      &lt;/condition&gt;<u></u><u></u></p>
<p class="MsoNormal">    &lt;/extension&gt;<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Currently log always print current_node = 1 which is the value set in vars.xml.
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Varsha<u></u><u></u></p>
</div></div></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" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">







<p><font face="courier new, monospace"><b><i><font size="4">Brian West</font></i></b><br><span style="font-size:x-small"><a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a></span></font></p>
<p><font size="1" face="courier new, monospace"><img src="http://billing.freeswitch.org/templates/default/img/whmcslogo.png"><br></font></p><p><font size="2" face="monospace, monospace"><b><i>Twitter: @FreeSWITCH , @briankwest</i></b><br><a href="http://www.freeswitchbook.com" target="_blank">http://www.freeswitchbook.com</a><br><a href="http://www.freeswitchcookbook.com" target="_blank">http://www.freeswitchcookbook.com</a><br></font><a href="https://www.gofundme.com/freeswitch_ubuntu" style="font-size:12.8px" target="_blank"><font face="monospace, monospace">https://www.gofundme.com/freeswitch_ubuntu</font></a></p><p><font face="monospace, monospace">Got Bugs? Report them <a href="https://freeswitch.org/jira" target="_blank">here</a>! | Reddit: <a href="https://www.reddit.com/r/freeswitch" target="_blank">/r/freeswitch</a></font></p>
<p><font size="2" face="monospace, monospace"><b>T:</b>+19184209001 | <b>F:</b>+19184209002 | <b>M:</b>+1918424WEST (9378)<br><b>iNUM:</b>+883 5100 1420 9001 | <b>ISN:</b>410*543 | <b>Skype:</b>briankwest</font></p></div></div></div></div></div></div></div></div></div></div></div></div>
</div>