<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-forward-container"> Hello,
<p>i have an issue with my Kamailio 4.1.9 configuration.</p>
<p>This configuration is multi-homed, we have<b> two network</b>
interfaces, one on a private network and on the public Internet.
Kamailio is configured to listen on port 5060 and 5066 on both
interfaces. We register two users Alice and Bob on the public
Internet using port 5066. Both users are behind a NAT and we
capture the SIP exchange on the proxy server.</p>
<p>We have set the parameter mhomed=1<br>
</p>
<p>When Alice calls Bob, we have <br>
</p>
<pre>Alice Proxy Bob</pre>
<pre>src=5063 dst=5066
INVITE ------------------>
src=5066
------ INVITE ---------------> dst=5060
dst=5066
<------- 200 OK -------------- src=5060
dst=5063
<------- 200 OK --------- src=5066
src=5063 dst=5066
-------- ACK ----------->
<b>src=5060 (blocked by NAT)</b>
------ ACK-----x dst=5060
</pre>
<p>The ACK packet gets relayed with the wrong source port. Then
the NAT rejects the packet and the call cannot be established.</p>
<p>For some reason, when Bob calls Alice, the call is correctly
established. Could it be because Bob happend to use 5060 as
local port?<br>
</p>
<p>Also, if we set nhomed=0 it works BUT we are not sure that
multi homed is handled correctly.</p>
I was wondering if you have encounter this issue before?<br>
<p> I have investigated the code for selection socket and what is
the logic of this selection ?</p>
<p><i><b>How does kamailo knows that it should choose 5066 as src
port if the user is registered using port 5066 instead of
5066?</b><br>
</i></p>
<p>Thank you for your time.</p>
<p>Thomas<br>
</p>
<p><br>
</p>
<p><br>
</p>
</div>
</body>
</html>