<div dir="ltr">To resolve such an issue I switched to use IPv6 on internal SIP servers for signaling and IPv4 for RTPmedia.<div><br></div><div>For me works like a charm.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 7, 2020 at 9:58 AM Olle E. Johansson <<a href="mailto:oej@edvina.net">oej@edvina.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">You need to define another listen= without the advertise for communication with internal servers. Either another IP or another port.<div><br></div><div>/O<br><div><br><blockquote type="cite"><div>On 6 Sep 2020, at 17:34, Moshe Katz <<a href="mailto:kohenkatz@gmail.com" target="_blank">kohenkatz@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Hello all,<div><br></div><div>(Note: I previously posted a more detailed version of this question on StackOverflow at <a href="https://stackoverflow.com/q/63760506/829970" target="_blank">https://stackoverflow.com/q/63760506/829970</a> . This version is simplified to fit better in an email.)</div><div><br></div><div>I have Kamailio 5.4.1 (and RTPEngine) running on an internal server with a private IP address 172.31.7.96 and One-to-one NAT to an external IP address. The external IP is 192.0.2.100. (Note: The internal IP addresses are all unedited, but the public IPs have been replaced with TEST-NET-1 and TEST-NET-2 example addresses.) I will eventually be doing transcoding with RTPEngine, but for now this is a simple SIP Proxy.<br></div><div><br></div><div>Kamailio is installed on Ubuntu 18.04 using the DEB packages from <a href="http://dev.kamailio.org/kamailio54" target="_blank">dev.kamailio.org/kamailio54</a> and is using the stock configuration that comes with those packages, except for the following changes:</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:1.6em;padding:12px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:1.30769;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;font-size:13px;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;border-radius:5px"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;vertical-align:baseline;box-sizing:inherit;background-color:transparent;white-space:inherit;border-radius:0px">#!define WITH_NAT
#!define WITH_RTPENGINE
#!define WITH_MYSQL
#!define WITH_AUTH
#!define WITH_IPAUTH

listen=udp:<a href="http://0.0.0.0:5060/" target="_blank">0.0.0.0:5060</a> advertise <a href="http://192.0.2.100:5060/" target="_blank">192.0.2.100:5060</a>

#!define DBURL "mysql://<a href="http://kamailio:REAL_PASSWORD_HERE@127.0.0.1/kamailio" target="_blank">kamailio:REAL_PASSWORD_HERE@127.0.0.1/kamailio</a>"</code></pre></div><div><br></div><div>I have internal SIP servers with private IP addresses in the <a href="http://172.31.7.0/24" target="_blank">172.31.7.0/24</a> range that I want to have send all SIP traffic through the Kamailio server. The internal servers are running a Java SIP client with the `OUTBOUND_PROXY` setting set to 172.31.7.96.</div><div><br></div><div>The problem I have is that the SIP `200 OK` message sent by Kamailio to my SIP server has its `Record-Route` header set to the public IP address `192.0.2.100` instead of the private address `172.31.7.96`. The SIP client therefore tries to send the `ACK` message back to the public address, but it has no route to the public address so the ACK never gets sent.</div><div><br></div><div>How can I configure Kamailio to use the public IP for external traffic but the private IP for communicating with internal machines on the same subnet?</div><div><br></div><div>I tried setting `mhomed=1`, but the machine isn't actually multi-homed so that didn't work.</div><div><br></div><div>I thought of adding a second listen line `<span style="background-color:transparent;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit;font-size:13px">listen=udp:<a href="http://172.31.7.96:5061/" target="_blank">172.31.7.96:5061</a></span>` and having the internal servers talk to port 5061, but that doesn't work because Kamailio uses the 5061 definition for the external side too.</div><div><br></div><div>I see in the docs that it is possible to name the listener lines, but I don't understand how to use those names in a way that would be relevant to my issue.</div><div><br></div><div>Thank you very much for your help,</div><div><br></div><div>Moshe</div></div>
_______________________________________________<br>Kamailio (SER) - Users Mailing List<br><a href="mailto:sr-users@lists.kamailio.org" target="_blank">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></blockquote></div><br></div></div>_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">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/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>