Hello everybody,
i have a problem setting the ‘media_address’-Parameter in ‘chan_pjsip’ endpoint object. Trying to assign the eth0-address to ‘media_address’ fails. Everytime in SDP payload i see ‘127.0.0.1’ in SDP parameters ‘o’ and ‘c’ (only if eth0-address and ‘media_address’ are equal). In case they differ, SDP parameters are modified. When i lookup the endpoint in cmd, then the set ‘media_address’ is shown.
The outgoing endpoint is connected local to a kamailio instance. Used asterisk version is 13.19.0.
What is the hostname of your system? If you add an entry to /etc/hosts with the IP address and hostname and restart Asterisk does it then place the correct IP address into things?
Very interesting, can’t say I’ve seen anyone experience placing 127.0.0.1 into the SDP like that without media_address. I’d suggest filing an issue[1] with all available information.
It figured out, that when i change column ‘ps_aors.contact’ from value ‘sip:127.0.0.1:63605’ to ‘sip:10.1.1.100:63605’ or ‘sip:10.1.1.100:63605’ it accepts for both cases ‘10.1.1.100’ in SDP.
Ah, that explains it. The code uses the interface address that the system tells it will be used to send the message. Since your message was going to 127.0.0.1 the system told it that it would be going out that interface, so it put 127.0.0.1 in the SDP.
Is this the wanted behavior? I test migration from ‘chan_sip’ to ‘chan_pjsip’. In ‘chan_sip’ the ‘media_address’ took effect there in the same scenario.