[Freeswitch-users] how can i get the server ip/hostname where freeswirch is installed?

Steven Ayre steveayre at gmail.com
Mon Jun 9 18:20:16 MSD 2014


The 'hostname' api call will return the hostname of the system.

For the IP you can check the global variable 'local_ip_v4' and
'local_ip_v6' - these are the ones autodetected by FreeSWITCH as its best
guess on its main IP. It's probably the address that would be used to reach
the default gateway.

To get any other IPs you could also use the 'sofia status' api to get any
other IPs you have bound profiles to.

For both security and performance and to avoid having a fork bomb, I'd
avoid running system commands such as ifconfig.



On 8 June 2014 16:55, Snabel Kabiya <snabel at lexifone.com> wrote:

> Hi,
>
> how can i get the server ip/hostname where freeswirch is installed?
>
> i want to get the ip/hostname and use it in lua script.
>
> Thanks,
> Snabel
>
> _________________________________________________________________________
> 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/20140609/5d67e7fd/attachment-0001.html 


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