<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Thank you for you answer.</p>
<p>We have tried to change the local port for Bob, but it doesnt
change anything. And the contact value in 200 OK message has no
influence in this case.</p>
<p>In fact, we have made a further investigation regarding the
socket selection <b>and read the code. </b>The issue seems to be
located in the RR module and the loose_route() function.<br>
</p>
In the after_loose() function in loose.c, the function
set_force_socket() is called only if a DOUBLE route is mentioned in
the route set of the ACK message <br>
<br>
But when both users are using 5066 as proxy port, we get only ONE
route for the proxy in the route set (and to us it is OK). In this
case, we get a trace:<br>
<br>
"No next URI found"<br>
<br>
and the code exits. Later in the message processing, when t_relay()
is called, the forward_request() selects the first socket defined in
our configuration instead. <br>
<br>
At this point, we can't presume what socket we be select. We believe
that it is a software bug and that after_loose() should force the
send_socket even though we have only one route in the route set. We
also checked the 5.1 code and there is no change in this module that
would alter this behavior.<br>
<p> </p>
<p>Are we missing something? <br>
</p>
<p>Thank you for you time,</p>
Thomas<br>
<br>
<div class="moz-cite-prefix">Le 26/01/2018 à 15:43, Евгений Голей a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:1516977812.978133560@f402.i.mail.ru">
<span id="result_box" lang="en"><span>Hi<br>
<br>
Could it be because of Bob happend to use 5060 as local port?</span><br>
<span>Yes, the port and the address in the ACK are indicated by
what the value in Contact was in reply 200 Ok.</span> <span>Look
at the message 200 Ok</span></span><br>
<br>
<br>
<blockquote style="border-left:1px solid #0857A6; margin:10px;
padding:0 0 0 10px;"> Четверг, 25 января 2018, 13:00 +03:00 от
Thomas Carvello <a class="moz-txt-link-rfc2396E" href="mailto:thomas.carvello@ives.fr"><thomas.carvello@ives.fr></a>:<br>
<br>
<div id="">
<div class="js-helper js-readmsg-msg">
<style type="text/css"></style>
<div> <base target="_self" href="https://e.mail.ru/">
<div id="style_15168744520000000704_BODY">
<div class="class_1517002402"> <br>
<div
class="moz-forward-container_mailru_css_attribute_postfix">
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>
</div>
</div>
<div>_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org"
moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
<a
href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div>
<base target="_self" href="https://e.mail.ru/"> </div>
</div>
</div>
</blockquote>
<br>
<br>
Best <br>
Evgeniy<br>
</blockquote>
<br>
</body>
</html>