<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Tekton Pro Cond";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoPlainText>HI Miha,<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>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.<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>I think when you said &quot;other time I get 003851810000 and I must convert it to +3861810000?&quot; You made a typo and it should have been : &quot;other time I get 003861810000 and I must convert it to +3861810000?&quot;&nbsp; If not the regex will need to be adjusted below.<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>I would suggest you set the &quot;context&quot; from the gateways to different intermediate dial plans.&nbsp; For example context=&quot;from_gateway1&quot; and context=&quot;from_gateway2&quot;.<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>Then create the dial plans for each of those contexts like this:<o:p></o:p></p><p class=MsoNormal> &lt;context name=&quot;from_gateway1&quot;&gt;<o:p></o:p></p><p class=MsoPlainText>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;extension name=&quot;reformat_cid&quot; &gt;<o:p></o:p></p><p class=MsoPlainText>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;condition field=&quot;destination_number&quot; expression=&quot;^0(\d\d\d\d\d\d\d)$&quot;&gt;<o:p></o:p></p><p class=MsoPlainText>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;transfer&quot; data=&quot;982$1 XML from-external&quot;/&gt;<o:p></o:p></p><p class=MsoPlainText>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;/condition&gt;<o:p></o:p></p><p class=MsoPlainText> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;/extension&gt;&nbsp;&nbsp; <o:p></o:p></p><p class=MsoPlainText>. . .<o:p></o:p></p><p class=MsoPlainText>&lt;/context&gt;<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>For gateway2:<o:p></o:p></p><p class=MsoPlainText>&lt;context name=&quot;from_gateway2&quot;&gt;<o:p></o:p></p><p class=MsoPlainText>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;extension name=&quot;reformat_cid&quot; &gt;<o:p></o:p></p><p class=MsoPlainText>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;condition field=&quot;destination_number&quot; expression=&quot;^00 (38\d\d \d\d\d\d\d\d)$&quot;&gt;<o:p></o:p></p><p class=MsoPlainText>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;transfer&quot; data=&quot;+$1 XML from-external&quot;/&gt;<o:p></o:p></p><p class=MsoPlainText>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;/condition&gt;<o:p></o:p></p><p class=MsoPlainText> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;/extension&gt;&nbsp;&nbsp; <o:p></o:p></p><p class=MsoPlainText>. . .<o:p></o:p></p><p class=MsoPlainText>&lt;/context&gt;<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>Then in your main trunk dialplan (here called &quot;from-external&quot;) all the numbers will be in the format +38n and 7 more digits.<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>Of course you can set more exacting regex expressions.&nbsp; And you should probably have a catch-all in the bottom of the &quot;from_gatewayN&quot; contexts to handle any CIDs that did not match our expressions.<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>Hope that helps.<o:p></o:p></p><p class=MsoPlainText>Sean<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>I Hope that helped.<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>-----Original Message-----<br>From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Miha<br>Sent: Thursday, January 24, 2013 9:09 AM<br>To: FreeSWITCH Users Help<br>Subject: [Freeswitch-users] Lcr in easy_route, CID manipulation</p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>Hi,<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>I need to manipulate with CID for specific GW. IS it possible to set this in sip_profiles (it would be prefect:) )?<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>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?<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>What would be the best way for easy_route?<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>Otherwise I will use culr, depend in source ip I will manipulte with cid number.<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>Thanks!<o:p></o:p></p><p class=MsoPlainText>Miha<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>_________________________________________________________________________<o:p></o:p></p><p class=MsoPlainText>Professional FreeSWITCH Consulting Services:<o:p></o:p></p><p class=MsoPlainText><a href="mailto:consulting@freeswitch.org"><span style='color:windowtext;text-decoration:none'>consulting@freeswitch.org</span></a><o:p></o:p></p><p class=MsoPlainText><a href="http://www.freeswitchsolutions.com"><span style='color:windowtext;text-decoration:none'>http://www.freeswitchsolutions.com</span></a><o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>FreeSWITCH-powered IP PBX: The CudaTel Communication Server <a href="http://www.cudatel.com"><span style='color:windowtext;text-decoration:none'>http://www.cudatel.com</span></a><o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>Official FreeSWITCH Sites<o:p></o:p></p><p class=MsoPlainText><a href="http://www.freeswitch.org"><span style='color:windowtext;text-decoration:none'>http://www.freeswitch.org</span></a><o:p></o:p></p><p class=MsoPlainText><a href="http://wiki.freeswitch.org"><span style='color:windowtext;text-decoration:none'>http://wiki.freeswitch.org</span></a><o:p></o:p></p><p class=MsoPlainText><a href="http://www.cluecon.com"><span style='color:windowtext;text-decoration:none'>http://www.cluecon.com</span></a><o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>FreeSWITCH-users mailing list<o:p></o:p></p><p class=MsoPlainText><a href="mailto:FreeSWITCH-users@lists.freeswitch.org"><span style='color:windowtext;text-decoration:none'>FreeSWITCH-users@lists.freeswitch.org</span></a><o:p></o:p></p><p class=MsoPlainText><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"><span style='color:windowtext;text-decoration:none'>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</span></a><o:p></o:p></p><p class=MsoPlainText>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<o:p></o:p></p><p class=MsoPlainText><a href="http://www.freeswitch.org"><span style='color:windowtext;text-decoration:none'>http://www.freeswitch.org</span></a><o:p></o:p></p></div></body></html>