<div dir="auto"><div>Hi Cyril, </div><div dir="auto"><br></div><div dir="auto">There is only one listen directive</div><div dir="auto"><br></div><div dir="auto"><br><p dir="ltr">listen<span style="color:#ff6600">=</span>udp:<span style="color:#ff6600">172.17</span><span style="color:#ff6600">.203</span><span style="color:#ff6600">.102</span>:<span style="color:#ff6600">5060</span> advertise <span style="color:#ff6600">3.99</span><span style="color:#ff6600">.99</span><span style="color:#ff6600">.99</span>:5060 </p><p dir="ltr">And that causes that every communication is send out with the advertise ip. </p><p dir="ltr">I personally would add an second listen directive without advertising and an different port. Then use force sendsocket to make sure that you use the right socket for sending. You can use of the new name directive to label the sockets with useful names in that place. </p><p dir="ltr">Kind regards </p><p dir="ltr">Karsten Horsmann </p><p dir="ltr"><br></p><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">Cyril Ramière <<a href="mailto:cyril.ramiere@gmail.com">cyril.ramiere@gmail.com</a>> schrieb am Mi., 24. Nov. 2021, 08:22:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi there,<div><br></div><div>I'm already using Kamailio as a simple proxy and it worked flawlessly.</div><div><br></div><div>This time, I need to have a new setup like this:</div><div><br></div><div>[UAC (sip phone)] <--- register & has to deal only with ----> | PUBLIC | [Kamailio + RtpEngine<font face="arial, sans-serif">] | PRIVATE | <----> [Asterisk]</font></div><div><font face="arial, sans-serif">Client = 37.100.100.100 (public)</font></div><div><font face="arial, sans-serif">Asterisk = 172.17.200.20 (private)</font></div><div><font face="arial, sans-serif">Kamailio/RtpEngine = 172.17.203.102 (private, advertising 3.99.99.99 public IP)</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Kamailio and RtpEngine will behave as a SBC/B2BUA, the client will deal only with kamailio using public access (internet), and asterisk will handle the calls but stays 100% private behind kamailio.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Kamailio will handle registrations to reduce the load put on the asterisk boxes.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">The setup is running on AWS, my Kamailio has 1 Private IP address tied to 1 Public IP address (an Elastic public IP) so, no multi-homing, one network interface.</font></div><div><font face="arial, sans-serif"><br></font></div><div>I made a "simple" work in progress configuration, the registration is working as a PoC, and my calls are *almost* working but with some nonsense.</div><div><br></div><div>My Main issue is that when my UAC (SIP phone) make a call, to let's say +1000, the call enters kamailio, then kamailio handle the invite, trigger rtpEngine, but the IP addresses in Record-Route and Via headers are wrong.</div><div><br></div><div>From Kamailio to UAC Sip Phone, it seems OK.</div><div>But from Kamailio to Asterisk, the record-route/via headers are set with Kamailio Public IP when it should be the Kamailio private IP.</div><div><br></div><div>So, when Asterisk sends a BYE, it tries to send it to the public IP of Kamailio, which is wrong.</div><div>There are probably other quirks in the configuration but this one, I can't figure out what's wrong.</div><div><br></div><div>I'm attaching a capture file, a log file and my configuration file (some informations are redacted).</div><div>I am missing something and sadly I can't figure out what, a little help would be appreciated :) </div><div><br></div><div>Regards</div><div><br></div></div>
__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
  * <a href="mailto:sr-users@lists.kamailio.org" target="_blank" rel="noreferrer">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
  * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div></div>