diff --git a/src/switch_core.c b/src/switch_core.c index 5a2b17d79f..6485e823bb 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -1160,6 +1160,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc char *dir_path; int mask = 0; struct in_addr in; + char hostname[256] = ""; memset(&runtime, 0, sizeof(runtime)); @@ -1219,6 +1220,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc runtime.console = stdout; } + gethostname(hostname, sizeof(hostname)); + switch_core_set_variable("hostname", hostname); + switch_find_local_ip(guess_ip, sizeof(guess_ip), &mask, AF_INET); switch_core_set_variable("local_ip_v4", guess_ip); in.s_addr = mask;