[Freeswitch-users] Lcr in easy_route, CID manipulation

Sean Devoy sdevoy at bizfocused.com
Thu Jan 24 18:36:59 MSK 2013


HI Miha,

 

If I understand correctly you get the CID from 2 different gateways in
different formats and would like to handle them in a combined dialplan with
uniform formats.

 

I think when you said "other time I get 003851810000 and I must convert it
to +3861810000?" You made a typo and it should have been : "other time I get
003861810000 and I must convert it to +3861810000?"  If not the regex will
need to be adjusted below.

 

I would suggest you set the "context" from the gateways to different
intermediate dial plans.  For example context="from_gateway1" and
context="from_gateway2".

 

Then create the dial plans for each of those contexts like this:

<context name="from_gateway1">

                <extension name="reformat_cid" >

                                 <condition field="destination_number"
expression="^0(\d\d\d\d\d\d\d)$">

                                                <action
application="transfer" data="982$1 XML from-external"/>

                                   </condition>

                </extension>   

. . .

</context>

 

 

For gateway2:

<context name="from_gateway2">

                <extension name="reformat_cid" >

                                 <condition field="destination_number"
expression="^00 (38\d\d \d\d\d\d\d\d)$">

                                                <action
application="transfer" data="+$1 XML from-external"/>

                                   </condition>

                </extension>   

. . .

</context>

 

Then in your main trunk dialplan (here called "from-external") all the
numbers will be in the format +38n and 7 more digits.

 

Of course you can set more exacting regex expressions.  And you should
probably have a catch-all in the bottom of the "from_gatewayN" contexts to
handle any CIDs that did not match our expressions.

 

Hope that helps.

Sean

 

I Hope that helped.

 

-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Miha
Sent: Thursday, January 24, 2013 9:09 AM
To: FreeSWITCH Users Help
Subject: [Freeswitch-users] Lcr in easy_route, CID manipulation

 

Hi,

 

I need to manipulate with CID for specific GW. IS it possible to set this in
sip_profiles (it would be prefect:) )?

 

In lcr I did use colume CID which worked ok, but is it possible to
manipulate with to different kind of CID or use to regex? For example once
cid is 01810000 in i must revert it to +3821810000, other time I get
003851810000 and I must convert it to +3861810000?

 

What would be the best way for easy_route?

 

Otherwise I will use culr, depend in source ip I will manipulte with cid
number.

 

Thanks!

Miha

 

 

 

_________________________________________________________________________

Professional FreeSWITCH Consulting Services:

 <mailto:consulting at freeswitch.org> consulting at freeswitch.org

 <http://www.freeswitchsolutions.com> http://www.freeswitchsolutions.com

 


<> 

 

Official FreeSWITCH Sites

 <http://www.freeswitch.org> http://www.freeswitch.org

 <http://wiki.freeswitch.org> http://wiki.freeswitch.org

 <http://www.cluecon.com> http://www.cluecon.com

 

FreeSWITCH-users mailing list

 <mailto:FreeSWITCH-users at lists.freeswitch.org>
FreeSWITCH-users at lists.freeswitch.org

 <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users

UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users

 <http://www.freeswitch.org> http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130124/0dd0d159/attachment.html 


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