mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-25 03:10:39 +00:00
avoiding seglock
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16707 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
d4b1da5c67
commit
9afed23312
@ -731,7 +731,7 @@ switch_status_t sofia_glue_tech_choose_port(private_object_t *tech_pvt, int forc
|
|||||||
if (lookup_rtpip == use_ip) {
|
if (lookup_rtpip == use_ip) {
|
||||||
/* sofia_glue_ext_address_lookup didn't return any error, but the return IP is the same as the original one,
|
/* sofia_glue_ext_address_lookup didn't return any error, but the return IP is the same as the original one,
|
||||||
which means no lookup was necessary. Check if NAT is detected */
|
which means no lookup was necessary. Check if NAT is detected */
|
||||||
if (sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) {
|
if (!zstr(tech_pvt->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) {
|
||||||
/* Yes, map the port through switch_nat */
|
/* Yes, map the port through switch_nat */
|
||||||
switch_nat_add_mapping(tech_pvt->local_sdp_audio_port, SWITCH_NAT_UDP, &sdp_port, SWITCH_FALSE);
|
switch_nat_add_mapping(tech_pvt->local_sdp_audio_port, SWITCH_NAT_UDP, &sdp_port, SWITCH_FALSE);
|
||||||
} else {
|
} else {
|
||||||
@ -957,6 +957,8 @@ char *sofia_glue_strip_uri(const char *str)
|
|||||||
|
|
||||||
int sofia_glue_check_nat(sofia_profile_t *profile, const char *network_ip)
|
int sofia_glue_check_nat(sofia_profile_t *profile, const char *network_ip)
|
||||||
{
|
{
|
||||||
|
switch_assert(network_ip);
|
||||||
|
|
||||||
return (profile->extsipip && !switch_check_network_list_ip(network_ip, profile->local_network));
|
return (profile->extsipip && !switch_check_network_list_ip(network_ip, profile->local_network));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user