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

Freeswitch SVN anthm at freeswitch.org
Tue Dec 4 08:48:21 EST 2007


Author: anthm
Date: Tue Dec  4 08:48:20 2007
New Revision: 6489

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

Log:
update

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Tue Dec  4 08:48:20 2007
@@ -1452,6 +1452,8 @@
 	data = switch_core_session_strdup(nsession, outbound_profile->destination_number);
 	profile_name = data;
 
+	nchannel = switch_core_session_get_channel(nsession);
+
 	if (!strncasecmp(profile_name, "gateway", 7)) {
 		char *gw;
 		sofia_gateway_t *gateway_ptr = NULL;
@@ -1485,7 +1487,9 @@
 		}
 
 		profile = gateway_ptr->profile;
-
+		tech_pvt->gateway_name = switch_core_session_strdup(nsession, gateway_ptr->name);
+		switch_channel_set_variable(nchannel, "sip_gateway_name", gateway_ptr->name);
+		
 		if (!switch_test_flag(gateway_ptr, REG_FLAG_CALLERID)) {
 			tech_pvt->gateway_from_str = switch_core_session_strdup(nsession, gateway_ptr->register_from);
 		}
@@ -1559,7 +1563,7 @@
 
 	sofia_glue_attach_private(nsession, profile, tech_pvt, dest);
 	
-	nchannel = switch_core_session_get_channel(nsession);
+
 	if (tech_pvt->local_url) {
 		switch_channel_set_variable(nchannel, "sip_local_url", tech_pvt->local_url);
 	}

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	Tue Dec  4 08:48:20 2007
@@ -318,6 +318,7 @@
 	char *call_id;
 	char *invite_contact;
 	char *local_url;
+	char *gateway_name;
 	unsigned long rm_rate;
 	switch_payload_t pt;
 	switch_mutex_t *flag_mutex;

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Tue Dec  4 08:48:20 2007
@@ -111,6 +111,9 @@
 					tech_pvt->call_id = switch_core_session_strdup(session, sip->sip_call_id->i_id);
 					switch_channel_set_variable(channel, "sip_call_id", tech_pvt->call_id);
 				}
+				if (tech_pvt->gateway_name) {
+					gateway = sofia_reg_find_gateway(tech_pvt->gateway_name);
+				}
 			} else {
 				/* too late */
 				return;



More information about the Freeswitch-svn mailing list