[Freeswitch-trunk] [commit] r12409 - freeswitch/trunk/src/mod/endpoints/mod_sofia

FreeSWITCH SVN anthm at freeswitch.org
Wed Mar 4 10:19:30 PST 2009


Author: anthm
Date: Wed Mar  4 12:19:30 2009
New Revision: 12409

Log:
MODENDP-195

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	Wed Mar  4 12:19:30 2009
@@ -1110,6 +1110,7 @@
 	const char *call_id = NULL;
 	char *route = NULL;
 	char *route_uri = NULL;
+	char *sendto = NULL;
 
 	rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
 
@@ -1171,7 +1172,7 @@
 		const char *invite_contact_params = switch_channel_get_variable(tech_pvt->channel, "sip_invite_contact_params");
 		const char *invite_from_params = switch_channel_get_variable(tech_pvt->channel, "sip_invite_from_params");
 		const char *from_var = switch_channel_get_variable(tech_pvt->channel, "sip_from_uri");
-
+		
 		if (switch_strlen_zero(tech_pvt->dest)) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "URL Error!\n");
 			return SWITCH_STATUS_FALSE;
@@ -1422,6 +1423,10 @@
 		route_uri = switch_core_session_strdup(session, val);
 		route = NULL;
 	}
+	
+	if ((val = switch_channel_get_variable(channel, "sip_network_destination"))) {
+		sendto = switch_core_session_strdup(session, val);
+	}
 
 	if (route_uri) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Setting proxy route to %s\n", route_uri, switch_channel_get_name(channel));
@@ -1436,6 +1441,7 @@
 			   TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)),
 			   TAG_IF(route_uri, NUTAG_PROXY(route_uri)),
 			   TAG_IF(route, SIPTAG_ROUTE_STR(route)),
+			   TAG_IF(!switch_strlen_zero(sendto), NTATAG_DEFAULT_PROXY(sendto)),
 			   SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip),
 			   SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
 			   SOATAG_REUSE_REJECTED(1),



More information about the Freeswitch-trunk mailing list