chan_sip and multihomed server

compared to Asterisk 1.4, Callweaver is able to run on machines with multiple interfaces and/or IP addresses.

Attempting to run Asterisk 1.4 on such a machine has led me to delve into Callweaver’s chan_sip.c code and figure out how to make it work.

in sip.conf there are several variables that influence this, localnets=, externip=, bindaddr=, register=

If any localnets= exist, then register= statements that don’t match ( while stun active or externip= is set) , use externip= as the source address in SIP REGISTER messages.

otherwise, if bindaddr set, use that. if bindaddr not set, call opbx_ouraddrfor() to get our src_ip from kernel, based on dst_ip of register=

I think opbx_ouraddrfor() needs to allow user to specify source IP similar to bindaddr= and externip=