<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Daniel,</p>
<p><br>
</p>
<p>I am attaching here my sip trace at client side.Request you to see this.</p>
<p>My client IP in register request is <span>125.16.231.74 and the server on which kamailio is running is 185.122.205.178.</span></p>
<p><span><br>
</span></p>
<p><span>I want my contact header to be <span><sip:OTT919620649614@185.122.205.178:5070;lr></span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>I am using avp_subst() function to replace this.But kamailio is not starting.</span></span></p>
<p><span><span>Please reply if I am in wrong way or have different understanding as I am very new to kamailio.</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>Thanks,</span></span></p>
<p><span><span>Narayan<br>
</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span></span></span><br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Narayan P<br>
<b>Sent:</b> Friday, April 14, 2017 12:54:25 PM<br>
<b>To:</b> sr-users@lists.sip-router.org<br>
<b>Cc:</b> moconda@gmail.com<br>
<b>Subject:</b> RE: Not able to replace route_uri in contact header uri</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi Daniel,<br>
<br>
Thanks for your response.<br>
<br>
I mean to say,<br>
In my register request the route header i.e. route_uri is <sip:185.122.205.178> and contact header is 3333@172.22.13.41.<br>
I want my contact header to be 3333@185.122.205.178.<br>
So how can I replace the contact header's only domain part with route_uri.the user part of the contact header remains same.<br>
<br>
<br>
Thanks,<br>
Narayan<br>
________________________________________<br>
From: Narayan P<br>
Sent: Thursday, April 13, 2017 11:13 AM<br>
To: sr-users@lists.sip-router.org<br>
Subject: Re: Not able to replace route_uri in contact header uri<br>
<br>
Hi ,<br>
<br>
Can anybody help me how to replace the domain part of $route-uri in contact  header .<br>
<br>
I am using avp_subst().But kamailio is not starting.<br>
<br>
<br>
I am new to kamailio.Any help will be highly appreciated.<br>
<br>
<br>
Thanks,<br>
<br>
Narayan<br>
<br>
________________________________<br>
From: Narayan P<br>
Sent: Wednesday, April 12, 2017 8:17:02 AM<br>
To: sr-users@lists.sip-router.org<br>
Subject: Not able to replace route_uri in contact header uri<br>
<br>
<br>
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($avp(s:fs) and  $hdr(Contact) as pjsip server uri ($avp(s:contact).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<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", "/(.*)@(.*)/$route_uri/");<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>
<br>
<br>
</div>
</span></font>
</body>
</html>