]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
skypiax: added channel variabls 'skype_user', set to the skypename of the interface...
authorGiovanni Maruzzelli <gmaruzz@gmail.com>
Thu, 18 Feb 2010 11:03:12 +0000 (11:03 +0000)
committerGiovanni Maruzzelli <gmaruzz@gmail.com>
Thu, 18 Feb 2010 11:03:12 +0000 (11:03 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16685 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_skypiax/mod_skypiax.c
src/mod/endpoints/mod_skypiax/skypiax.h

index 11f4943d04b68432edb2dd7291ee2bd577344d89..8c24479ded64584cbae623e9e3d0bf6b941d5350 100644 (file)
@@ -447,6 +447,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
 
        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 @@ static void *SWITCH_THREAD_FUNC skypiax_signaling_thread_func(switch_thread_t *
                                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 @@ int new_inbound_channel(private_t * tech_pvt)
        }
        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 @@ int skypiax_transfer(private_t * tech_pvt, char *id, char *value)
                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);
 
index a9c6916da5a363a3e895640132367d52313e7297..fc70c7a3ee59207dc0880096794f73ae02972d75 100644 (file)
@@ -260,6 +260,7 @@ struct private_object {
        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;