Revision
16685
Author
gmaruzz
Date
2010-02-18 05:03:12 -0600 (Thu, 18 Feb 2010)

Log Message

skypiax: added channel variabls 'skype_user', set to the skypename of the interface, and 'initial_skype_user', set to the skypename that originally received the call and then transferred it to another skypename

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c (16684 => 16685)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c	2010-02-18 02:35:08 UTC (rev 16684)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c	2010-02-18 11:03:12 UTC (rev 16685)
@@ -447,6 +447,7 @@
 
 	channel = switch_core_session_get_channel(session);
 	switch_assert(channel != NULL);
+	switch_channel_set_variable(channel, "skype_user", tech_pvt->skype_user);
 	//ERRORA("%s CHANNEL INIT\n", SKYPIAX_P_LOG, tech_pvt->name);
 	switch_set_flag(tech_pvt, TFLAG_IO);
 
@@ -1099,6 +1100,7 @@
 				tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
 				*tech_pvt->session_uuid_str = '\0';
 				*tech_pvt->skype_call_id = '\0';
+				*tech_pvt->initial_skype_user = '\0';
 				switch_mutex_unlock(globals.mutex);
 
 				//ERRORA("LET'S WAIT\n", SKYPIAX_P_LOG);
@@ -1855,6 +1857,8 @@
 	}
 	if (channel) {
 		switch_channel_mark_answered(channel);
+		switch_channel_set_variable(channel, "skype_user", tech_pvt->skype_user);
+		switch_channel_set_variable(channel, "initial_skype_user", tech_pvt->initial_skype_user);
 	}
 
 	DEBUGA_SKYPE("new_inbound_channel\n", SKYPIAX_P_LOG);
@@ -2336,7 +2340,8 @@
 		if (available_skypiax_interface) {
 			/* there is a skypiax interface idle, let's transfer the call to it */
 
-			//FIXME write a timestamp here
+			switch_copy_string(available_skypiax_interface->initial_skype_user, tech_pvt->skype_user, sizeof(tech_pvt->skype_user) - 1);
+
 			gettimeofday(&tech_pvt->transfer_time, NULL);
 			switch_copy_string(tech_pvt->skype_transfer_call_id, id, sizeof(tech_pvt->skype_transfer_call_id) - 1);
 

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h (16684 => 16685)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h	2010-02-18 02:35:08 UTC (rev 16684)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h	2010-02-18 11:03:12 UTC (rev 16685)
@@ -260,6 +260,7 @@
 	FILE *phonebook_writing_fp;
 	int skypiax_dir_entry_extension_prefix;
 	char skype_user[256];
+	char initial_skype_user[256];
 	char skype_password[256];
 	char destination[256];
 	struct timeval answer_time;