]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add global vars of default ip
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 17 Oct 2007 15:38:57 +0000 (15:38 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 17 Oct 2007 15:38:57 +0000 (15:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5927 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core.c

index a3ee8f0b9b8265f2bc8417f9fd8cdef6c4c5c1a1..f21a2d0757eef5d90d93ea00a7ae38dd398fd449 100644 (file)
@@ -418,6 +418,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(const char *console, switch_cor
        switch_xml_t xml = NULL, cfg = NULL;
        switch_uuid_t uuid;
        memset(&runtime, 0, sizeof(runtime));
+       char guess_ip[256];
 
        switch_set_flag((&runtime), SCF_NO_NEW_SESSIONS);
        runtime.hard_log_level = SWITCH_LOG_DEBUG;
@@ -440,6 +441,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(const char *console, switch_cor
        runtime.flags = flags;
        runtime.sps_total = 30;
 
+       switch_find_local_ip(guess_ip, sizeof(guess_ip), AF_INET);
+       switch_core_set_variable("local_ip_v4", guess_ip);
+       switch_find_local_ip(guess_ip, sizeof(guess_ip), AF_INET6);
+       switch_core_set_variable("local_ip_v6", guess_ip);
+       
+
        if (switch_xml_init(runtime.memory_pool, err) != SWITCH_STATUS_SUCCESS) {
                apr_terminate();
                return SWITCH_STATUS_MEMERR;