[Freeswitch-users] Auto-detecting Local IP when no gateway set
Brian Foster
bdfoster at davri.com
Fri Aug 16 05:46:02 MSD 2013
#!/bin/bash
# interface2ip.sh
/sbin/ifconfig $1 | grep "inet addr" | awk -F: '{print $2}' | awk '{print
$1}'
----
./interface2ip.sh eth0
Returns ip assigned to eth0
Thank you,
Brian Foster
Project Manager/Owner's Rep.
Davri Investments, Inc.
O: 317-787-2686 x2102
M: 317-600-9753
E: bdfoster at davri.com
Indianapolis, Indiana
Sent from a mobile device.
Thanks for all the suggestions, As suggested by Steven, I have raised a
Jira wishlist - http://jira.freeswitch.org/browse/FS-5707
Anthony, could you please elaborate (or redirect me to the wiki page) on
your config directive suggestion? Where do I set this in Freeswitch, and
how do I make it run on config reload?
Thanks!
On Fri, Aug 16, 2013 at 5:15 AM, Anthony Minessale <
anthony.minessale at gmail.com> wrote:
> No such functionality, meanwhile you could use the #exec config directive
> similar to SSI in apache to manually run a shell command every time the
> config is loaded to call a command that prints the ip.
> On Aug 15, 2013 2:08 PM, "Steven Ayre" <steveayre at gmail.com> wrote:
>
>> Personally I think allowing something like <param name="sip-ip"
>> value="interface:eth0"/> to pick up the primary IP of that interface might
>> work best.
>>
>> Anthm, can you clarify if FS already has any such functionality? Or time
>> for a wishlist Jira?
>>
>> Doing so could work alongside auto-restart=true and therefore pick up IP
>> changes such as when using DHCP.
>>
>>
>>
>> On 15 August 2013 20:00, Steven Ayre <steveayre at gmail.com> wrote:
>>
>>> I was going to suggest this too, but if it's on a LAN I'm guessing there
>>> won't be a server and serving it from httpd on the localhost would only see
>>> 127.0.0.1
>>>
>>> ...although you could lookup the current IP of the LAN interface from a
>>> script on the local webserver.
>>>
>>> -Steve
>>>
>>>
>>> On 15 August 2013 13:14, Raymond Chandler <intralanman at freeswitch.org>wrote:
>>>
>>>> Alternatively, you could use xml_curl to serve your configs so that you
>>>> don't actually need local_ip_v4 as you can figure it out based on the IP
>>>> hitting the web server. Doing that will allow you to set the IP in all of
>>>> the configs that need it using functionality that already exists in
>>>> FreeSWITCH today.
>>>>
>>>> -Ray
>>>>
>>>>
>>>> _________________________________________________________________________
>>>> 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
>
>
_________________________________________________________________________
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/ea9bf55d/attachment-0001.html
Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users
mailing list