Revision
16707
Author
anthm
Date
2010-02-19 16:08:10 -0600 (Fri, 19 Feb 2010)

Log Message

avoiding seglock

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (16706 => 16707)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	2010-02-19 18:59:10 UTC (rev 16706)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	2010-02-19 22:08:10 UTC (rev 16707)
@@ -731,7 +731,7 @@
 			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, 
 				   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 */
 					switch_nat_add_mapping(tech_pvt->local_sdp_audio_port, SWITCH_NAT_UDP, &sdp_port, SWITCH_FALSE);
 				} else {
@@ -957,6 +957,8 @@
 
 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));
 }