[Freeswitch-users] ACL Routing with multiple conditions.

Tim King tim at triton.net
Fri Sep 4 23:06:58 MSD 2015


I'm certain I am not the first one to try this, but I have been digging 
through forums and googling for 2 days now without success. I am trying 
to route toll free traffic based on the source ip's. I am using ACL's to 
match on the source IP. If i only use one of them it works, btu when I 
try to add the second no calls ever make it to the second condition.

Here are the ways I have tried
                <extension name="tollfree_to_trunk1">
                 <condition field="${acl(${network_addr} trunk1)}" 
expression="true"/>
                         <condition field="destination_number" 
expression="^(\+?1)?(8(00|44|55|66|77|88)[2-9]\d{6})$">
                                 <action application="set" 
data="hangup_after_bridge=true"/>
                                 <action application="set" 
data="proxy_media=true"/>
                                 <action application="bridge" 
data="sofia/external/$2 at 1.1.1.1:5060"/>
                 </condition>
                 </extension>

                 <extension name="tollfree_to_trunk2">
                         <condition field="${acl(${network_addr} 
trunk2)}" expression="true"/>
                         <condition field="destination_number" 
expression="^(\+?1)?(8(00|44|55|66|77|88)[2-9]\d{6})$">
                                 <action application="set" 
data="hangup_after_bridge=true"/>
                                 <action application="set" 
data="proxy_media=true"/>
                                 <action application="bridge" 
data="sofia/external/$2 at 2.2.2.2:5060"/>
                  </condition>
                 </extension>

The second is using the regex function.
                 <extension name="tollfree_to_trunks">
                 <condition regex="all">
                 <regex field="destination_number" 
expression="^(\+?1)?(8(00|44|55|66|77|88)[2-9]\d{6})$">
                         <regex field="${acl(${network_addr} trunk1)}" 
expression="true"/>
                                 <action application="set" 
data="hangup_after_bridge=true"/>
                                 <action application="set" 
data="proxy_media=true"/>
                                 <action application="set" 
data="sourceip=${network_addr}"/>
                                 <action application="bridge" 
data="sofia/external/$2 at 1.1.1.1:5060"/>
                         <regex field="${acl(${network_addr} trunk2)}" 
expression="true"/>
                                 <action application="set" 
data="hangup_after_bridge=true"/>
                                 <action application="set" 
data="proxy_media=true"/>
                                 <action application="set" 
data="sourceip=${network_addr}"/>
                                 <action application="bridge" 
data="sofia/external/$2 at 2.2.2.2:5060"/>
                  </condition>
                 </extension>

Again in summary I am just trying to send toll free traffic to different 
gateways based on an acl match of the ip the call originates from. any 
help would be greatly appreciated.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tim.vcf
Type: text/x-vcard
Size: 287 bytes
Desc: not available
Url : http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150904/08106df7/attachment-0001.vcf 


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