<div dir="ltr">Instead of doing this manually go for path header if your SIP SERVER supports it. <br> <a href="https://www.kamailio.org/docs/modules/devel/modules/path.html">https://www.kamailio.org/docs/modules/devel/modules/path.html</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 20 April 2017 at 19:09, Narayan P <span dir="ltr"><<a href="mailto:narayana88@outlook.com" target="_blank">narayana88@outlook.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div bgcolor="#FFFFFF" text="#000000">

<div id="m_4472837958221559424divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif" dir="ltr">
<p>Thanks for your kind Response Daniel,</p>
<p><br>
</p>
<p>Yes as you told with the requirement I have mentioned call will not reach client, I have explained my requirement in detail,</p>
<p><br>
</p>
<p>My requirement is to establish a call between 2 SIP clients Alice and Bob which are using 185.122.205.178(Kamailio) as outbound proxy and registered to a SIP SERVER,</p>
<p><br>
</p>
<p>I am not able to establish call between Alice and Bob, So I am trying to Replace the Contact header in Register request with Kamailio IP and then I will direct the Invite request to callee client using the data<span>(Username to IP:port tuple) I</span> have
 stored in Kamailio database.</p>
<p><br>
</p>
<p>Please suggest me if you have better Idea than what i am doing<br>
</p>
<p><br>
</p>
<p>Thanks & Regards</p>
<p>Narayan<br>
</p>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_4472837958221559424divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>><br>
<b>Sent:</b> Tuesday, April 18, 2017 1:04:38 PM<br>
<b>To:</b> Narayan P; <a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<b>Subject:</b> Re: Not able to replace route_uri in contact header uri</font>
<div> </div>
</div>
<div>
<p>Hello,</p>
<p><br>
</p>
<p>to clarify, in the REGISTER you sent and pasted again below, from</p>
<p><br>
</p>
<p>Contact: <a class="m_4472837958221559424moz-txt-link-rfc2396E">
<sip:OTT919620649614@125.16.<wbr>231.74:25841;ob></a></p>
<p><br>
</p>
<p>you want to have:<br>
</p>
<p><br>
</p>
<p>Contact: <a class="m_4472837958221559424moz-txt-link-rfc2396E">
<sip:OTT919620649614@185.122.<wbr>205.178:5070;lr></a></p>
<p><br>
</p>
<p>If yes, then this doesn't look right at all, then the device cannot receive calls anymore. Maybe you can explain the purpose and then we may be able to offer some hints.</p>
<p><br>
</p>
<p>Cheers,<br>
Daniel<br>
</p>
<p><br>
</p>
<p><br>
</p>
<pre>REGISTER <a class="m_4472837958221559424moz-txt-link-freetext">sip:185.122.206.62</a> SIP/2.0
Via: SIP/2.0/UDP 125.16.231.74:25841;rport;<wbr>branch=z9hG4bKPj592750e4-9a06-<wbr>4662-a55e-a8a71dedb974
Route: <a class="m_4472837958221559424moz-txt-link-rfc2396E"><sip:185.122.205.178:5070;lr></a>
Max-Forwards: 70
From: <a class="m_4472837958221559424moz-txt-link-rfc2396E"><sip:OTT919620649614@185.122.<wbr>206.62></a>;tag=35af1666-a2b1-<wbr>4c6e-a7b6-8675845036e7
To: <a class="m_4472837958221559424moz-txt-link-rfc2396E"><sip:OTT919620649614@185.122.<wbr>206.62></a>
Call-ID: 5bc6558f-1ffc-4990-bc99-<wbr>d099c4fdcbcb
CSeq: 41801 REGISTER
User-Agent: PJSUA v2.3 Linux-4.4.0.64/x86_64/glibc-2.<wbr>19
Contact: <a class="m_4472837958221559424moz-txt-link-rfc2396E"><sip:OTT919620649614@125.16.<wbr>231.74:25841;ob></a>
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Authorization: Digest username="OTT919620649614", realm="185.122.206.62", nonce="<wbr>af7780946d2b72ddc5e765a68798e9<wbr>37", uri=<a class="m_4472837958221559424moz-txt-link-rfc2396E">"sip:185.122.206.62"</a>, response="<wbr>a4c0614fbc3c72ece619247de5766a<wbr>4b", algorithm=MD5
Content-Length:  0


SIP/2.0 200 OK
Via: SIP/2.0/UDP 125.16.231.74:25841;rport=<wbr>25841;branch=<wbr>z9hG4bKPj592750e4-9a06-4662-<wbr>a55e-a8a71dedb974;received=<wbr>125.16.231.74
From: <a class="m_4472837958221559424moz-txt-link-rfc2396E"><sip:OTT919620649614@185.122.<wbr>206.62></a>;tag=35af1666-a2b1-<wbr>4c6e-a7b6-8675845036e7
Call-ID: 5bc6558f-1ffc-4990-bc99-<wbr>d099c4fdcbcb
CSeq: 41801 REGISTER
To: <a class="m_4472837958221559424moz-txt-link-rfc2396E"><sip:OTT919620649614@185.122.<wbr>206.62></a>;tag=1492409213989
Expires: 50
Contact: <a class="m_4472837958221559424moz-txt-link-rfc2396E"><sip:OTT919620649614@125.16.<wbr>231.74:25841;ob></a>;expires=50
Content-Length: 0</pre>
<br>
<div class="m_4472837958221559424moz-cite-prefix">On 17.04.17 08:38, Narayan P wrote:<br>
</div>
<blockquote type="cite">




<div dir="ltr">
<div id="m_4472837958221559424x_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><a class="m_4472837958221559424moz-txt-link-rfc2396E"><sip:OTT919620649614@185.122.<wbr>205.178:5070;lr></a></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 style="display:inline-block;width:98%">
<div id="m_4472837958221559424x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Narayan P<br>
<b>Sent:</b> Friday, April 14, 2017 12:54:25 PM<br>
<b>To:</b> <a class="m_4472837958221559424moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org" target="_blank">
sr-users@lists.sip-router.org</a><br>
<b>Cc:</b> <a class="m_4472837958221559424moz-txt-link-abbreviated" href="mailto:moconda@gmail.com" target="_blank">moconda@gmail.com</a><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="m_4472837958221559424PlainText">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 <a class="m_4472837958221559424moz-txt-link-rfc2396E">
<sip:185.122.205.178></a> and contact header is <a class="m_4472837958221559424moz-txt-link-abbreviated" href="mailto:3333@172.22.13.41" target="_blank">
3333@172.22.13.41</a>.<br>
I want my contact header to be <a class="m_4472837958221559424moz-txt-link-abbreviated" href="mailto:3333@185.122.205.178" target="_blank">
3333@185.122.205.178</a>.<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<span class="HOEnZb"><font color="#888888"><br>
</font></span></div><span class="HOEnZb"><font color="#888888">
</font></span></span></font></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<pre class="m_4472837958221559424moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="m_4472837958221559424moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="m_4472837958221559424moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - May 22-24 (USA) - <a class="m_4472837958221559424moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - May 8-10, 2017 - <a class="m_4472837958221559424moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
</font></span></div>
</div>

<br>______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div><br></div>