[prev in list] [next in list] [prev in thread] [next in thread] 

List:       serusers
Subject:    Re: [SR-Users] Guidelines on E164 conversions
From:       Melissa Frasik <melissa.frasik () dicecorp ! com>
Date:       2021-07-30 13:46:48
Message-ID: DM6PR22MB21340A21CD87E22313019F3DF6EC9 () DM6PR22MB2134 ! namprd22 ! prod ! outlook ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

Thank you so much! I removed any $fU/$rU manipulation in favor of uac_replace_from/to \
and so far, results have been much more consistent. Appreciate all the help!


Melissa Frasik

Developer

melissa.frasik@iptelx.net<mailto:melissa.frasik@iptelx.net><mailto:first.last@dicecorp.com>


Phone:  (989) 891-2800

Fax:  (989) 891-2801

[cid:fd86c074-5618-48e4-8ca0-1ed41c69d3e0]

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



[cid:780ee621-51aa-4f13-90f6-6be3bb239e90][cid:ff4cc17e-fb35-400e-9d71-3ab0bd466f0c][c \
id:53753460-c1c5-4c07-ac8e-d61c778095de][cid:02bbb391-2898-4410-90eb-5b311af9e37e][cid:57fbdb17-aa8e-462b-b7ba-8efac17f3145]


________________________________
From: Henning Westerholt <hw@skalatan.de>
Sent: Thursday, July 29, 2021 9:35 AM
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Cc: Melissa Frasik <melissa.frasik@dicecorp.com>
Subject: RE: Guidelines on E164 conversions


Hello,



Yes – as said, you should use the uac functions to change the From/To headers. This \
is recommended over using the $fU or $tU.



Cheers,



Henning



From: sr-users <sr-users-bounces@lists.kamailio.org> On Behalf Of Melissa Frasik
Sent: Wednesday, July 28, 2021 7:52 PM
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Subject: Re: [SR-Users] Guidelines on E164 conversions



Hello,



My apologies, I seem to have ​posted an incomplete code segment. I only seem to \
have issues when it comes to replacing $fU (before using uac_replace_from) - the same \
action on $rU seems to work properly. In the below situation, the $fU variable should \
be updated with the plus, but the $avp(uacreplacefromdisplay) variable has the value \
of the original $fU, not the updated one. Is this practice redundant, and should \
actions on $fU and $rU be avoided in favor of uac_replace_to/uac_replace_from?





            $fU = "+" + $avp(src=>countrycode) + $fU;

            $avp(uacreplacefromdisplay) = $fU;

            $avp(uacreplacefromuri) = $fu;



        if ($avp(uacreplacefromdisplay) && $avp(uacreplacefromuri)) {

                uac_replace_from("$avp(uacreplacefromdisplay)","$avp(uacreplacefromuri)");


                $avp(uacreplacefromdisplay[*])=$null;

                $avp(uacreplacefromuri[*])=$null;

        }



            xlog("$ci - converting domestic caller id number to $fU ($fu) - \
$avp(uacreplacefromdisplay) $avp(uacreplacefromuri)");




Thank you so much for your help!

________________________________

From: Henning Westerholt <hw@skalatan.de<mailto:hw@skalatan.de>>
Sent: Wednesday, July 28, 2021 1:29 PM
To: Kamailio (SER) - Users Mailing List \
                <sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>>
Cc: Melissa Frasik <melissa.frasik@dicecorp.com<mailto:melissa.frasik@dicecorp.com>>
Subject: RE: Guidelines on E164 conversions



Hello,



If you want to change the From (or To) header content, you should use the "uac" \
modules replace_from/_to functions. They will transparently make sure that both \
end-points get the correct header content.



Cheers,



Henning



--

Henning Westerholt – https://skalatan.de/blog/

Kamailio services – https://gilawa.com<https://gilawa.com/>





From: sr-users <sr-users-bounces@lists.kamailio.org<mailto:sr-users-bounces@lists.kamailio.org>> \
                On Behalf Of Melissa Frasik
Sent: Tuesday, July 27, 2021 11:26 PM
To: sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>
Subject: [SR-Users] Guidelines on E164 conversions



Hi all,

