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@lists.freeswitch.org [mailto:freeswitch-users-bounces@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:
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users