]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix stun lookup, Mike or Tony please review.
authorBrian West <brian@freeswitch.org>
Tue, 22 Apr 2008 03:16:14 +0000 (03:16 +0000)
committerBrian West <brian@freeswitch.org>
Tue, 22 Apr 2008 03:16:14 +0000 (03:16 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8164 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index a772e5c84cb5f87bdf38136da47b64b9d530e2f3..aa5497b714a4eebce3852f90aeba636febb0e468 100644 (file)
@@ -1144,17 +1144,15 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                profile->sipip = switch_core_strdup(profile->pool, ip);
                                        } else if (!strcasecmp(var, "ext-sip-ip")) {
                                                char *ip = mod_sofia_globals.guess_ip;
-                                               char stun_ip[50] = "";
-                                               char *myip = stun_ip;
 
-                                               switch_copy_string(myip, ip, sizeof(myip));
-                                               
                                                if (!strcasecmp(val, "0.0.0.0")) {
                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invald IP 0.0.0.0 replaced with %s\n", mod_sofia_globals.guess_ip);
-                                               } else if (strcasecmp(val, "auto")) {
+                                               } else if (!strcasecmp(val, "auto")) {
+                                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Automatically using IP %s\n", mod_sofia_globals.guess_ip);
+                                               } else {
                                                        switch_port_t port = 0;
-                                                       if (sofia_glue_ext_address_lookup(&myip, &port, val, profile->pool) == SWITCH_STATUS_SUCCESS) {
-                                                               ip = myip;
+                                                       if (sofia_glue_ext_address_lookup(&ip, &port, val, profile->pool) == SWITCH_STATUS_SUCCESS) {
+                                                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "STUN lookup sucessful using %s:%d\n", ip, port);
                                                        } else {
                                                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to get external ip.\n");
                                                        }