I'm running into some issues with E164 conversions and was wondering if there was a \
decent standardized method for conversions. Conversions using $rU seem to be working \
great, but $fU is behaving badly. This is what I have so far:

    xlog("$ci - caller id was $avp(src=>callerid)");



    if($avp(src=>callerid) =~ "^\+"){

            xlog("$ci - caller id already E164");

    }else if($(rU{s.substr,0,$(avp(src=>countrycode){s.len})}) == \
$avp(src=>countrycode)){

            $avp(src=>callerid) = "+" + $avp(src=>callerid);

            $fU = $avp(src=>callerid);

            $avp(uacreplacefromdisplay) = $fU;

            $avp(uacreplacefromuri) = $fu;

            xlog("$ci - Adding plus to make caller id e164");

    }else{

            $fU = "+" + $avp(src=>countrycode) + $fU;

            $avp(uacreplacefromdisplay) = $fU;

            $avp(uacreplacefromuri) = $fu;

            xlog("$ci - converting domestic caller id number to $fU ($fu) - \
$avp(uacreplacefromdisplay) $avp(uacreplacefromuri)");

    }



Previously, I'd found a suggestion mentioning using uac_replace_from in the \
route[RELAY] (which is the purpose of the uacreplacefrom avps), but $fU does not \
appear to be changing its value. Is there something I'm doing incorrectly?


