[Freeswitch-users] Auto-detecting Local IP when no gateway set

Steven Ayre steveayre at gmail.com
Thu Aug 15 15:12:01 MSD 2013


The entire point is to auto-detect which IP is used for Internet access,
which is obviously impossible without a default gateway. The reason for
that is in the frequent case where a machine may have multiple IP
addresses. So you are going to have to set local_ip_v4 explicitly.

As far as a generic config goes - why not have common configuration files
and handle all the machine-specific stuff in vars.xml, then any
machine-specific stuff is in a single file which'll make it easier to
manage.

If you want to auto-detect the static IP, then modify the init.d script to
first run a script that picks up the current IP and updates vars.xml. That
would need to be done before freeswitch is started.

Thinking about the best way to handle this long term though...
Perhaps you could file a wishlist Jira that allows you to set local_ip_v4
by an interface name. FreeSWITCH should be able to lookup the primary IP of
an interface pretty easily.



On 15 August 2013 03:12, Siri MM <sirimmfs at gmail.com> wrote:

> Hi Jeff,
>
> Couple of reasons why I dont want to specify IP address explicitly:
> 1. Customer is using multiple devices with freeswitch on each, and my
> strategy is to provide a generically configured freeswitch, which would
> work on all
> 2. Customer might at any point in time change the static IP address of
> devices, or decide to use DHCP!
>
>
> On Thu, Aug 15, 2013 at 12:00 PM, Jeff Leung <jleung at v10networks.ca>wrote:
>
>> Why can't you just specify a static IP address instead? Specifying a
>> static IP address sure does make life a heck a lot easier that way.
>>
>>
>> On Wed, Aug 14, 2013 at 5:26 PM, Siri MM <sirimmfs at gmail.com> wrote:
>>
>>>  Hi All,
>>>
>>> I am using freeswitch without local_ip_v4 explicitly set, i.e, I am
>>> dependant on freeswitch auto-detecting the local IP address.
>>>
>>> From the code, what I understand is, in order to determine the local IP
>>> address,  freeswitch tries to ‘connect()’ using a DGRAM socket with
>>> BROADCAST option set.
>>>
>>> The problem that I am having is, my customer is working in a Local LAN,
>>> and is not very keen on setting the interface gateway. Without gateway set,
>>> connect() returns 'Network unreachable' error.
>>>
>>> Is there any way I could workaround this problem? (apart from setting
>>> local_ip_v4) Also, any other issues forseen if gateway isn't set ont he
>>> interface?
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> 
>>> 
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://wiki.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>>
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> 
>> 
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130815/db1ead44/attachment.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list