Hi all, I need to rewrite a To header, after send INVITE.
Here is my part of script:
if (avp_db_load("$fu/username","$avp(ARS-OFS)"))
{
if (avp_check("$avp(ARS-OFS)","eq/lw-re/i"))
{
if ($rU=~"^0[0-9]+")
{
strip(1);
prefix("87019");
rewritehostport("10.9.6.3:5060");
uac_replace_to("sip:$ru");
route(1);
exit;
}
}
else
{
if (avp_check("$avp(ARS-OFS)","eq/lw-mo/i"))
{
if ($rU=~"^0[0-9]+")
{
strip(1);
prefix("87070");
uac_replace_to("sip:$ru");
route(1);
exit;
}
}
}
}
If I do like above, the result is:
INVITE sip:[email protected]:5060;user=phone SIP/2.0.
Record-Route:
<sip:10.9.101.166;lr;ftag=F542B897A1EA;vst=AAAAAENZQg0IBwUBCwQCBHABBR4LGgEDcR8BGA8UAx4FCjUwNjA7dXNlcj1waG9uZQ-->.
Via: SIP/2.0/UDP 10.9.101.166;branch=z9hG4bK8ec5.cec86122.0.
Via: SIP/2.0/UDP 172.16.52.7:5061.
From: Fax Alcatel <sip:[email protected]:5061>;tag=F542B897A1EA.
*To: sip:sip:[email protected]:5060;user=phone.*
Call-ID: [email protected].
CSeq: 101 INVITE.
Max-Forwards: 69.
Contact: <sip:[email protected]:5061;user=phone>.
User-Agent: Alcatel-Lucent OmniTouch Fax Server Application/6.5.6.28.
P-Alcatel-CSBU: charging=sip:[email protected].
Content-Type: application/sdp.
Content-Length: 164.
But what I am trying to achive is something like this:
*To: sip:[email protected]:5060*
How can I do that?
Best regards.
--
View this message in context:
http://opensips-open-sip-server.1449251.n2.nabble.com/Help-with-uac-replace-to-tp7078985p7078985.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users