<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=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@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;
color:black;}
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;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
tt
{mso-style-priority:99;
font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@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 bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:windowtext'>Hang on, that I have changed already: <o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'> $var(i)=1;<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> if (dp_translate($var(i),"$ruri.user",$var(rU)))<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>The result is identical (sorry </span><span style='font-family:"Segoe UI Emoji",sans-serif;color:windowtext'>😊</span><span style='color:windowtext'>). <o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>As for the routing:<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>I do like this<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>Route <o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>{<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> ….<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> ##initial INVITE<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> if (is_method("INVITE") && !has_totag())<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> {<o:p></o:p></span></p><p class=MsoNormal style='text-indent:.5in'><span style='color:windowtext'>…<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> if (is_registered("location"))<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> {<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> xlog("callid=$ci: Route[0]: the from user is registered, we go to callhandling");<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> route(callhandling);<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>}<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>Route[callhandling]<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>{<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> …<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> Route(normalizeforinbound);<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> ….<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>}<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>Route[normalizeforinbound]<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>{<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> …<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> $var(i)=1;<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> if (dp_translate($var(i),"$ruri.user",$var(rU)))<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> {<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> xlog("callid=$ci: Route[normalizeforinbound]: we dropped 0,00,+ from $rU, result is var(rU) $var(rU)");<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> }<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> else <o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> {<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> xlog("callid=$ci: Route[normalizeforinbound]: dp_translate failed!, we drop the call");<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> send_reply(404,"Unallocated Number");<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> exit;<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'> }<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>…<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>}<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>BR, <o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='color:windowtext'>From:</span></b><span style='color:windowtext'> Users <users-bounces@lists.opensips.org> <b>On Behalf Of </b>Liviu Chircu<br><b>Sent:</b> Tuesday, July 2, 2019 6:44 PM<br><b>To:</b> OpenSIPS users mailling list <users@lists.opensips.org><br><b>Subject:</b> Re: [OpenSIPS-Users] problem in dialplan<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p><tt><span style='font-size:10.0pt'>Are you sure this is the intended effect? Notice how that composite parameter of dp_translate()</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><tt>has been split in two parameters in 3.0 [1]. To me, it looks like you should call:</tt></span><o:p></o:p></p><p><tt><span style='font-size:10.0pt'>... dp_translate(1, $ruri.user, $var(rU)) ...</span></tt><o:p></o:p></p><p><tt><span style='font-size:10.0pt'>To prevent other such errors with the rest of your script, please go through the 3.0 migration</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><tt>document [2] and make sure to apply each change that's relevant to your script code.</tt></span><o:p></o:p></p><p><tt><span style='font-size:10.0pt'>Best regards,</span></tt><br><br><tt><span style='font-size:10.0pt'>[1]: <a href="https://opensips.org/html/docs/modules/3.0.x/dialplan.html#func_dp_translate">https://opensips.org/html/docs/modules/3.0.x/dialplan.html#func_dp_translate</a></span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><tt>[2]: <a href="https://opensips.org/Documentation/Migration-2-4-0-to-3-0-0">https://opensips.org/Documentation/Migration-2-4-0-to-3-0-0</a><a href="https://opensips.org/html/docs/modules/3.0.x/dialplan.html#func_dp_translate"> </a></tt></span><o:p></o:p></p><pre>Liviu Chircu<o:p></o:p></pre><pre>OpenSIPS Developer<o:p></o:p></pre><pre><a href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><o:p></o:p></pre><div><p class=MsoNormal>On 02.07.2019 15:09, johan de clercq wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>This the code : <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> if (dp_translate(1,"$ruri.user/$var(rU)"))<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> {<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> xlog("callid=$ci: Route[normalizeforinbound]: we dropped 0,00,+ from $rU, result is var(rU) $var(rU)");<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> }<o:p></o:p></p></blockquote></div></body></html>