set hostname var sooner

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14719 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-09-01 18:04:01 +00:00
parent 97a0a97da4
commit 9bb90c8514
1 changed files with 4 additions and 0 deletions

View File

@ -96,6 +96,10 @@ static void check_ip(void) {
char old_ip6[256] = "";
int ok4 = 1, ok6 = 1;
int mask = 0;
static char hostname[256] = "";
gethostname(hostname, sizeof(hostname));
switch_core_set_variable("hostname", hostname);
switch_find_local_ip(guess_ip4, sizeof(guess_ip4), &mask, AF_INET);
switch_find_local_ip(guess_ip6, sizeof(guess_ip6), NULL, AF_INET6);