[Freeswitch-users] Dialplan expression matching

David Villasmil david.villasmil.work at gmail.com
Thu Sep 29 16:02:48 MSD 2016


you're hitting internal before  09

 <extension name="is_internal_call">
        <condition field="destination_number" expression=".*"/>
        <condition field="${sip_h_X-Exten-Type}" expression="internal">
              Some action
         </condition>
    </extension>

    <extension name="ua_mobile">
        <condition field="destination_number" experession="^0[0-9]{9}$">
            <action application="bridge" data="sofia/gateway/golden/${
destination_number}"/>
        </condition>
    </extension>

try removing "        <condition field="destination_number"
expression=".*"/>"

On Thu, Sep 29, 2016 at 10:41 AM, Vladyslav Zakhozhai <v.zakhozhai at gmail.com
> wrote:

> Hi,
>
> I've mentioned that pattern matching in my dialplan works incorrectly but
> I can't figure out the main reason.
>
> For example I have the following dialplan:
> <context name="internal">
>     <extension name="echo_test">
>         <condition field="destination_number" expression="^(echo|9999)$">
>              Some action
>         </condition>
>     </extension>
>     <extension name="is_internal_call">
>         <condition field="destination_number" expression=".*"/>
>         <condition field="${sip_h_X-Exten-Type}" expression="internal">
>               Some action
>          </condition>
>     </extension>
>     <extension name="ua_local">
>         <condition field="destination_number"
> experession="^[2-5][0-9]{6}$">
>             Some action
>          </condition
>     </extension>
>     <extension name="ua_mobile">
>         <condition field="destination_number" experession="^0[0-9]{9}$">
>             <action application="bridge" data="sofia/gateway/golden/${
> destination_number}"/>
>         </condition>
>     </extension>
> </context>
>
> 1. Call to "echo" - OK (echo_test)
> 2. Call to some extension with custom header X-Exten-Type - OK
> (is_internal_call)
> 3. Call to 5930000 - OK (ua_local)
> 4. Call to 0930000000 - FAILED to match ua_mobile extension.
>
> The last call matches ua_local. But why?
>
> The result of regex dp_tool
> freeswitch at vlakas> regex 5930000|^[2-5][0-9]{6}$
> true
> freeswitch at vlakas> regex 0930000000|^[2-5][0-9]{6}$
> false
>
> So, everything is correct. I can't understand why almost everyting goes to
> ua_local extension.
>
> I appreciate you help.
>
>
> --
> Best regards,
> Vladyslav Zakhozhai
> email: v.zakhozhai at gmail.com
> tel.: +380(93) 757-21-61
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160929/1af12b90/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list