[Freeswitch-svn] [commit] r8167 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN brian at freeswitch.org
Tue Apr 22 09:13:54 EDT 2008


Author: brian
Date: Tue Apr 22 09:13:54 2008
New Revision: 8167

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c

Log:
fix this properly.

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Tue Apr 22 09:13:54 2008
@@ -1144,15 +1144,17 @@
 						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(stun_ip, ip, sizeof(stun_ip));
 
 						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")) {
-							switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Automatically using IP %s\n", mod_sofia_globals.guess_ip);
-						} else {
+						} else if (strcasecmp(val, "auto")) {
 							switch_port_t port = 0;
-							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);
+							if (sofia_glue_ext_address_lookup(&myip, &port, val, profile->pool) == SWITCH_STATUS_SUCCESS) {
+								ip = myip;
 							} else {
 								switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to get external ip.\n");
 							}



More information about the Freeswitch-svn mailing list