[Freeswitch-svn] [commit] r13515 - freeswitch/trunk/src

FreeSWITCH SVN brian at freeswitch.org
Fri May 29 17:50:30 PDT 2009


Author: brian
Date: Fri May 29 19:50:30 2009
New Revision: 13515

Log:
 tweaks to nat code 

Modified:
   freeswitch/trunk/src/switch_nat.c

Modified: freeswitch/trunk/src/switch_nat.c
==============================================================================
--- freeswitch/trunk/src/switch_nat.c	(original)
+++ freeswitch/trunk/src/switch_nat.c	Fri May 29 19:50:30 2009
@@ -187,7 +187,8 @@
 					  response.type == NATPMP_RESPTYPE_UDPPORTMAPPING ? "UDP" :
 					  (response.type == NATPMP_RESPTYPE_TCPPORTMAPPING ? "TCP" : "UNKNOWN"),
 					  response.pnu.newportmapping.privateport);
-	
+	status = SWITCH_STATUS_SUCCESS;
+
 	return status;
 }
 
@@ -240,6 +241,7 @@
 					  response.type == NATPMP_RESPTYPE_UDPPORTMAPPING ? "UDP" :
 					  (response.type == NATPMP_RESPTYPE_TCPPORTMAPPING ? "TCP" : "UNKNOWN"),
 					  response.pnu.newportmapping.privateport);
+	status = SWITCH_STATUS_SUCCESS;
 
 	return status;
 }
@@ -248,7 +250,6 @@
 {
 	switch_status_t status = SWITCH_STATUS_FALSE;
 	char port_str[16];
-	int r = -1;
 
 	sprintf(port_str, "%d", port);
 
@@ -258,11 +259,10 @@
 		UPNP_DeletePortMapping(nat_globals.urls.controlURL, nat_globals.data.servicetype, port_str, "UDP", 0);
 	}
 
-	if (r == 0) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mapped public port %s protocol %s to localport %s\n", port_str,
-						  (proto == SWITCH_NAT_TCP) ? "TCP" : (proto == SWITCH_NAT_UDP ? "UDP" : "UNKNOWN"), port_str);
-						  status = SWITCH_STATUS_SUCCESS;
-	}
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "unmapped public port %s protocol %s to localport %s\n", port_str,
+					  (proto == SWITCH_NAT_TCP) ? "TCP" : (proto == SWITCH_NAT_UDP ? "UDP" : "UNKNOWN"), port_str);
+	status = SWITCH_STATUS_SUCCESS;
+
 	return status;
 }
 



More information about the Freeswitch-svn mailing list