[Freeswitch-svn] [commit] r10283 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax

Freeswitch SVN gmaruzz at freeswitch.org
Fri Nov 7 11:42:14 PST 2008


Author: gmaruzz
Date: Fri Nov  7 04:10:56 2008
New Revision: 10283

Modified:
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c

Log:
skypiax: starts thread for Skype API read/write

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c	Fri Nov  7 04:10:56 2008
@@ -2862,7 +2862,8 @@
   DEBUGA_SKYPE("OUT destroyed disp\n", SKYPIAX_P_LOG);
   usleep(1000);
 }
-void *do_skype_thread(void *data)
+//void *do_skype_thread(void *data)
+static void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t *thread, void *data)
 {
 
 //  struct skypiax_pvt *p;
@@ -2976,7 +2977,7 @@
         if (i < 20) {           /* last fragment */
           write(AsteriskHandlesAst->fdesc[1], b, strlen(b) + 1);
           //write(AsteriskHandlesAst->fdesc[1], "\0", 1);
-          DEBUGA_SKYPE("SKYPE pipewrite: |||%s|||len=%d serial=%ld\n", SKYPIAX_P_LOG, b,
+          DEBUGA_SKYPE("SKYPE pipewrite: |||%s|||len=%d serial=%ld\n\n\n", SKYPIAX_P_LOG, b,
                        strlen(b) + 1, an_event.xclient.serial);
           //usleep(1000);
           memset(buffer, '\0', 17000);
@@ -3156,6 +3157,18 @@
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "span_id=%d SKYPIAX_CONFIGS[span_id].context=%s\n", span_id, SKYPIAX_CONFIGS[span_id].context);
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "span_id=%d SKYPIAX_CONFIGS[span_id].dialplan=%s\n", span_id, SKYPIAX_CONFIGS[span_id].dialplan);
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "STARTING span_id=%d\n", span_id);
+if(1)
+{
+    switch_thread_t *thread;
+    switch_threadattr_t *thd_attr = NULL;
+
+    switch_threadattr_create(&thd_attr, module_pool);
+    switch_threadattr_detach_set(thd_attr, 1);
+    switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
+    switch_thread_create(&thread, thd_attr, do_skype_thread, &SKYPIAX_CONFIGS[span_id], module_pool);
+}
+
+
 			} else {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "span id %d is higher than SKYPIAX_MAX_INTERFACES (%d)\n", span_id, SKYPIAX_MAX_INTERFACES);
 				continue;
@@ -3175,7 +3188,9 @@
 
 	switch_xml_free(xml);
 
-	do_skype_thread(NULL);
+	//do_skype_thread(NULL);
+
+//static void unicall_thread_launch(uc_t *uc)
 
 	return SWITCH_STATUS_SUCCESS;
 }



More information about the Freeswitch-svn mailing list