[Asterisk-Dev] IAX, UDP source address

ml+asterisk.dev at oxymium.net ml+asterisk.dev at oxymium.net
Mon Jul 18 07:39:04 MST 2005


Hi,

I've tried to set up 2 servers with asterisk: each one with it's own address and a 'common' address (using ucarp to assign this 'common' adress to one server).
Each serveur has a default gateway related to it's own address, something like:
Server A: IP 1.2.3.2, netmask 255.255.255.0 default gateway 1.2.3.1
Server B: IP 1.2.3.3, netmask 255.255.255.0 default gateway 1.2.3.1

'Common IP': 1.2.4.2 netmask 255.255.255.0 gateway 1.2.4.1

I've added all things to route depending from destination address and it works for tcp stuff (if I telnet to 1.2.3.2, response came from 1.2.3.2 and if I telnet 1.2.4.2, response come from 1.2.4.2).

But with asterisk, if my IAX client (kiax) contact 'common' IP (1.2.4.2), reponse comme from server address (from 1.2.3.2 if this common IP is on server A, 1.2.3.3 if it is on server B).

I've made some searches and it seems recvmsg() doesn't specify to address; asterisk have a single socket binded to 0.0.0.0 and don't specify source address when sending replies, so the source address depend on the default gateway network.

Is it possible to fix that ? May be by specifying multiple bind address (with associated netsocket) but I'm not sure we can set source address even with that....

Manuel



More information about the asterisk-dev mailing list