[Attachment #5 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} \
</style> </head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0);"> Thank you so much! I removed any $fU/$rU manipulation in favor \
of uac_replace_from/to and so far, results have been much more consistent. Appreciate \
all the help!</div> <div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0);"> <br>
</div>
<div id="Signature">
<div>
<meta content="text/html; charset=UTF-8">
<div id="divtagdefaultwrapper" dir="ltr" style="color:rgb(0,0,0)">
<p style="margin-top: 0px; margin-bottom: \
0px;font-family:Calibri,Helvetica,sans-serif; font-size:12pt; margin-top:0px; \
margin-bottom:0px"> </p>
<div class="OutlineElement Ltr SCXW197032541" style="margin:0px; padding:0px; \
overflow:visible; clear:both"> <p class="Paragraph SCXW197032541" style="margin-top: \
0px; margin-bottom: 0px;margin-right:0px; margin-left:0px; padding:0px; \
word-wrap:break-word; vertical-align:baseline; background-color:transparent; \
color:windowtext"> <font face="Arial, Arial_MSFontService, sans-serif"><span \
style="font-size:13.3333px"><b>Melissa Frasik</b></span></font><span class="EOP \
SCXW197032541" style="font-family:Arial,Arial_MSFontService,sans-serif; \
font-size:10pt; margin:0px; padding:0px; line-height:17px"></span></p> </div>
<div class="OutlineElement Ltr SCXW197032541" style="margin:0px; padding:0px; \
overflow:visible; clear:both"> <p class="Paragraph SCXW197032541" style="margin-top: \
0px; margin-bottom: 0px;margin-right:0px; margin-left:0px; padding:0px; \
word-wrap:break-word; vertical-align:baseline; background-color:transparent; \
color:windowtext"> <font face="Arial, Arial_MSFontService, sans-serif"><span \
style="font-size:13.3333px">Developer</span></font><span class="EOP SCXW197032541" \
style="font-family:Arial,Arial_MSFontService,sans-serif; font-size:10pt; margin:0px; \
padding:0px; line-height:17px"></span></p> </div>
<div class="OutlineElement Ltr SCXW197032541" \
style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; margin:0px; \
padding:0px; overflow:visible; clear:both"> <p class="Paragraph SCXW197032541" \
style="margin-top: 0px; margin-bottom: 0px;margin-right:0px; margin-left:0px; \
padding:0px; word-wrap:break-word; vertical-align:baseline; \
background-color:transparent; color:windowtext"> <u><span class="TextRun EmptyTextRun \
SCXW197032541" style="margin:0px; padding:0px; font-size:10pt; \
font-family:Calibri,Calibri_MSFontService,sans-serif; \
line-height:17px"></span></u><span class="TextRun Underlined SCXW197032541" \
lang="EN-US" style="margin:0px; padding:0px; color:rgb(5,99,193); font-size:10pt; \
font-family:Arial,Arial_MSFontService,sans-serif; line-height:17px"><span \
class="NormalTextRun SCXW197032541" style="margin:0px; padding:0px; \
background-color:inherit"><u><span style="color:rgb(0,111,201)"></span><a \
href="mailto:melissa.frasik@iptelx.net" class="OWAAutoLink"><span \
style="color:rgb(0,111,201)">melissa.frasik@</span><span \
style="color:rgb(0,111,201)">iptelx</span><span \
style="color:rgb(0,111,201)">.net</span></a><span \
style="color:rgb(0,111,201)"></span></u><a class="Hyperlink SCXW197032541" \
href="mailto:first.last@dicecorp.com" target="_blank" \
rel="noreferrer"></a></span></span><span class="EOP SCXW197032541" style="margin:0px; \
padding:0px; font-size:10pt; line-height:17px; \
font-family:Arial,Arial_MSFontService,sans-serif"></span></p> </div>
<div class="OutlineElement Ltr SCXW197032541" \
style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; margin:0px; \
padding:0px; overflow:visible; clear:both"> <p class="Paragraph SCXW197032541" \
style="margin-top: 0px; margin-bottom: 0px;margin-right:0px; margin-left:0px; \
padding:0px; word-wrap:break-word; vertical-align:baseline; \
background-color:transparent; color:windowtext"> <span class="TextRun SCXW197032541" \
lang="EN-US" style="margin:0px; padding:0px; font-size:10pt; \
font-family:Arial,Arial_MSFontService,sans-serif; line-height:17px"><span \
class="NormalTextRun SCXW197032541" style="margin:0px; padding:0px; \
background-color:inherit">Phone</span></span><span class="TextRun SCXW197032541" \
lang="EN-US" style="margin:0px; padding:0px; font-size:10pt; \
font-family:Arial,Arial_MSFontService,sans-serif; line-height:17px"><span \
class="ContextualSpellingAndGrammarError SCXW197032541" style="margin:0px; \
padding:0px; background-repeat:repeat-x">:&nbsp;  (989</span></span><span \
class="TextRun SCXW197032541" lang="EN-US" style="margin:0px; padding:0px; \
font-size:10pt; font-family:Arial,Arial_MSFontService,sans-serif; \
line-height:17px"><span class="NormalTextRun SCXW197032541" style="margin:0px; \
padding:0px; background-color:inherit">)  891-2800</span></span><span class="EOP \
SCXW197032541" style="margin:0px; padding:0px; font-size:10pt; line-height:17px; \
font-family:Arial,Arial_MSFontService,sans-serif">&nbsp;</span></p> </div>
<div class="OutlineElement Ltr SCXW197032541" \
style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; margin:0px; \
padding:0px; overflow:visible; clear:both"> <p class="Paragraph SCXW197032541" \
style="margin-top: 0px; margin-bottom: 0px;margin-right:0px; margin-left:0px; \
padding:0px; word-wrap:break-word; vertical-align:baseline; \
background-color:transparent; color:windowtext"> <span class="TextRun SCXW197032541" \
lang="EN-US" style="margin:0px; padding:0px; font-size:10pt; \
font-family:Arial,Arial_MSFontService,sans-serif; line-height:17px"><span \
class="NormalTextRun SCXW197032541" style="margin:0px; padding:0px; \
background-color:inherit">Fax</span></span><span class="TextRun SCXW197032541" \
lang="EN-US" style="margin:0px; padding:0px; font-size:10pt; \
font-family:Arial,Arial_MSFontService,sans-serif; line-height:17px"><span \
class="ContextualSpellingAndGrammarError SCXW197032541" style="margin:0px; \
padding:0px; background-repeat:repeat-x">:&nbsp;  (</span></span><span class="TextRun \
SCXW197032541" lang="EN-US" style="margin:0px; padding:0px; font-size:10pt; \
font-family:Arial,Arial_MSFontService,sans-serif; line-height:17px"><span \
class="NormalTextRun SCXW197032541" style="margin:0px; padding:0px; \
background-color:inherit">989)  891-2801</span></span><span class="EOP SCXW197032541" \
style="margin:0px; padding:0px; font-size:10pt; line-height:17px; \
font-family:Arial,Arial_MSFontService,sans-serif"></span></p> </div>
<div class="OutlineElement Ltr SCXW197032541" \
style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; margin:0px; \
padding:0px; overflow:visible; clear:both"> <p class="Paragraph SCXW197032541" \
style="margin-top: 0px; margin-bottom: 0px;margin-right:0px; margin-left:0px; \
padding:0px; word-wrap:break-word; vertical-align:baseline; \
background-color:transparent; color:windowtext"> <span class="TextRun EmptyTextRun \
SCXW197032541" lang="EN-US" style="margin:0px; padding:0px; font-size:12pt; \
font-family:Calibri,Calibri_MSFontService,sans-serif; line-height:21px"></span><span \
class="WACImageContainer BlobObject DragDrop SCXW197032541" style="margin:0px; \
padding:0px"><span id="{a6230daf-7615-48ff-bc2b-5b1b7609f297}{46}" \
class="WACAltTextDescribedBy SCXW197032541" style="margin:0px; \
padding:0px"></span><img class="EmojiInsert" id="OWAPstImg579264" style="margin:1px; \
padding:2px; border:none; vertical-align:baseline; width:auto; height:auto; \
white-space:pre!important" data-outlook-trace="F:1|T:1" \
src="cid:fd86c074-5618-48e4-8ca0-1ed41c69d3e0"></span><span class="TextRun \
EmptyTextRun SCXW197032541" lang="EN-US" style="margin:0px; padding:0px; \
font-size:10pt; font-family:Arial,Arial_MSFontService,sans-serif; \
line-height:17px"></span><span class="EOP SCXW197032541" style="margin:0px; \
padding:0px; font-size:10pt; line-height:17px; \
font-family:Arial,Arial_MSFontService,sans-serif">&nbsp;</span></p> </div>
<div class="OutlineElement Ltr SCXW197032541" \
style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; margin:0px; \
padding:0px; overflow:visible; clear:both"> <p class="Paragraph SCXW197032541" \
style="margin-top: 0px; margin-bottom: 0px;margin-right:0px; margin-left:0px; \
padding:0px; word-wrap:break-word; vertical-align:baseline; \
background-color:transparent; color:windowtext"> <span class="TextRun EmptyTextRun \
SCXW197032541" style="margin:0px; padding:0px; font-size:10pt; \
font-family:Calibri,Calibri_MSFontService,sans-serif; line-height:17px"></span><a \
class="Hyperlink SCXW197032541" href="http://www.dicecorp.com/" target="_blank" \
rel="noreferrer" style="margin:0px; padding:0px"><span class="TextRun Underlined \
SCXW197032541" lang="EN-US" style="margin:0px; padding:0px; color:rgb(5,99,193); \
font-size:10pt; font-family:Arial,Arial_MSFontService,sans-serif; \
line-height:17px"><span class="NormalTextRun SCXW197032541" style="margin:0px; \
padding:0px; background-color:inherit">www.dicecorp.com</span></span></a><span \
class="TextRun EmptyTextRun SCXW197032541" lang="EN-US" style="margin:0px; \
padding:0px; font-size:10pt; font-family:Arial,Arial_MSFontService,sans-serif; \
line-height:17px"></span><span class="EOP SCXW197032541" style="margin:0px; \
padding:0px; font-size:10pt; line-height:17px; \
font-family:Arial,Arial_MSFontService,sans-serif">&nbsp;</span></p> </div>
<div class="OutlineElement Ltr SCXW197032541" \
style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; margin:0px; \
padding:0px; overflow:visible; clear:both"> <p class="Paragraph SCXW197032541" \
style="margin-top: 0px; margin-bottom: 0px;margin-right:0px; margin-left:0px; \
padding:0px; word-wrap:break-word; vertical-align:baseline; \
background-color:transparent; color:windowtext"> <span class="TextRun SCXW197032541" \
lang="EN-US" style="margin:0px; padding:0px; font-size:10pt; \
font-family:Arial,Arial_MSFontService,sans-serif; line-height:17px"><span \
class="NormalTextRun SCXW197032541" style="margin:0px; padding:0px; \
background-color:inherit"></span></span><span class="EOP SCXW197032541" \
style="margin:0px; padding:0px; font-size:10pt; line-height:17px; \
font-family:Arial,Arial_MSFontService,sans-serif">&nbsp;</span></p> </div>
<div class="OutlineElement Ltr SCXW197032541" \
style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; margin:0px; \
padding:0px; overflow:visible; clear:both"> <p class="Paragraph SCXW197032541" \
style="margin-top: 0px; margin-bottom: 0px;margin-right:0px; margin-left:0px; \
padding:0px; word-wrap:break-word; vertical-align:baseline; \
background-color:transparent; color:windowtext"> <span class="TextRun EmptyTextRun \
SCXW197032541" lang="EN-US" style="margin:0px; padding:0px; font-size:12pt; \
font-family:Calibri,Calibri_MSFontService,sans-serif; line-height:21px"></span><span \
class="WACImageContainer BlobObject DragDrop SCXW197032541" style="margin:0px; \
padding:0px"><span id="{a6230daf-7615-48ff-bc2b-5b1b7609f297}{47}" \
class="WACAltTextDescribedBy SCXW197032541" style="margin:0px; \
padding:0px"></span><img class="EmojiInsert" id="OWAPstImg63073" style="margin:1px; \
padding:2px; border:none; vertical-align:baseline; width:29px; height:29px; \
white-space:pre!important" data-outlook-trace="F:1|T:1" \
src="cid:780ee621-51aa-4f13-90f6-6be3bb239e90"></span><span class="TextRun \
EmptyTextRun SCXW197032541" lang="EN-US" style="margin:0px; padding:0px; \
font-size:12pt; font-family:Calibri,Calibri_MSFontService,sans-serif; \
line-height:21px"></span><span class="WACImageContainer BlobObject DragDrop \
SCXW197032541" style="margin:0px; padding:0px"><span \
id="{a6230daf-7615-48ff-bc2b-5b1b7609f297}{48}" class="WACAltTextDescribedBy \
SCXW197032541" style="margin:0px; padding:0px"></span><img class="EmojiInsert" \
id="OWAPstImg744938" style="margin:1px; padding:2px; border:none; \
vertical-align:baseline; width:29px; height:29px; white-space:pre!important" \
data-outlook-trace="F:1|T:1" \
src="cid:ff4cc17e-fb35-400e-9d71-3ab0bd466f0c"></span><span class="TextRun \
EmptyTextRun SCXW197032541" lang="EN-US" style="margin:0px; padding:0px; \
font-size:12pt; font-family:Calibri,Calibri_MSFontService,sans-serif; \
line-height:21px"></span><span class="WACImageContainer BlobObject DragDrop \
SCXW197032541" style="margin:0px; padding:0px"><span \
id="{a6230daf-7615-48ff-bc2b-5b1b7609f297}{49}" class="WACAltTextDescribedBy \
SCXW197032541" style="margin:0px; padding:0px"></span><img class="EmojiInsert" \
id="OWAPstImg485266" style="margin:1px; padding:2px; border:none; \
vertical-align:baseline; width:29px; height:29px; white-space:pre!important" \
data-outlook-trace="F:1|T:1" \
src="cid:53753460-c1c5-4c07-ac8e-d61c778095de"></span><span class="TextRun \
EmptyTextRun SCXW197032541" lang="EN-US" style="margin:0px; padding:0px; \
font-size:12pt; font-family:Calibri,Calibri_MSFontService,sans-serif; \
line-height:21px"></span><span class="WACImageContainer BlobObject DragDrop \
SCXW197032541" style="margin:0px; padding:0px"><span \
id="{a6230daf-7615-48ff-bc2b-5b1b7609f297}{50}" class="WACAltTextDescribedBy \
SCXW197032541" style="margin:0px; padding:0px"></span><img class="EmojiInsert" \
id="OWAPstImg152414" style="margin:1px; padding:2px; border:none; \
vertical-align:baseline; width:29px; height:29px; white-space:pre!important" \
data-outlook-trace="F:1|T:1" \
src="cid:02bbb391-2898-4410-90eb-5b311af9e37e"></span><span class="TextRun \
EmptyTextRun SCXW197032541" lang="EN-US" style="margin:0px; padding:0px; \
font-size:12pt; font-family:Calibri,Calibri_MSFontService,sans-serif; \
line-height:21px"></span><span class="WACImageContainer BlobObject DragDrop \
SCXW197032541" style="margin:0px; padding:0px"><span \
id="{a6230daf-7615-48ff-bc2b-5b1b7609f297}{51}" class="WACAltTextDescribedBy \
SCXW197032541" style="margin:0px; padding:0px"></span><img class="EmojiInsert" \
id="OWAPstImg126424" style="margin:1px; padding:2px; border:none; \
vertical-align:baseline; width:29px; height:29px; white-space:pre!important" \
data-outlook-trace="F:1|T:1" \
src="cid:57fbdb17-aa8e-462b-b7ba-8efac17f3145"></span></p> </div>
<p style="margin-top: 0px; margin-bottom: \
0px;font-family:Calibri,Helvetica,sans-serif; font-size:12pt"> </p>
</div>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" \
style="font-size:11pt" color="#000000"><b>From:</b> Henning Westerholt \
&lt;hw@skalatan.de&gt;<br> <b>Sent:</b> Thursday, July 29, 2021 9:35 AM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List \
&lt;sr-users@lists.kamailio.org&gt;<br> <b>Cc:</b> Melissa Frasik \
&lt;melissa.frasik@dicecorp.com&gt;<br> <b>Subject:</b> RE: Guidelines on E164 \
conversions</font> <div>&nbsp;</div>
</div>
<style>
<!--
@font-face
	{font-family:"Cambria Math"}
