]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
set hostname var sooner
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 1 Sep 2009 18:04:01 +0000 (18:04 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 1 Sep 2009 18:04:01 +0000 (18:04 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14719 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core.c

index 7ba64ec773016c9250d00165d9eaeaa66b06d084..5a2b17d79fe873772422b764de8035cc3b55a229 100644 (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);