Look into &quot;continue=true&quot;, i think that you need to add it.<br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 29, 2016 at 3:07 PM Vladyslav Zakhozhai &lt;<a href="mailto:v.zakhozhai@gmail.com">v.zakhozhai@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">David, thank you for your answer.<div><br></div><div>I&#39;ve mentioned that I have no problems with extension is_local_call. It will be matched only if SIP message has custom header X-Exten-Type=internal.</div><div><br></div><div>If SIP message has no this header and To user is 0930000000 it does not match ua_mobile, but ua_local for some reason.</div><div><br></div><div>When I&#39;d remove is_local_call all numeric destinations are matched against ua_local.</div><div><br></div><div>Here is part of FS log:<br><br><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> parsing [internal-&gt;echo_test] continue=false</div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> Regex (FAIL) [echo_test] destination_number(0930000000) =~ /^(echo|9999)$/ break=on-false</div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> parsing [internal-&gt;is_internal_call] continue=false</div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> Regex (PASS) [is_internal_call] destination_number(0930000000) =~ /.*/ break=on-false</div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> Regex (FAIL) [is_internal_call] ${sip_h_X-Exten-Type}() =~ /internal/ break=on-false</div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> parsing [internal-&gt;ua_local] continue=false</div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> Regex (PASS) [ua_local] destination_number(0930000000) =~ // break=on-false</div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> Action log(sip_h_X-Exten-Type: ${sip_h_X-Exten-Type}.) </div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> Action bridge(sofia/gateway/golden/${destination_number}) </div></div><div><br></div><div>I&#39;ve removed extension is_local_call and have:</div><div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> parsing [internal-&gt;echo_test] continue=false</div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> Regex (FAIL) [echo_test] destination_number(0930000000) =~ /^(echo|9999)$/ break=on-false</div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> parsing [internal-&gt;ua_local] continue=false</div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> Regex (PASS) [ua_local] destination_number(0930000000) =~ // break=on-false</div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> Action log(sip_h_X-Exten-Type: ${sip_h_X-Exten-Type}.) </div><div>Dialplan: sofia/internal/<a href="mailto:vlakas@unitrans.tull.pp.ua" target="_blank">vlakas@unitrans.tull.pp.ua</a> Action bridge(sofia/gateway/golden/${destination_number}) </div></div><div><br></div><div>I can&#39;t understand why expression in log for ua_local is empty</div><div><br></div><div>Regex (PASS) [ua_local] destination_number(0930000000) =~ // break=on-false<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 29, 2016 at 3:03 PM David Villasmil &lt;<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">you&#39;re hitting internal before  09<div><br></div><div></div></div><div dir="ltr"><div><div style="font-size:12.8px"> &lt;extension name=&quot;is_internal_call&quot;&gt;</div><div style="font-size:12.8px">        &lt;condition field=&quot;destination_number&quot; expression=&quot;.*&quot;/&gt;</div><div style="font-size:12.8px">        &lt;condition field=&quot;${sip_h_X-Exten-Type}&quot; expression=&quot;internal&quot;&gt;</div><div style="font-size:12.8px">              Some action</div><div style="font-size:12.8px">         &lt;/condition&gt;</div><div style="font-size:12.8px">    &lt;/extension&gt;</div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div></div></div><div dir="ltr"><div><div style="font-size:12.8px"><span style="font-size:12.8px">    &lt;extension name=&quot;ua_mobile&quot;&gt;</span><br></div><div style="font-size:12.8px"></div></div></div><div dir="ltr"><div><div style="font-size:12.8px"><div>        &lt;condition field=&quot;destination_number&quot; experession=&quot;^0[0-9]{9}$&quot;&gt;</div><div>            &lt;action application=&quot;bridge&quot; data=&quot;sofia/gateway/golden/${destination_number}&quot;/&gt;</div><div>        &lt;/condition&gt;</div><div>    &lt;/extension&gt;</div><div><br></div></div></div></div><div dir="ltr"><div><div style="font-size:12.8px"><div>try removing &quot;<span style="font-size:12.8px">        &lt;condition field=&quot;destination_number&quot; expression=&quot;.*&quot;/&gt;</span><span style="font-size:12.8px">&quot;</span></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">On Thu, Sep 29, 2016 at 10:41 AM, Vladyslav Zakhozhai <span dir="ltr">&lt;<a href="mailto:v.zakhozhai@gmail.com" target="_blank">v.zakhozhai@gmail.com</a>&gt;</span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I&#39;ve mentioned that pattern matching in my dialplan works incorrectly but I can&#39;t figure out the main reason.</div><div><br></div><div>For example I have the following dialplan:</div><div>&lt;context name=&quot;internal&quot;&gt;<br></div><div>    &lt;extension name=&quot;echo_test&quot;&gt;</div><div>        &lt;condition field=&quot;destination_number&quot; expression=&quot;^(echo|9999)$&quot;&gt;</div><div>             Some action</div><div>        &lt;/condition&gt;</div><div>    &lt;/extension&gt;</div><div>    &lt;extension name=&quot;is_internal_call&quot;&gt;</div><div>        &lt;condition field=&quot;destination_number&quot; expression=&quot;.*&quot;/&gt;</div><div>        &lt;condition field=&quot;${sip_h_X-Exten-Type}&quot; expression=&quot;internal&quot;&gt;</div><div>              Some action</div><div>         &lt;/condition&gt;</div><div>    &lt;/extension&gt;</div><div>    &lt;extension name=&quot;ua_local&quot;&gt;</div><div>        &lt;condition field=&quot;destination_number&quot; experession=&quot;^[2-5][0-9]{6}$&quot;&gt;</div><div>            Some action</div><div>         &lt;/condition</div><div>    &lt;/extension&gt;</div><div><div>    &lt;extension name=&quot;ua_mobile&quot;&gt;</div><div>        &lt;condition field=&quot;destination_number&quot; experession=&quot;^0[0-9]{9}$&quot;&gt;</div><div>            &lt;action application=&quot;bridge&quot; data=&quot;sofia/gateway/golden/${destination_number}&quot;/&gt;</div><div>        &lt;/condition&gt;</div><div>    &lt;/extension&gt;</div></div><div>&lt;/context&gt;<br></div><div><br></div><div>1. Call to &quot;echo&quot; - OK (echo_test)</div><div>2. Call to some extension with custom header X-Exten-Type - OK (is_internal_call)</div><div>3. Call to 5930000 - OK (ua_local)</div><div>4. Call to 0930000000 - FAILED to match ua_mobile extension. </div><div><br></div><div>The last call matches ua_local. But why?</div><div><br></div><div>The result of regex dp_tool</div><div><div>freeswitch@vlakas&gt; regex 5930000|^[2-5][0-9]{6}$</div><div>true</div><div>freeswitch@vlakas&gt; regex 0930000000|^[2-5][0-9]{6}$</div><div>false</div></div><div><br></div><div>So, everything is correct. I can&#39;t understand why almost everyting goes to ua_local extension.</div><div><br></div><div>I appreciate you help.</div><span><font color="#888888"><div><br></div><div><br></div></font></span></div><span><font color="#888888"><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">Best regards,<div>Vladyslav Zakhozhai</div><div>email: <a href="mailto:v.zakhozhai@gmail.com" target="_blank">v.zakhozhai@gmail.com</a></div><div>tel.: <a href="tel:%2B380%2893%29%20757-21-61" value="+380937572161" target="_blank">+380(93) 757-21-61</a></div></div></div>
</font></span><br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_________________________________________________________________________<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>
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></blockquote></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">Best regards,<div>Vladyslav Zakhozhai</div><div>email: <a href="mailto:v.zakhozhai@gmail.com" target="_blank">v.zakhozhai@gmail.com</a></div><div>tel.: +380(93) 757-21-61</div></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></blockquote></div>