[Freeswitch-svn] [commit] r13582 - freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia

FreeSWITCH SVN brian at freeswitch.org
Wed Jun 3 12:07:52 PDT 2009


Author: brian
Date: Wed Jun  3 14:07:52 2009
New Revision: 13582

Log:
missed these 

Modified:
   freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia/sofia.c

Modified: freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia/sofia.c	Wed Jun  3 14:07:52 2009
@@ -4482,9 +4482,7 @@
 
 	tech_pvt->remote_ip = switch_core_session_strdup(session, network_ip);
 	tech_pvt->remote_port = network_port;
-	
-	if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && profile->local_network && 
-		!switch_check_network_list_ip(tech_pvt->remote_ip, profile->local_network)) {
+	if (sofia_glue_check_nat(profile, tech_pvt->remote_ip)) {
 		tech_pvt->user_via = switch_core_session_sprintf(session, "SIP/2.0/%s %s;rport",
 														 sofia_glue_transport2str(sofia_glue_url2transport(sip->sip_contact->m_url)),
 														 profile->extsipip);
@@ -4686,9 +4684,7 @@
 				} else {
 					const char *url = NULL;
 					
-					if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && profile->local_network && 
-						!switch_check_network_list_ip(tech_pvt->remote_ip, profile->local_network)) {
-
+					if (sofia_glue_check_nat(profile, tech_pvt->remote_ip)) {
 						url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_public_url : profile->public_url;
 					} else { 
 						url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_url : profile->url;
@@ -4709,11 +4705,8 @@
 			}
 		} else {
 			const char *url = NULL;
-					
-			if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && profile->local_network && 
-				!switch_check_network_list_ip(tech_pvt->remote_ip, profile->local_network)) {
-				
-				url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_public_url : profile->public_url;
+			if (sofia_glue_check_nat(profile, tech_pvt->remote_ip)) {
+			url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_public_url : profile->public_url;
 			} else { 
 				url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_url : profile->url;
 			}			



More information about the Freeswitch-svn mailing list