tweaks to nat code

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13515 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Brian West 2009-05-30 00:50:30 +00:00
parent dd9bcd3c53
commit ffba850acf
1 changed files with 7 additions and 7 deletions

View File

@ -187,7 +187,8 @@ static switch_status_t switch_nat_add_mapping_pmp(switch_port_t port, switch_nat
response.type == NATPMP_RESPTYPE_UDPPORTMAPPING ? "UDP" : response.type == NATPMP_RESPTYPE_UDPPORTMAPPING ? "UDP" :
(response.type == NATPMP_RESPTYPE_TCPPORTMAPPING ? "TCP" : "UNKNOWN"), (response.type == NATPMP_RESPTYPE_TCPPORTMAPPING ? "TCP" : "UNKNOWN"),
response.pnu.newportmapping.privateport); response.pnu.newportmapping.privateport);
status = SWITCH_STATUS_SUCCESS;
return status; return status;
} }
@ -240,6 +241,7 @@ static switch_status_t switch_nat_del_mapping_pmp(switch_port_t port, switch_nat
response.type == NATPMP_RESPTYPE_UDPPORTMAPPING ? "UDP" : response.type == NATPMP_RESPTYPE_UDPPORTMAPPING ? "UDP" :
(response.type == NATPMP_RESPTYPE_TCPPORTMAPPING ? "TCP" : "UNKNOWN"), (response.type == NATPMP_RESPTYPE_TCPPORTMAPPING ? "TCP" : "UNKNOWN"),
response.pnu.newportmapping.privateport); response.pnu.newportmapping.privateport);
status = SWITCH_STATUS_SUCCESS;
return status; return status;
} }
@ -248,7 +250,6 @@ static switch_status_t switch_nat_del_mapping_upnp(switch_port_t port, switch_na
{ {
switch_status_t status = SWITCH_STATUS_FALSE; switch_status_t status = SWITCH_STATUS_FALSE;
char port_str[16]; char port_str[16];
int r = -1;
sprintf(port_str, "%d", port); sprintf(port_str, "%d", port);
@ -258,11 +259,10 @@ static switch_status_t switch_nat_del_mapping_upnp(switch_port_t port, switch_na
UPNP_DeletePortMapping(nat_globals.urls.controlURL, nat_globals.data.servicetype, port_str, "UDP", 0); 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, "unmapped public port %s protocol %s to localport %s\n", port_str,
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);
(proto == SWITCH_NAT_TCP) ? "TCP" : (proto == SWITCH_NAT_UDP ? "UDP" : "UNKNOWN"), port_str); status = SWITCH_STATUS_SUCCESS;
status = SWITCH_STATUS_SUCCESS;
}
return status; return status;
} }