[Asterisk-Dev] Multiple IP's For sip.

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Mon Jul 12 11:22:40 MST 2004

On Monday 12 July 2004 11:17, Alberto Fernandez wrote:
> 	When bound to more than one ip address sip doesn't work correctly, If
> the phone is not behind Nat, I'm not a developer but somehow i figured
> out why. I opened ethereal on the clients (X-Lite) Ethernet, since i saw
> that the sip debug in asterisk showed that it was receiving the invite,
> and attempting to answer to it. Now what i discovered was this. Lets say
> the asterisk box has 2 Ethernet and that they have 2 ips. Ethernet 1 has
> ip 1 and Ethernet 2 has ip 2 (I'm Not TOO creative :-P) If i tell a
> phone to connect to ip 2, asterisk receives the invite and replay's
> using Ethernet 1. Now the phone receives the answer trough IP 1. and it
> doesn't register. Is there a way to tell asterisk to answer the requests
> trough the ip it received them, i think this would fix this problem. I
> saw a bug about something similar to this long time ago but no1 did
> anything about it. Or it was for IAX, not sure.

The IP that Asterisk responds with is dependent upon the route, if you have
the bindaddr in sip.conf set to  Otherwise, Asterisk will use the IP
address as set by bindaddr.

Please note that the routines currently are based upon the old 2.0 routing
table.  We do not have code to deal with the new (default in 2.2 and later)
complex routing tables, if you use the complex features (like routing out the
same IP a packet came in on).  However, we're always open to contributions.

See acl.c:ast_ouraddrfor() for the route lookup code (which specifies which IP
address we should use for sending a particular packet).


More information about the asterisk-dev mailing list