Hi Cyril, 

There is only one listen directive


listen=udp:172.17.203.102:5060 advertise 3.99.99.99:5060 

And that causes that every communication is send out with the advertise ip. 

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. 

Kind regards 

Karsten Horsmann 


Cyril Ramière <cyril.ramiere@gmail.com> schrieb am Mi., 24. Nov. 2021, 08:22:
Hi there,

I'm already using Kamailio as a simple proxy and it worked flawlessly.

This time, I need to have a new setup like this:

[UAC (sip phone)] <--- register & has to deal only with ----> | PUBLIC | [Kamailio + RtpEngine] | PRIVATE | <----> [Asterisk]
Client = 37.100.100.100 (public)
Asterisk = 172.17.200.20 (private)
Kamailio/RtpEngine = 172.17.203.102 (private, advertising 3.99.99.99 public IP)

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.

Kamailio will handle registrations to reduce the load put on the asterisk boxes.

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.

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.

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.

From Kamailio to UAC Sip Phone, it seems OK.
But from Kamailio to Asterisk, the record-route/via headers are set with Kamailio Public IP when it should be the Kamailio private IP.

So, when Asterisk sends a BYE, it tries to send it to the public IP of Kamailio, which is wrong.
There are probably other quirks in the configuration but this one, I can't figure out what's wrong.

I'm attaching a capture file, a log file and my configuration file (some informations are redacted).
I am missing something and sadly I can't figure out what, a little help would be appreciated :) 

Regards

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users