[Freeswitch-users] gateway selection by prefix

Alexis ap at gen-ip.fr
Tue Jun 19 17:09:54 UTC 2018


Hi,

You can do that with this dialplan :

<extension name='MessageNet'>
     <condition field='${destination_number}' expression='^9(\d+)'>
         <action application='bridge' data='sofia/gateway/your MessageNet gateway name/$1'/>
     </condition>
</extension>

<extension name='Skype'>
     <condition field='${destination_number}' expression='^7(\d+)'>
         <action application='bridge' data='sofia/gateway/your Skype gateway name/$1'/>
     </condition>
</extension>

<extension name='TelecomItalia'>
     <condition>
         <action application='bridge' data='sofia/gateway/your TelecomItalia gateway name/${destination_number}'/>
     </condition>
</extension>

You can find more informations here : 
https://freeswitch.org/confluence/display/FREESWITCH/Regular+Expression#RegularExpression-ClusteringvsCapturing

And this page give you exactly what you want : 
https://freeswitch.org/confluence/display/FREESWITCH/XML+Dialplan#XMLDialplan-Conditions 
("Example 1: Capturing Digits")

Alexis

Le 19/06/2018 à 13:07, Francesco Facco de Lagarda a écrit :
>
> I have 3 gateways:
> Telecom Italia on an analogue adapter
>
> MessageNet (sip provider)
> Skype
>
> How can I select gateway by a prefix THAT THEN GETS DROPPED before 
> Dialing..
>
> Example I would like to have
>
> All calls beginning with 9 Sent to MessageNet , DROPPING THE “9”
>
> All calls beginning with 7 sent to Skype, dropping the “7”
>
> Otherwise use telecom
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20180619/6fc98bdd/attachment.html>


More information about the FreeSWITCH-users mailing list