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.