Tested on e5b8066e1e0f4a69a5d1161dd75aea67014314b5 commit
Can you provide some useful description? Kamailio has many advertise related parts, we cannot guess what you do from a title with a dozen of words. If you want help, you need to provide useful details.
Moreover, there is some template that you can fill, you can ignore/delete it, but at least paste here what parameters you set, what you tested and it is not working as you expect.
Testbox config used default config with enabled roles ``` #!KAMAILIO #!define WITH_DEBUG #!define WITH_MYSQL #!define WITH_AUTH #!define WITH_USRLOCDB #!define WITH_PRESENCE #!define WITH_PSTN ``` Kamailio behind NAT and bounded to NIC using ``` listen=udp:eth0:5060 advertise 199.180.30.245:15060 ``` SIP device creates call to PSTN number +18009998877
Please look at wireshark PCAP file packet `11` You can find `Record-Route` with private address, advertise keyword not take effect ``` Record-Route: sip:172.17.0.2;lr ``` Kamailio debug loo attachet too [kamailio-log.txt](https://github.com/kamailio/kamailio/files/1212335/kamailio-log.txt)
[sip.zip](https://github.com/kamailio/kamailio/files/1212338/sip.zip)
If you replace eth0 with ip, any change?
What is the output for `kamcmd core.sockets_list`?
When used NIC for bound ``` [root@6d5120ba12c3 /]# kamcmd core.sockets_list { socket: { proto: udp address: 172.17.0.2 port: 5060 mcast: no mhomed: no } } ``` When user IP address for bound ``` { socket: { proto: udp address: 172.17.0.2 port: 5060 mcast: no mhomed: no } } ```
When used IP address for bound, then `advertise` keyword works correctly.
As workaround may be used such definition - works correctly ``` advertised_address="199.180.30.245" advertised_port=15060 listen=udp:eth0:5060 ```
`advertised_address` is only for Via headers.
There seem to be two similar rpc commands to list the sockets, the one that gives more details is `corex.list_sockets`, the one from core is likely from the `ser`.
Anyhow, I will look into the code, likely a new listen structure is created in the case interface name is provided and advertise value is lost.
In case of bound to IP ``` sh-4.2# kamcmd corex.list_sockets { PROTO: udp NAME: 172.17.0.2 ADDRLIST: { ADDR: 172.17.0.2 } PORT: 5060 MCAST: no MHOMED: no ADVERTISE: 199.180.30.245 } ``` In case of bound to NIC ``` sh-4.2# kamcmd corex.list_sockets { PROTO: udp NAME: 172.17.0.2 ADDRLIST: { ADDR: 172.17.0.2 } PORT: 5060 MCAST: no MHOMED: no ADVERTISE: - } ```
Can you try with latest master branch or the patch referenced above?
Hello Daniel @miconda I tested commit 97d8ebc966aba71efb3a964e71b00736db51401b, issue is resolved.
Closed #1209.