<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<tt>Hi, M</tt><tt>ichele!</tt><tt><br>
</tt><tt><br>
</tt><tt>OpenSIPS does not support passing parameters as you've
done. It is always expecting a string between quotes. So you
should replace your uac_replace_from and append_hf with something
li</tt><tt>ke:</tt><tt><br>
</tt><tt><br>
</tt><tt>uac_replace_from("05771530$(fU{s.substr,1,0})",
"sip:05771530$(fU{s.substr,1,0})@$Ri");
</tt><tt><br>
</tt><tt>append_hf("P-Asserted-Identity:
<sip:05771530$(fU{s.substr,1,0})@$Ri>\r\n");</tt><tt><br>
</tt><tt><br>
</tt><tt>Best regards,</tt><br>
<pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 02/23/2017 11:51 AM, Michele Pinassi
wrote:<br>
</div>
<blockquote cite="mid:ef5b8dc7-dd58-a038-2972-c6d3f69ff555@unisi.it"
type="cite">
<pre wrap="">Hi all,
i need to remap "from" number prior to send call to a ToIP trunk
In my route[toip] i wrote:
route[toip] {
xlog("L_INFO","$ci - Route via TOIP from $fU to $tU (RURI: $ru)\n");
if (is_method("INVITE")) {
setflag(DB_FLAG);
setflag(ACC_DO); # do accounting
}
if($fU=~"6[0-9]{3}$") {
# Change all 6xxx to 05771530xxx
uac_replace_from("05771530"+$(fU{s.substr,1,0}),"sip:05771530"+$(fU{s.substr,1,0})+"@"+$Ri);
append_hf("P-Asserted-Identity:
<sip:05771530"+$(fU{s.substr,1,0})+"@"+$Ri+">\r\n");
}
if(route_to_carrier("toip")) {
t_on_failure("next_gw");
t_relay();
exit;
}
}
but i got an error. Maybe i'm doing somewthing wrong with number
manipulation.
Suggestions how i can do the same thing in a more elegant manner are
welcome !
Thanks for any help, Michele
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>