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

FreeSWITCH SVN gmaruzz at freeswitch.org
Wed Dec 10 08:37:57 PST 2008


Author: gmaruzz
Date: Wed Dec 10 11:37:56 2008
New Revision: 10697

Log:
skypiax: joins thread on linux too

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

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	Wed Dec 10 11:37:56 2008
@@ -34,10 +34,10 @@
 switch_core_session_t *global_session = NULL;
 #ifdef WIN32
 HANDLE win32_hGlobal_ThreadShutdownEvent;
-switch_thread_t *do_skype_thread_thread;
 HWND win32_hInit_MainWindowHandle;
 #endif /* WIN32 */
 switch_thread_t *skypiax_do_controldev_thread_thread;
+switch_thread_t *do_skype_thread_thread;
 /*************************************************/
 /*************************************************/
 /*************************************************/
@@ -894,13 +894,26 @@
   if (SendMessage (win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the do_skype_thread die
       ERRORA("WHY FALSE HERE? %d\n", SKYPIAX_P_LOG, GetLastError());
   }
+#else
+  XEvent e;
+  Atom atom1 = XInternAtom(p->AsteriskHandlesAst.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False);
+  memset(&e, 0, sizeof(e));
+  e.xclient.type = ClientMessage;
+  e.xclient.message_type = atom1;   /*  leading message */
+  e.xclient.display = p->AsteriskHandlesAst.disp;
+  e.xclient.window = p->AsteriskHandlesAst.skype_win;
+  e.xclient.format = 8;
+
+
+    XSendEvent(p->AsteriskHandlesAst.disp, p->AsteriskHandlesAst.win, False, 0, &e);
+  XSync(p->AsteriskHandlesAst.disp, False);
 #endif
   while (x) {
 	x--;
     switch_yield(20000);
   }
-  switch_thread_join(&status, do_skype_thread_thread);
   switch_thread_join(&status, skypiax_do_controldev_thread_thread);
+  switch_thread_join(&status, do_skype_thread_thread);
   return SWITCH_STATUS_SUCCESS;
 }
 



More information about the Freeswitch-branches mailing list