提交 b28dafb6 authored 作者: Andrew Thompson's avatar Andrew Thompson

set the hostname core variable in switch_core_init too


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14726 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 547bc567
...@@ -1160,6 +1160,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc ...@@ -1160,6 +1160,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
char *dir_path; char *dir_path;
int mask = 0; int mask = 0;
struct in_addr in; struct in_addr in;
char hostname[256] = "";
memset(&runtime, 0, sizeof(runtime)); memset(&runtime, 0, sizeof(runtime));
...@@ -1219,6 +1220,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc ...@@ -1219,6 +1220,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
runtime.console = stdout; 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_find_local_ip(guess_ip, sizeof(guess_ip), &mask, AF_INET);
switch_core_set_variable("local_ip_v4", guess_ip); switch_core_set_variable("local_ip_v4", guess_ip);
in.s_addr = mask; in.s_addr = mask;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论