SIP source IP


I was wondering how Asterisk determines what source IP to use on SIP packets. I have a host which has two IP addresses on it, x.x.x.32, and x.x.x.33. If I point a SIP client at x.x.x.33, it seems from doing a packet dump that the responses from asterisk are going out on x.x.x.32. Unfortunately, because the SIP client is behind a NAT router, the responses never get to it.

If I set bindaddr in sip.conf to the .33 address, then as you would expect everything works fine. The problem is, I don’t want to set this, as I’m hoping to set up heartbeat from the Linux HA project to failover the .33 address between two nodes. If I used bindaddr I would have to start asterisk at the same time as failing over the IP, which would increase the time required for the failover (admittedly not by much, but it’s still something I want to avoid).

I’ve tried setting externip in sip.conf in the hope that it would cause Asterisk to send packets from the correct address, but this doesn’t seem to make any difference.

Any help would be much appreciated!