From: Anthony Minessale Date: Tue, 1 Sep 2009 18:04:01 +0000 (+0000) Subject: set hostname var sooner X-Git-Tag: v1.0.6~1974 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bb90c85141607cb4d43969a69dc4f385b618b30;p=thirdparty%2Ffreeswitch.git set hostname var sooner git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14719 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- 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);