<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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);">
Hi all,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
    xlog("$ci - caller id was $avp(src=>callerid)");
<div><br>
</div>
<div>    if($avp(src=>callerid) =~ "^\+"){</div>
<div>            xlog("$ci - caller id already E164");</div>
<div>    }else if($(rU{s.substr,0,$(avp(src=>countrycode){s.len})}) == $avp(src=>countrycode)){</div>
<div>            $avp(src=>callerid) = "+" + $avp(src=>callerid);</div>
<div>            $fU = $avp(src=>callerid);</div>
<div>            $avp(uacreplacefromdisplay) = $fU;</div>
<div>            $avp(uacreplacefromuri) = $fu;</div>
<div>            xlog("$ci - Adding plus to make caller id e164");</div>
<div>    }else{</div>
<div>            $fU = "+" + $avp(src=>countrycode) + $fU;</div>
<div>            $avp(uacreplacefromdisplay) = $fU;</div>
<div>            $avp(uacreplacefromuri) = $fu;</div>
<div>            xlog("$ci - converting domestic caller id number to $fU ($fu) - $avp(uacreplacefromdisplay) $avp(uacreplacefromuri)");</div>
<span>    }</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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?</div>
<div>
<div id="Signature">
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="color:rgb(0,0,0)">
<div class="OutlineElement Ltr SCXW197032541" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; margin:0px; padding:0px; overflow:visible; clear:both">
</div>
<p style="margin-top: 0px; margin-bottom: 0px;font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
</p>
</div>
</div>
</div>
</div>
</body>
</html>