I have tried setting externaddr, but I’m not behind a NAT so it seems to have no effect. I am on a public server with many assigned IP addresses, and asterisk seems to pick one to use for the Via and Contact headers, but I would like to specify which one to use in these headers and not have it just pick one.
I still want asterisk to listen on all the IPs for incoming calls, but just want to override what Via and Contact say for outgoing.
Anyone know what I should put into sip.conf to make this happen?
If you have many IP addresses, why are you not big enough to have a proper multihomed IP configuration (border gateway protocol and autonomous system numbers)? IP was not designed to work in an environment where it matters which source address is used.
However, I thought that chan_sip, at least tried to deduce the interface that would actually be used to send the request.
The chan_sip module does not support this. The chan_pjsip module MAY support this, but another individual has reported despite having multiple transports the wrong IP is still chosen. This use case isn’t something most people do.