<div dir="ltr"><div>Hello again,</div><div><br></div><div>Indeed this issue does not manifest at all. I'm awfully sorry for the false alarm, and on release day no less!</div><div><br></div><div>The problem was there was a lingering DNAT rule in iptables, which would translate port 5066 to port 5060. The deployment script injected this as it was carried over from our legacy platform.</div><div><br></div><div>Of course, I kept banging my head against the wall here because sngrep wouldn't show the DNAT's effect as it captures traffic from the NIC directly: it would show a REGISTER arriving on 5066, but the dport was masqueraded before being handed over to kamailio. Similarly for the outgoing INVITE.</div><div><br></div><div>NAT is wrong in so many ways... :-)</div><div><br></div><div>BR,</div><div>George</div><div class="gmail_extra"><br><div class="gmail_quote">On 11 December 2017 at 18:17, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>Hello,</p>
<p>I did a quick test and all looks fine, ports are set in via and
record-route, in my config I have:</p>
<p> record_route();<br>
<br>
$fs="udp:<a href="http://127.0.0.1:5080" target="_blank">127.0.0.1:5080</a>";<br>
$du = <a class="gmail-m_5571352520475869339moz-txt-link-rfc2396E">"sip:127.0.0.1:9"</a>;<br>
t_relay();<br>
exit;<br>
</p>
<p>Then sending an OPTIONS resulted in the trace shown below.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<p>U 2017/12/11 17:14:47.108430 <a href="http://127.0.0.1:56729" target="_blank">127.0.0.1:56729</a> -> <a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a><br>
OPTIONS <a class="gmail-m_5571352520475869339moz-txt-link-freetext">sip:test@127.0.0.1</a> SIP/2.0.<br>
Via: SIP/2.0/UDP
192.168.178.84:62516;branch=<wbr>z9hG4bK.3aaddf68;rport;alias.<br>
From: <a class="gmail-m_5571352520475869339moz-txt-link-freetext">sip:sipsak@192.168.178.84:<wbr>62516;tag=16d1c24</a>.<br>
To: <a class="gmail-m_5571352520475869339moz-txt-link-freetext">sip:test@127.0.0.1</a>.<br>
Call-ID: <a class="gmail-m_5571352520475869339moz-txt-link-abbreviated" href="mailto:23927844@192.168.178.84" target="_blank">23927844@192.168.178.84</a>.<br>
CSeq: 1 OPTIONS.<br>
Contact: <a class="gmail-m_5571352520475869339moz-txt-link-freetext">sip:sipsak@192.168.178.84:<wbr>62516</a>.<br>
Content-Length: 0.<br>
Max-Forwards: 70.<br>
User-Agent: sipsak 0.9.7pre.<br>
Accept: text/plain.<br>
.<br>
<br>
<br>
U 2017/12/11 17:14:51.010251 <a href="http://127.0.0.1:5080" target="_blank">127.0.0.1:5080</a> -> <a href="http://127.0.0.1:9" target="_blank">127.0.0.1:9</a><br>
OPTIONS <a class="gmail-m_5571352520475869339moz-txt-link-freetext">sip:test@127.0.0.1</a> SIP/2.0.<br>
Record-Route: <a class="gmail-m_5571352520475869339moz-txt-link-rfc2396E"><sip:127.0.0.1:5080;r2=on;lr></a>.<br>
Record-Route: <a class="gmail-m_5571352520475869339moz-txt-link-rfc2396E"><sip:127.0.0.1;r2=on;lr></a>.<br>
Via: SIP/2.0/UDP
127.0.0.1:5080;branch=<wbr>z9hG4bK61bd.<wbr>b2882fea15c488761489f8ef588efb<wbr>e1.0.<br>
Via: SIP/2.0/UDP
192.168.178.84:62516;received=<wbr>127.0.0.1;branch=z9hG4bK.<wbr>3aaddf68;rport=56729;alias.<br>
From: <a class="gmail-m_5571352520475869339moz-txt-link-freetext">sip:sipsak@192.168.178.84:<wbr>62516;tag=16d1c24</a>.<br>
To: <a class="gmail-m_5571352520475869339moz-txt-link-freetext">sip:test@127.0.0.1</a>.<br>
Call-ID: <a class="gmail-m_5571352520475869339moz-txt-link-abbreviated" href="mailto:23927844@192.168.178.84" target="_blank">23927844@192.168.178.84</a>.<br>
CSeq: 1 OPTIONS.<br>
Contact: <a class="gmail-m_5571352520475869339moz-txt-link-freetext">sip:sipsak@192.168.178.84:<wbr>62516</a>.<br>
Content-Length: 0.<br>
Max-Forwards: 69.<br>
User-Agent: sipsak 0.9.7pre.<br>
Accept: text/plain.<br>
.<br>
</p><div><div class="gmail-h5">
<br>
<div class="gmail-m_5571352520475869339moz-cite-prefix">On 11.12.17 16:37, George
Diamantopoulos wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="gmail-h5">
<div dir="ltr">
<div>
<div>
<div>Hello all,<br>
<br>
</div>
I have the following issue in my configuration, tested with
5.2.0-rc1 so far:<br>
<br>
</div>
At some point, I set the $fs pseudovariable to force a request
to be relayed through a specific socket. Although this is
honoured by kamailio (i.e. the request does indeed leave the
kamailio host from the respective socket), the port number is
not added to the Via and RR headers. As a result, all replies
to the request, as well as all subsequent requests from the
other SIP UA are relayed to the default port, 5060. Here's an
example:</div>
<div><br>
</div>
<div>SIP UAC to kamailio:</div>
<div style="margin-left:40px">INVITE <a href="http://192.168.1.1:5060" target="_blank">192.168.1.1:5060</a>
---> <a href="http://192.168.1.254:5060" target="_blank">192.168.1.254:5060</a></div>
<div>Kamailio to UAS ($fs is set):</div>
<div style="margin-left:40px">INVITE <a href="http://2.2.2.2:5066" target="_blank">2.2.2.2:5066</a>
---> <a href="http://3.3.3.3:5060" target="_blank">3.3.3.3:5060</a></div>
<div style="margin-left:40px">Topmost Via in request relayed by
kamailio is:</div>
<div style="margin-left:80px">SIP/2.0/UDP
2.2.2.2;branch=aaaaaaaaaaaaaa <wbr> <- port 5066 is not added<br>
</div>
<div style="margin-left:40px">Topmost RR in request relayed by
kamailio is:</div>
<div style="margin-left:80px"><a class="gmail-m_5571352520475869339moz-txt-link-rfc2396E"><sip:2.2.2.2;r2=on;lr;did=<wbr>bbbbbbb;nat=yes></a>
<- port 5066 is not added</div>
RESULT: Reply from UAS is sent to <a href="http://2.2.2.2:5060" target="_blank">2.2.2.2:5060</a><br>
<div>
<div>
<div><br>
</div>
Is this behaviour valid? Am I missing anything? Kamailio is
configured to listen on both sockets on IP 2.2.2.2, namely:
a) udp:<a href="http://2.2.2.2:5060" target="_blank">2.2.2.2:5060</a>
and b) <a href="http://2.2.2.2:5066" target="_blank">2.2.2.2:5066</a>.
Thanks.</div>
<div><br>
</div>
<div>BR,</div>
<div>George<br>
</div>
</div>
</div>
<br>
<fieldset class="gmail-m_5571352520475869339mimeAttachmentHeader"></fieldset>
<br>
</div></div><pre>______________________________<wbr>_________________
Kamailio (SER) - Users Mailing List
<a class="gmail-m_5571352520475869339moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a class="gmail-m_5571352520475869339moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><span class="gmail-HOEnZb"><font color="#888888">
</font></span></pre><span class="gmail-HOEnZb"><font color="#888888">
</font></span></blockquote><span class="gmail-HOEnZb"><font color="#888888">
<br>
<pre class="gmail-m_5571352520475869339moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="gmail-m_5571352520475869339moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="gmail-m_5571352520475869339moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - <a class="gmail-m_5571352520475869339moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="gmail-m_5571352520475869339moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
</font></span></div>
</blockquote></div><br></div></div>