@font-face
	{font-family:Calibri}
@font-face
	{font-family:Menlo}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif}
a:link, span.x_MsoHyperlink
	{color:blue;
	text-decoration:underline}
p.x_p1, li.x_p1, div.x_p1
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif}
span.x_s1
	{}
span.x_apple-converted-space
	{}
span.x_s2
	{}
span.x_s3
	{}
p.x_p2, li.x_p2, div.x_p2
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif}
span.x_s4
	{}
span.x_s6
	{}
p.x_p5, li.x_p5, div.x_p5
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif}
p.x_xmsonormal, li.x_xmsonormal, div.x_xmsonormal
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif}
span.x_E-MailFormatvorlage32
	{font-family:"Calibri",sans-serif;
	color:windowtext}
.x_MsoChpDefault
	{font-size:10.0pt}
@page WordSection1
	{margin:70.85pt 70.85pt 2.0cm 70.85pt}
div.x_WordSection1
	{}
-->
</style>
<div lang="DE" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="x_WordSection1">
<p class="x_MsoNormal"><span lang="EN-GB" style="">Hello,</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="">&nbsp;</span></p>
<p class="x_MsoNormal"><span lang="EN-GB" style="">Yes – as said, you should use \
the uac functions to change the From/To headers. This is recommended over using the \
$fU or $tU.</span></p> <p class="x_MsoNormal"><span lang="EN-GB" \
style="">&nbsp;</span></p> <p class="x_MsoNormal"><span lang="EN-GB" \
style="">Cheers,</span></p> <p class="x_MsoNormal"><span lang="EN-GB" \
style="">&nbsp;</span></p> <p class="x_MsoNormal"><span lang="EN-GB" \
style="">Henning</span></p> <p class="x_MsoNormal"><span lang="EN-GB" \
style="">&nbsp;</span></p> <div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="x_MsoNormal" style="margin-left:35.4pt"><b><span \
lang="EN-GB">From:</span></b><span lang="EN-GB"> sr-users \
&lt;sr-users-bounces@lists.kamailio.org&gt; <b>On Behalf Of </b>Melissa Frasik<br>
<b>Sent:</b> Wednesday, July 28, 2021 7:52 PM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List \
&lt;sr-users@lists.kamailio.org&gt;<br> <b>Subject:</b> Re: [SR-Users] Guidelines on \
E164 conversions</span></p> </div>
</div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span \
lang="EN-GB">&nbsp;</span></p> <div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; \
color:black">Hello,</span></p> </div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; \
color:black">&nbsp;</span></p> </div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; \
color:black">My apologies, I seem to have <span \
style="background:yellow">​</span>posted an incomplete code segment. I only seem to \
have issues when it comes to replacing $fU (before using uac_replace_from) - the same \
action on $rU seems to work properly. In the below situation, the $fU variable should \
be updated with the plus, but the $avp(uacreplacefromdisplay) variable has the value \
of the original $fU, not the updated one. Is this practice redundant, and should \
actions on $fU and $rU be avoided in favor of \
uac_replace_to/uac_replace_from?</span></p> </div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; \
color:black">&nbsp;</span></p> </div>
<div>
<p class="x_p1" style="margin-left:35.4pt; background-color:rgba(53,53,76,0.87)">
<span style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:#F24E37">&nbsp;</span></p> <p class="x_p1" style="margin-left:35.4pt; \
background-color:rgba(53,53,76,0.87)"> <span class="x_apple-converted-space"><span \
style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; color:white">&nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span></span><span class="x_s1"><span \
style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; color:white">$fU \
=</span></span><span class="x_s2"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:#F24E37"> &quot;+&quot; + \
$avp(src=&gt;countrycode) + $fU</span></span><span class="x_s3"><span \
style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:#00008A">;</span></span><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:#F24E37"></span></p> <p class="x_p2" \
style="margin-left:35.4pt; background-color:rgba(53,53,76,0.87)"> <span \
class="x_apple-converted-space"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; </span></span><span class="x_s2"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white">$avp(uacreplacefromdisplay) \
=</span></span><span class="x_s4"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:#F24E37"> $fU</span></span><span \
class="x_s3"><span style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:#00008A">;</span></span><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white"></span></p> <p class="x_p2" \
style="margin-left:35.4pt; background-color:rgba(53,53,76,0.87)"> <span \
class="x_apple-converted-space"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; </span></span><span class="x_s2"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white">$avp(uacreplacefromuri) \
=</span></span><span class="x_s4"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:#F24E37"> $fu</span></span><span \
class="x_s3"><span style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:#00008A">;</span></span><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white"></span></p> <p class="x_p2" \
style="margin-left:35.4pt; background-color:rgba(53,53,76,0.87)"> <span \
style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; color:#00008A"><br> <br>
</span><span style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:white"></span></p> <p class="x_p2" style="margin-left:35.4pt; \
background-color:rgba(53,53,76,0.87)"> <span class="x_apple-converted-space"><span \
style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; color:white">&nbsp; \
&nbsp; &nbsp; &nbsp; </span></span><span class="x_s2"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white">if ($avp(uacreplacefromdisplay) \
&amp;&amp; $avp(uacreplacefromuri)) {</span></span><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white"></span></p> <p class="x_p2" \
style="margin-left:35.4pt; background-color:rgba(53,53,76,0.87)"> <span \
class="x_apple-converted-space"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; </span></span><span class="x_s2"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; \
color:white">uac_replace_from(&quot;$avp(uacreplacefromdisplay)&quot;,&quot;$avp(uacreplacefromuri)&quot;)</span></span><span \
class="x_s3"><span style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:#00008A">;</span></span><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white"></span></p> <p class="x_p2" \
style="margin-left:35.4pt; background-color:rgba(53,53,76,0.87)"> <span \
class="x_apple-converted-space"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; </span></span><span class="x_s2"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; \
color:white">$avp(uacreplacefromdisplay</span></span><span class="x_s6"><span \
style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:#4BD535">[*]</span></span><span class="x_s2"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white">)=</span></span><span \
class="x_s4"><span style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:#F24E37">$null</span></span><span class="x_s3"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:#00008A">;</span></span><span \
style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; color:white"></span></p> \
<p class="x_p2" style="margin-left:35.4pt; background-color:rgba(53,53,76,0.87)"> \
<span class="x_apple-converted-space"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; </span></span><span class="x_s2"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; \
color:white">$avp(uacreplacefromuri</span></span><span class="x_s6"><span \
style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:#4BD535">[*]</span></span><span class="x_s2"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white">)=</span></span><span \
class="x_s4"><span style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:#F24E37">$null</span></span><span class="x_s3"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:#00008A">;</span></span><span \
style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; color:white"></span></p> \
<p class="x_p2" style="margin-left:35.4pt; background-color:rgba(53,53,76,0.87)"> \
<span class="x_apple-converted-space"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white">&nbsp; &nbsp; &nbsp; &nbsp; \
</span></span><span class="x_s2"><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:white">}</span></span><span \
style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; color:white"></span></p> \
<p class="x_p5" style="margin-left:35.4pt; background-color:rgba(53,53,76,0.87); \
min-height:14px"> <span style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:white">&nbsp;</span></p> <p class="x_p2" style="margin-left:35.4pt; \
background-color:rgba(53,53,76,0.87)"> <span class="x_apple-converted-space"><span \
style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; color:white">&nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span></span><span class="x_s2"><span \
style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:white">xlog(&quot;$ci - converting domestic caller id number to $fU ($fu) - \
$avp(uacreplacefromdisplay) $avp(uacreplacefromuri)&quot;)</span></span><span \
class="x_s3"><span style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:#00008A">;</span></span><span style="font-size:9.0pt; \
font-family:&quot;Menlo&quot;,serif; color:#00008A"><br> <br>
</span><span style="font-size:9.0pt; font-family:&quot;Menlo&quot;,serif; \
color:white"></span></p> <p class="x_MsoNormal" style="margin-left:35.4pt"><span \
style="font-size:12.0pt; color:black">&nbsp;</span></p> </div>
<div>
<p class="x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; \
color:black">Thank you so much for your help!</span></p> </div>
<div class="x_MsoNormal" align="center" style="margin-left:35.4pt; \
text-align:center"> <hr size="2" width="98%" align="center">
</div>
<div id="x_divRplyFwdMsg">
<p class="x_MsoNormal" style="margin-left:35.4pt"><b><span \
style="color:black">From:</span></b><span style="color:black"> Henning Westerholt \
&lt;<a href="mailto:hw@skalatan.de">hw@skalatan.de</a>&gt;<br> <b>Sent:</b> \
Wednesday, July 28, 2021 1:29 PM<br> <b>To:</b> Kamailio (SER) - Users Mailing List \
&lt;<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>&gt;<br>
 <b>Cc:</b> Melissa Frasik &lt;<a \
href="mailto:melissa.frasik@dicecorp.com">melissa.frasik@dicecorp.com</a>&gt;<br> \
<b>Subject:</b> RE: Guidelines on E164 conversions</span> </p> <div>
<p class="x_MsoNormal" style="margin-left:35.4pt">&nbsp;</p>
</div>
</div>
<div>
<div>
<p class="x_xmsonormal" style="margin-left:35.4pt"><span \
lang="EN-GB">Hello,</span></p> <p class="x_xmsonormal" \
style="margin-left:35.4pt"><span lang="EN-GB">&nbsp;</span></p> <p \
class="x_xmsonormal" style="margin-left:35.4pt"><span lang="EN-GB">If you want to \
change the From (or To) header content, you should use the "uac" modules \
replace_from/_to functions. They will transparently make sure that both end-points \
get the correct  header content.</span></p>
<p class="x_xmsonormal" style="margin-left:35.4pt"><span \
lang="EN-GB">&nbsp;</span></p> <p class="x_xmsonormal" \
style="margin-left:35.4pt"><span lang="EN-GB">Cheers,</span></p> <p \
class="x_xmsonormal" style="margin-left:35.4pt"><span lang="EN-GB">&nbsp;</span></p> \
<p class="x_xmsonormal" style="margin-left:35.4pt"><span \
lang="EN-GB">Henning</span></p> <div>
<p class="x_xmsonormal" style="margin-left:35.4pt">&nbsp;</p>
<p class="x_xmsonormal" style="margin-left:35.4pt"><span lang="EN-GB">-- </span></p>
<p class="x_xmsonormal" style="margin-left:35.4pt"><span lang="EN-GB">Henning \
Westerholt – </span><a href="https://skalatan.de/blog/"><span lang="EN-GB" \
style="color:#0563C1">https://skalatan.de/blog/</span></a></p> <p \
class="x_xmsonormal" style="margin-left:35.4pt"><span lang="EN-GB">Kamailio services \
– </span><a href="https://gilawa.com/"><span lang="EN-GB" \
style="color:#0563C1">https://gilawa.com</span></a> </p>
</div>
<p class="x_xmsonormal" style="margin-left:35.4pt"><span \
lang="EN-GB">&nbsp;</span></p> <p class="x_xmsonormal" \
style="margin-left:35.4pt"><span lang="EN-GB">&nbsp;</span></p> <div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="x_xmsonormal" style="margin-left:70.8pt"><b>From:</b> sr-users &lt;<a \
href="mailto:sr-users-bounces@lists.kamailio.org">sr-users-bounces@lists.kamailio.org</a>&gt;
 <b>On Behalf Of </b>Melissa Frasik<br>
<b>Sent:</b> Tuesday, July 27, 2021 11:26 PM<br>
<b>To:</b> <a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
 <b>Subject:</b> [SR-Users] Guidelines on E164 conversions</p>
</div>
</div>
<p class="x_xmsonormal" style="margin-left:70.8pt">&nbsp;</p>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">Hi all,</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">I'm running into some issues with E164 conversions and was wondering if \
there was a decent standardized method for conversions. Conversions using $rU seem to \
be working  great, but $fU is behaving badly. This is what I have so far:</span></p>
</div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black"><br> &nbsp; &nbsp; xlog(&quot;$ci - caller id was \
$avp(src=&gt;callerid)&quot;); </span></p> <div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp;</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; if($avp(src=&gt;callerid) =~ &quot;^\+&quot;){</span></p> \
</div> <div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog(&quot;$ci - caller id \
already E164&quot;);</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; }else \
if($(rU{s.substr,0,$(avp(src=&gt;countrycode){s.len})}) == \
$avp(src=&gt;countrycode)){</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $avp(src=&gt;callerid) = \
&quot;+&quot; + $avp(src=&gt;callerid);</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $fU = \
$avp(src=&gt;callerid);</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $avp(uacreplacefromdisplay) = \
$fU;</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $avp(uacreplacefromuri) = \
$fu;</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog(&quot;$ci - Adding plus \
to make caller id e164&quot;);</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; }else{</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $fU = &quot;+&quot; + \
$avp(src=&gt;countrycode) + $fU;</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $avp(uacreplacefromdisplay) = \
$fU;</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $avp(uacreplacefromuri) = \
$fu;</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog(&quot;$ci - converting \
domestic caller id number to $fU ($fu) - $avp(uacreplacefromdisplay) \
$avp(uacreplacefromuri)&quot;);</span></p> </div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp; &nbsp; }</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">&nbsp;</span></p> </div>
<div>
<p class="x_xmsonormal" style="margin-left:70.8pt"><span style="font-size:12.0pt; \
color:black">Previously, I'd found a suggestion mentioning using uac_replace_from in \
the route[RELAY] (which is the purpose of the uacreplacefrom avps), but $fU does not \
appear  to be changing its value. Is there something I'm doing \
incorrectly?</span></p> </div>
</div>
</div>
</div>
</div>
</body>
</html>


["Outlook-coq33cqz.png" (image/png)]
["Outlook-3e4yefsm.png" (image/png)]
["Outlook-0g4iuiuy.png" (image/png)]
["Outlook-fo214p0a.png" (image/png)]
["Outlook-kieycvvk.png" (image/png)]
["Outlook-gpaw0hbb.png" (image/png)]

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

--===============0868634592==--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic