List Info

Thread: better local ip detection routine in LAN cases




better local ip detection routine in LAN cases
user name
2007-10-26 14:04:53
if you run linphone on a LAN that has no sort of routing set
up, then
the attempt to autodetect the outgoing IP address will fail
miserably
and linphone falls back to just "127.0.0.1" which
is pretty useless.
the attached code uses the POSIX function if_nameindex() to
enumerate
the available interfaces on the machine and then the Linux
ioctl
SIOCGIFADDR to get the ip address associated with the
specified
interface.  if someone knows of a POSIX equivalent to this
ioctl, i'm
all ears ;).  so now linphone defaults to the first
non-loopback
interface that contains a valid ip address in the case of
autodetect
enabled and running on a non-external routable network.

the patch was tested against linphone-1.6.0 but it applies
cleanly to 1.7.1.
-mike

_______________________________________________
Linphone-developers mailing list
Linphone-developersnongnu.org
http://lists.nongnu.org/mailman/listinfo/linphone-de
velopers

  
Re: better local ip detection routine in LAN cases
country flaguser name
France
2007-11-13 08:33:29
Hi,

The devel version of linphone (1.99.x) already has this
feature. It uses 
getifaddrs() to get the interfaces and their associated
addresses.
Thanks anyway !

Simon

Le Friday 26 October 2007 21:04:53 Mike Frysinger, vous avez
écrit :
> if you run linphone on a LAN that has no sort of
routing set up, then
> the attempt to autodetect the outgoing IP address will
fail miserably
> and linphone falls back to just "127.0.0.1"
which is pretty useless.
> the attached code uses the POSIX function
if_nameindex() to enumerate
> the available interfaces on the machine and then the
Linux ioctl
> SIOCGIFADDR to get the ip address associated with the
specified
> interface.  if someone knows of a POSIX equivalent to
this ioctl, i'm
> all ears ;).  so now linphone defaults to the first
non-loopback
> interface that contains a valid ip address in the case
of autodetect
> enabled and running on a non-external routable
network.
>
> the patch was tested against linphone-1.6.0 but it
applies cleanly to
> 1.7.1. -mike




_______________________________________________
Linphone-developers mailing list
Linphone-developersnongnu.org
http://lists.nongnu.org/mailman/listinfo/linphone-de
velopers

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )