<HTML><BODY><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 <thomas.carvello@ives.fr>:<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">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">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></BODY></HTML>