From 9bb90c85141607cb4d43969a69dc4f385b618b30 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 1 Sep 2009 18:04:01 +0000 Subject: [PATCH] set hostname var sooner git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14719 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/switch_core.c b/src/switch_core.c index 7ba64ec773..5a2b17d79f 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -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);