<div dir="ltr"><div><div>Hi, Bilal<br></div><br>Actually freeswitch does dialplan execution in 2 stages. During first stage in a context it evaluates all conditions and in second stage it execute actions according to conditions evaluated during first step. So, in you case first conditions set(True) and second conditions set(Fail because action in first condition is yet to performed) are check simultaneously during first phase. <br><br><br></div><div>So, if you are querying some database. You need to do this in following ways. <br><br> <br> &lt;context name=&quot;default&quot;&gt;<br>   &lt;extension name=&quot;ASDF&quot; continue=&quot;true&quot;&gt;<div>           &lt;condition&gt;</div><div>                 &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=2&quot;/&gt;</div><div>                 &lt;action application=&quot;log&quot; data=&quot;CRIT This is Caller_ID_NUM ${effective_caller_id_number}&quot;/&gt;<br>                 &lt;action application=&quot;transfer&quot; data=&quot; ${effective_caller_id_number} XML  block&quot; /&gt;<br><div>   &lt;/condition&gt;<br></div><div>&lt;/extension&gt;<br></div><div>&lt;/context&gt;<br> <br>&lt;context name=&quot;block&quot;&gt;<br> &lt;extension name=&quot;testing&quot; continue=&quot;true&quot;&gt;<br>             &lt;condition field=&quot;${effective_caller_id_number}&quot; expression=&quot;2&quot;&gt;<div>                 &lt;action application=&quot;log&quot; data=&quot;CRIT This is Caller_ID_NUM ${effective_caller_id_number}&quot;/&gt;</div><div>                 &lt;action application=&quot;hangup&quot;/&gt;</div><div>                 &lt;anti-action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;/&gt;</div><div>                 &lt;anti-action application=&quot;set&quot; data=&quot;continue_on_fail=true&quot;/&gt;</div><div>                 &lt;anti-action application=&quot;set&quot; data=&quot;bypass_media=true&quot;/&gt;</div><div>                 &lt;anti-action application=&quot;log&quot; data=&quot;CRIT Caller_ID_NUM ${effective_caller_id_number}&quot;/&gt;</div><div>                 &lt;anti-action application=&quot;bridge&quot; data=&quot;sofia/external/$<a href="mailto:1@10.100.0.60" target="_blank">1@10.100.0.60</a>&quot;/&gt;</div><div>              &lt;/condition&gt;</div><div> &lt;/extension&gt;</div>&lt;/context&gt;<br><br></div><div>Hope this helps. Feel free to contact me if you face any problem :)<br><br><a href="https://wiki.freeswitch.org/wiki/Mod_blacklist">https://wiki.freeswitch.org/wiki/Mod_blacklist</a><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 21 September 2015 at 17:59, Bilal Abbasi <span dir="ltr">&lt;<a href="mailto:bilaln018@gmail.com" target="_blank">bilaln018@gmail.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 dir="ltr">Thanks Ayre,<div>Actually i am making a system to block few caller_id_numbers(its long story, even its not like what i said..:-P), i will pick that number form the database(to make that simple i have assigned 2), now as you said making variable inline, yes its working on the condition level, and every thing works GREAT, but when i print the logs it shows the old value of caller id(it seems its not set value executing the log,</div><div>I am not picking up the way FS behaves.</div><div><br></div><div>Regards</div><span class="HOEnZb"><font color="#888888"><div>Bilal Abbasi</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 21, 2015 at 5:22 PM, Steven Ayre <span dir="ltr">&lt;<a href="mailto:steveayre@gmail.com" target="_blank">steveayre@gmail.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 dir="ltr">Ok, so that part should pass then.<div><br></div><div>Out of curiousity why do you want to set <span style="font-size:12.8px">effective_caller_id_</span><span style="font-size:12.8px">number and then test if it&#39;s the value you just set - with inline that should always be true, so it doesn&#39;t give any advantage over just a single condition on destination_number.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Without inline=&quot;true&quot; when setting </span><span style="font-size:12.8px">effective_caller_id_number=2 it&#39;ll never work, unless </span><span style="font-size:12.8px">effective_caller_id_number was already 2. FreeSWITCH evaluates the conditions (hunting stage) to generate a list of actions to execute, then executes that list (execution stage), meaning the 3rd condition is evaluated before the &quot;set&quot; is executed despite the order they appear in the dialplan, unless you use inline=true which executes the set during the hunting stage as soon as it&#39;s found. Using that should work for you.</span></div><div><div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div class="gmail_extra"><div class="gmail_quote">On 21 September 2015 at 13:04, Bilal Abbasi <span dir="ltr">&lt;<a href="mailto:bilaln018@gmail.com" target="_blank">bilaln018@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Destination number is 03131234567 and yes i know that this is not match exactly, and its not showing the condition result rather it shows the anti-action(result of condition false).<div><br></div><div>Regards</div><div><br></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 21, 2015 at 4:32 PM, Steven Ayre <span dir="ltr">&lt;<a href="mailto:steveayre@gmail.com" target="_blank">steveayre@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">What&#39;s the <span style="font-size:12.8px">destination_number?</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Also you probably want to test for ^2$ not 2 (exact match of &quot;2&quot; rather than contains &quot;2&quot;)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">If you look at FreeSWITCH&#39;s debug logging you&#39;ll see messages of when it evaluates conditions - what it&#39;s testing, what it&#39;s testing for and the PASS/FAIL result.</span></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 21 September 2015 at 11:41, Bilal Abbasi <span dir="ltr">&lt;<a href="mailto:bilaln018@gmail.com" target="_blank">bilaln018@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Thanks for the comment, but this does not solved the issue..:-(<div>Regards</div><div><br></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 21, 2015 at 3:06 PM, Sergey Safarov <span dir="ltr">&lt;<a href="mailto:s.safarov@gmail.com" target="_blank">s.safarov@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><span style="font-size:12.8px">Try</span></div><span style="font-size:12.8px">&lt;action application=&quot;set&quot; data=&quot;effective_caller_id_</span><span style="font-size:12.8px">number=2&quot; <font color="#ff0000">inline=&quot;true</font>&quot;/&gt;</span><br><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Sep 21, 2015 at 12:49 PM, Bilal Abbasi <span dir="ltr">&lt;<a href="mailto:bilaln018@gmail.com" target="_blank">bilaln018@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div dir="ltr"><div>Hi All,</div><div>I have the following as my dial plan,</div><div> </div><div>    &lt;extension name=&quot;ASDF&quot; continue=&quot;true&quot;&gt;</div><div>           &lt;condition&gt;</div><div>                 &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=2&quot;/&gt;</div><div>                 &lt;action application=&quot;log&quot; data=&quot;CRIT This is Caller_ID_NUM ${effective_caller_id_number}&quot;/&gt;</div><div>           &lt;/condition&gt;</div><div><br></div><div>           &lt;condition field=&quot;destination_number&quot; expression=&quot;(^\d{11}$|^\d{10}$)&quot;/&gt;</div><div>              &lt;condition field=&quot;${effective_caller_id_number}&quot; expression=&quot;2&quot;&gt;</div><div>                 &lt;action application=&quot;log&quot; data=&quot;CRIT This is Caller_ID_NUM ${effective_caller_id_number}&quot;/&gt;</div><div>                 &lt;action application=&quot;hangup&quot;/&gt;</div><div>                 &lt;anti-action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;/&gt;</div><div>                 &lt;anti-action application=&quot;set&quot; data=&quot;continue_on_fail=true&quot;/&gt;</div><div>                 &lt;anti-action application=&quot;set&quot; data=&quot;bypass_media=true&quot;/&gt;</div><div>                 &lt;anti-action application=&quot;log&quot; data=&quot;CRIT Caller_ID_NUM ${effective_caller_id_number}&quot;/&gt;</div><div>                 &lt;anti-action application=&quot;bridge&quot; data=&quot;sofia/external/$<a href="mailto:1@10.100.0.60" target="_blank">1@10.100.0.60</a>&quot;/&gt;</div><div>              &lt;/condition&gt;</div><div>    &lt;/extension&gt;</div><div><br></div><div>I have changed the effective called id to 2, now what I expect is that action should be executed, but dial plan goes to the anti-action</div><div>Don&#39;t know what I am missing out.</div><div><br></div><div>Help is appropriated,</div><div><br></div><div>Regards</div><span><font color="#888888"><div>Bilal Abbasi</div></font></span></div>
<br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></div>
</div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></div>
</div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></div>
</div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></div></div></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></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></div>