[Freeswitch-users] Need some help with dial string matching?

Frank Church vfclists at gmail.com
Fri Apr 13 14:01:11 MSD 2012


I set up a basic installation of freeswitch, but because I want to learn
more I haven't removed the existing extensions, but I created a context to
send all numbers beginnng with 0 through an external provider.

<include>
>     <!--   $CONFIGDIR/dialplan/provider.xml
>
> -->
> <context name="provider">
>    <extension name="outbound">
>      <condition field="destination_number" expression="^0?(\d+)$">
>        <action application="bridge" data="sofia/gateway/provider/0$1"/>
>      </condition>
>    </extension>
>  </context>
> </include>
>

I noticed that numbers without a leading zero are matched and dialled.
Anyway I think I realize that the expression should start wih '^0+' instead
of ^0?'. How then do I dial the whole string instead of using 0$1? Because
that is what is adding the leading 0 to the numbers without it.

I also want to ensure that a minimal number of digits are dialled before
the call is allowed. Do I need to add them literally like ^0+dddddd or is
there a shortcut for specifying a minimal number of digits?

-- 
Frank Church

=======================
http://devblog.brahmancreations.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120413/a8f7d27a/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list