<div dir="ltr">@Aqs Thanks Heaps for this Great and simple explanation, i have gone through the official documentation and found the "hunting " and "execution" phases, i got your point.<div><div><br></div><div>Regards</div><div>Bilal Abbasi</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 22, 2015 at 1:33 AM, Aqs Younas <span dir="ltr"><<a href="mailto:aqsyounas@gmail.com" target="_blank">aqsyounas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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> <context name="default"><span class=""><br> <extension name="ASDF" continue="true"><div> <condition></div><div> <action application="set" data="effective_caller_id_number=2"/></div></span><div><span class=""> <action application="log" data="CRIT This is Caller_ID_NUM ${effective_caller_id_number}"/><br></span> <action application="transfer" data=" ${effective_caller_id_number} XML block" /><br><div> </condition><br></div><div></extension><br></div><div></context><br> <br><context name="block"><br> <extension name="testing" continue="true"><span class=""><br> <condition field="${effective_caller_id_number}" expression="2"><div> <action application="log" data="CRIT This is Caller_ID_NUM ${effective_caller_id_number}"/></div><div> <action application="hangup"/></div><div> <anti-action application="set" data="hangup_after_bridge=true"/></div><div> <anti-action application="set" data="continue_on_fail=true"/></div><div> <anti-action application="set" data="bypass_media=true"/></div><div> <anti-action application="log" data="CRIT Caller_ID_NUM ${effective_caller_id_number}"/></div><div> <anti-action application="bridge" data="sofia/external/$<a href="mailto:1@10.100.0.60" target="_blank">1@10.100.0.60</a>"/></div><div> </condition></div><div> </extension></div></span></context><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" target="_blank">https://wiki.freeswitch.org/wiki/Mod_blacklist</a><br></div></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 21 September 2015 at 17:59, Bilal Abbasi <span dir="ltr"><<a href="mailto:bilaln018@gmail.com" target="_blank">bilaln018@gmail.com</a>></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><font color="#888888"><div>Bilal Abbasi</div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 21, 2015 at 5:22 PM, Steven Ayre <span dir="ltr"><<a href="mailto:steveayre@gmail.com" target="_blank">steveayre@gmail.com</a>></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's the value you just set - with inline that should always be true, so it doesn'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="true" when setting </span><span style="font-size:12.8px">effective_caller_id_number=2 it'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 "set" 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'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"><<a href="mailto:bilaln018@gmail.com" target="_blank">bilaln018@gmail.com</a>></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"><<a href="mailto:steveayre@gmail.com" target="_blank">steveayre@gmail.com</a>></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'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 "2" rather than contains "2")</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">If you look at FreeSWITCH's debug logging you'll see messages of when it evaluates conditions - what it's testing, what it'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"><<a href="mailto:bilaln018@gmail.com" target="_blank">bilaln018@gmail.com</a>></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"><<a href="mailto:s.safarov@gmail.com" target="_blank">s.safarov@gmail.com</a>></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"><action application="set" data="effective_caller_id_</span><span style="font-size:12.8px">number=2" <font color="#ff0000">inline="true</font>"/></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"><<a href="mailto:bilaln018@gmail.com" target="_blank">bilaln018@gmail.com</a>></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> <extension name="ASDF" continue="true"></div><div> <condition></div><div> <action application="set" data="effective_caller_id_number=2"/></div><div> <action application="log" data="CRIT This is Caller_ID_NUM ${effective_caller_id_number}"/></div><div> </condition></div><div><br></div><div> <condition field="destination_number" expression="(^\d{11}$|^\d{10}$)"/></div><div> <condition field="${effective_caller_id_number}" expression="2"></div><div> <action application="log" data="CRIT This is Caller_ID_NUM ${effective_caller_id_number}"/></div><div> <action application="hangup"/></div><div> <anti-action application="set" data="hangup_after_bridge=true"/></div><div> <anti-action application="set" data="continue_on_fail=true"/></div><div> <anti-action application="set" data="bypass_media=true"/></div><div> <anti-action application="log" data="CRIT Caller_ID_NUM ${effective_caller_id_number}"/></div><div> <anti-action application="bridge" data="sofia/external/$<a href="mailto:1@10.100.0.60" target="_blank">1@10.100.0.60</a>"/></div><div> </condition></div><div> </extension></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'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" 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>