<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Sean,<br>
<br>
thank you for your replay.<br>
<br>
I need to manipulate with two different cid on one GW but I should
made it so scapable that if I would add another GW and I will be
getting on this GW different CID than on first one, that I could
use different regex:)<br>
<br>
I as have written my dialplan with xml_curl I would do it there,
with php this should be easy:)<br>
<br>
Thanks for you info!<br>
<br>
Miha<br>
<br>
Dne 1/24/2013 4:36 PM, piše Sean Devoy:<br>
</div>
<blockquote
cite="mid:324b01cdfa48$a672c0a0$f35841e0$@bizfocused.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<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]-->
<div class="WordSection1">
<p class="MsoPlainText">HI Miha,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </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> </o:p></p>
<p class="MsoPlainText">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.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I would suggest you set the "context"
from the gateways to different intermediate dial plans. For
example context="from_gateway1" and context="from_gateway2".<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </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"> <context name="from_gateway1"><o:p></o:p></p>
<p class="MsoPlainText"> <extension
name="reformat_cid" ><o:p></o:p></p>
<p class="MsoPlainText">
<condition field="destination_number"
expression="^0(\d\d\d\d\d\d\d)$"><o:p></o:p></p>
<p class="MsoPlainText">
<action
application="transfer" data="982$1 XML from-external"/><o:p></o:p></p>
<p class="MsoPlainText">
</condition><o:p></o:p></p>
<p class="MsoPlainText"> </extension> <o:p></o:p></p>
<p class="MsoPlainText">. . .<o:p></o:p></p>
<p class="MsoPlainText"></context><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">For gateway2:<o:p></o:p></p>
<p class="MsoPlainText"><context name="from_gateway2"><o:p></o:p></p>
<p class="MsoPlainText"> <extension
name="reformat_cid" ><o:p></o:p></p>
<p class="MsoPlainText">
<condition field="destination_number" expression="^00
(38\d\d \d\d\d\d\d\d)$"><o:p></o:p></p>
<p class="MsoPlainText">
<action application="transfer" data="+$1 XML
from-external"/><o:p></o:p></p>
<p class="MsoPlainText">
</condition><o:p></o:p></p>
<p class="MsoPlainText"> </extension> <o:p></o:p></p>
<p class="MsoPlainText">. . .<o:p></o:p></p>
<p class="MsoPlainText"></context><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Then in your main trunk dialplan (here
called "from-external") all the numbers will be in the format
+38n and 7 more digits.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">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.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </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> </o:p></p>
<p class="MsoPlainText">I Hope that helped.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-----Original Message-----<br>
From: <a class="moz-txt-link-abbreviated" href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a>
[<a class="moz-txt-link-freetext" href="mailto:freeswitch-users-bounces@lists.freeswitch.org">mailto:freeswitch-users-bounces@lists.freeswitch.org</a>] 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> </o:p></p>
<p class="MsoPlainText">Hi,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </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> </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> </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> </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> </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> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </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 moz-do-not-send="true"
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 moz-do-not-send="true"
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> </o:p></p>
<p class="MsoPlainText">FreeSWITCH-powered IP PBX: The CudaTel
Communication Server <a moz-do-not-send="true"
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> </o:p></p>
<p class="MsoPlainText">Official FreeSWITCH Sites<o:p></o:p></p>
<p class="MsoPlainText"><a moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
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> </o:p></p>
<p class="MsoPlainText">FreeSWITCH-users mailing list<o:p></o:p></p>
<p class="MsoPlainText"><a moz-do-not-send="true"
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 moz-do-not-send="true"
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:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><o:p></o:p></p>
<p class="MsoPlainText"><a moz-do-not-send="true"
href="http://www.freeswitch.org"><span
style="color:windowtext;text-decoration:none">http://www.freeswitch.org</span></a><o:p></o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a class="moz-txt-link-freetext" href="http://www.cudatel.com">http://www.cudatel.com</a>
Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a>
FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
</pre>
</blockquote>
<br>
</body>
</html>