<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello,</p>
<p><br>
</p>
<p>can you paste here a sample SIP request and point what part of it
do you want to update? Otherwise I don't understand what do you
mean by "the domain part of $route-uri in contact header".</p>
<p><br>
</p>
<p>Cheers,<br>
Daniel<br>
</p>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 13.04.17 13:13, Narayan P wrote:<br>
</div>
<blockquote
cite="mid:HK2PR0201MB174534F4BDEE96711DE9228FD7020@HK2PR0201MB1745.apcprd02.prod.outlook.com"
type="cite">
<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>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
dir="ltr">
<p>Hi ,</p>
<p>Can anybody help me how to replace the domain part of
$route-uri in contact header .</p>
<p>I am using avp_subst().But kamailio is not starting.</p>
<p><br>
</p>
<p>I am new to kamailio.Any help will be highly appreciated.</p>
<p><br>
</p>
<p>Thanks,</p>
<p>Narayan<br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
color="#000000" face="Calibri, sans-serif"><b>From:</b>
Narayan P<br>
<b>Sent:</b> Wednesday, April 12, 2017 8:17:02 AM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<b>Subject:</b> Not able to replace route_uri in contact
header uri</font>
<div> </div>
</div>
<div>
<div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
dir="ltr">
<div>Hi All,<br>
<br>
I am using pjsip client and kamailiio,both running on
different servers.I want to replace the uri on which pjsip
is running with the uri on which kamailio is running in
contact header.<br>
I put some logs on route[REGISTRAR] and able to see the
$route_uri as kamailio server uri(<span>$avp(s:fs</span>)
and
<span>$hdr(Contact)</span> as pjsip server uri <span>($avp(s:contact</span>).But
I am not able to replace the uri with avp_subst() function.<br>
<br>
Can anybody help me how to replace the uri or with any any
other function.<br>
<br>
Below I have put the snippet of config file.<br>
<br>
<br>
# Handle SIP registrations<span></span><br>
route[REGISTRAR] {<br>
if (!is_method("REGISTER")) return;<br>
<br>
if(isflagset(FLT_NATS)) {<br>
setbflag(FLB_NATB);<br>
#!ifdef WITH_NATSIPPING<br>
# do SIP NAT pinging<br>
setbflag(FLB_NATSIPPING);<br>
#!endif<br>
}<br>
xlog("Narayan: before sending contact\n"); <br>
$avp(s:contact) = $hdr(Contact);<br>
$avp(s:fs) = $route_uri;<br>
xlog("Narayan: Forced socket is $avp(s:fs)\n");<br>
xlog("Narayan: contact header is
$avp(s:contact)\n");<br>
avp_subst("$avp(s:contact)/avp(s:contac)/g",
<a class="moz-txt-link-rfc2396E" href="mailto:/(.*)@(.*)/$route_uri/">"/(.*)@(.*)/$route_uri/"</a>);<br>
#avp_pushto("$ru/domain","$fd");<br>
#rewritehostport("185.122.206.62:5060");<br>
t_on_reply("MANAGE_REPLY");<br>
t_relay();<br>
#if (!save("location")) {<br>
# sl_reply_error();<br>
#}<br>
exit;<br>
}<br>
<br>
<br>
Any suggestion will be highly appreciated.<br>
<br>
<br>
Thanks,<br>
Narayan<br>
</div>
<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - May 22-24 (USA) - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - May 8-10, 2017 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
</body>
</html>