[Freeswitch-users] Multiple Conditions

Avi Marcus avi at avimarcus.net
Wed Sep 9 09:01:47 MSD 2015


A simple way is simply make two extensions...: (but not DRY):
To make it more dry, you can set the dial string in vars.xml and then
include it.

<extension name="list1">
<condition field="destination_number"
expression="^(\+?1)?(8(00|44|55|66|77|88)[2-9]\d{6})$"/>
<condition field="${acl(${network_addr} list1)}" expression="true">
   <action application="ACTIONS" data=""/>
</condition>
</extension>

<extension name="list2">
<condition field="destination_number"
expression="^(\+?1)?(8(00|44|55|66|77|88)[2-9]\d{6})$"/>
<condition field="${acl(${network_addr} list2)}" expression="true">
   <action application="ACTIONS" data=""/>
</condition>
</extension>

-Avi Marcus
BestFone

On Tue, Sep 8, 2015 at 9:26 PM, Tim King <tim at triton.net> wrote:

> I need to route calls to different destinations based on network ACL. I
> still need the calls to match a certain dial pattern
>
> how can I accomplish this?
>
> *All calls will match this first condition*
> <condition field="destination_number"
> expression="^(\+?1)?(8(00|44|55|66|77|88)[2-9]\d{6})$">
>
> *If this*
> <condition field="${acl(${network_addr} list1)}" expression="true"/>
> *execute these actions*
> *if this*
> <condition field="${acl(${network_addr} list2)}" expression="true"/>
> *execute these actions*
>
> _________________________________________________________________________
> 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/20150909/f89bc4d2/attachment.html 


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