mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-23 11:36:09 +00:00
more tweaks
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13517 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
eaf470bd92
commit
7e23aad405
@ -181,13 +181,15 @@ static switch_status_t switch_nat_add_mapping_pmp(switch_port_t port, switch_nat
|
|||||||
select(FD_SETSIZE, &fds, NULL, NULL, &timeout);
|
select(FD_SETSIZE, &fds, NULL, NULL, &timeout);
|
||||||
r = readnatpmpresponseorretry(&nat_globals.natpmp, &response);
|
r = readnatpmpresponseorretry(&nat_globals.natpmp, &response);
|
||||||
} while(r == NATPMP_TRYAGAIN);
|
} while(r == NATPMP_TRYAGAIN);
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mapped public port %hu protocol %s to localport %hu\n",
|
if (r == 0) {
|
||||||
response.pnu.newportmapping.mappedpublicport,
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mapped public port %hu protocol %s to localport %hu\n",
|
||||||
response.type == NATPMP_RESPTYPE_UDPPORTMAPPING ? "UDP" :
|
response.pnu.newportmapping.mappedpublicport,
|
||||||
(response.type == NATPMP_RESPTYPE_TCPPORTMAPPING ? "TCP" : "UNKNOWN"),
|
response.type == NATPMP_RESPTYPE_UDPPORTMAPPING ? "UDP" :
|
||||||
response.pnu.newportmapping.privateport);
|
(response.type == NATPMP_RESPTYPE_TCPPORTMAPPING ? "TCP" : "UNKNOWN"),
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
response.pnu.newportmapping.privateport);
|
||||||
|
status = SWITCH_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -211,6 +213,7 @@ static switch_status_t switch_nat_add_mapping_upnp(switch_port_t port, switch_na
|
|||||||
(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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,13 +238,15 @@ static switch_status_t switch_nat_del_mapping_pmp(switch_port_t port, switch_nat
|
|||||||
select(FD_SETSIZE, &fds, NULL, NULL, &timeout);
|
select(FD_SETSIZE, &fds, NULL, NULL, &timeout);
|
||||||
r = readnatpmpresponseorretry(&nat_globals.natpmp, &response);
|
r = readnatpmpresponseorretry(&nat_globals.natpmp, &response);
|
||||||
} while(r == NATPMP_TRYAGAIN);
|
} while(r == NATPMP_TRYAGAIN);
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "unmapped public port %hu protocol %s to localport %hu\n",
|
if (r == 0) {
|
||||||
response.pnu.newportmapping.mappedpublicport,
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "unmapped public port %hu protocol %s to localport %hu\n",
|
||||||
response.type == NATPMP_RESPTYPE_UDPPORTMAPPING ? "UDP" :
|
response.pnu.newportmapping.mappedpublicport,
|
||||||
(response.type == NATPMP_RESPTYPE_TCPPORTMAPPING ? "TCP" : "UNKNOWN"),
|
response.type == NATPMP_RESPTYPE_UDPPORTMAPPING ? "UDP" :
|
||||||
response.pnu.newportmapping.privateport);
|
(response.type == NATPMP_RESPTYPE_TCPPORTMAPPING ? "TCP" : "UNKNOWN"),
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
response.pnu.newportmapping.privateport);
|
||||||
|
status = SWITCH_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user