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

FreeSWITCH SVN brian at freeswitch.org
Mon Jun 8 16:26:30 PDT 2009


Author: brian
Date: Mon Jun  8 18:26:30 2009
New Revision: 13704

Log:
 don't print misleading info when nat_type isn't set on auto_nat

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

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	Mon Jun  8 18:26:30 2009
@@ -761,7 +761,7 @@
 									use_timer ? "timer, " : ""
 									);
 
-	if (sofia_test_pflag(profile, PFLAG_AUTO_NAT)) {
+	if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_core_get_variable("nat_type")) {
 		if (switch_nat_add_mapping(profile->sip_port, SWITCH_NAT_UDP, NULL) == SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Created UDP nat mapping for %s port %d\n", profile->name, profile->sip_port);
 		}
@@ -951,7 +951,7 @@
 		switch_event_fire(&s_event);
 	}
 
-	if (sofia_test_pflag(profile, PFLAG_AUTO_NAT)) {
+	if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_core_get_variable("nat_type")) {
 		if (switch_nat_del_mapping(profile->sip_port, SWITCH_NAT_UDP) == SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deleted UDP nat mapping for %s port %d\n", profile->name, profile->sip_port);
 		}



More information about the Freeswitch-trunk mailing list