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

FreeSWITCH SVN gmaruzz at freeswitch.org
Fri Dec 26 03:29:02 PST 2008


Author: gmaruzz
Date: Fri Dec 26 06:29:01 2008
New Revision: 10941

Log:
skypiax: continuing multiline on windows, skype_present now got pointer to channel instance

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

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	Fri Dec 26 06:29:01 2008
@@ -522,7 +522,7 @@
 	}
 } 
 
-int LaunchSkype2(void)
+int LaunchSkype(void)
 {
 	PROCESS_INFORMATION pi;
 	STARTUPINFO si = {0};
@@ -538,9 +538,15 @@
 	ZeroMemory( &pi, sizeof(pi) );
 
 
-	ShellExecute(NULL, "open", "C:\\Program Files\\Skype\\Phone\\Skype.exe", "/secondary /username:skypiax3 /password:xxx", ".", SW_SHOWNORMAL);
-	switch_sleep(1000000);
-	ShellExecute(NULL, "open", "C:\\Program Files\\Skype\\Phone\\Skype.exe", "/secondary /username:skypiax4 /password:xxx", ".", SW_SHOWNORMAL);
+	//ShellExecute(NULL, "open", "C:\\Program Files\\Skype\\Phone\\Skype.exe", "/secondary /username:skypiax1 /password:ciapalo", ".", SW_SHOWNORMAL);
+	//switch_sleep(1000000);
+	//ShellExecute(NULL, "open", "C:\\Program Files\\Skype\\Phone\\Skype.exe", "/secondary /username:skypiax2 /password:ciapalo", ".", SW_SHOWNORMAL);
+	//switch_sleep(1000000);
+	//ShellExecute(NULL, "open", "C:\\Program Files\\Skype\\Phone\\Skype.exe", "/secondary /username:skypiax3 /password:ciapalo", ".", SW_SHOWNORMAL);
+	//switch_sleep(1000000);
+	//ShellExecute(NULL, "open", "C:\\Program Files\\Skype\\Phone\\Skype.exe", "/secondary /username:skypiax4 /password:ciapalo", ".", SW_SHOWNORMAL);
+	//switch_sleep(1000000);
+	ShellExecute(NULL, "open", "C:\\Program Files\\Skype\\Phone\\Skype.exe", "/secondary /username:skypiax5 /password:ciapalo", ".", SW_SHOWNORMAL);
 
 #if 0
 
@@ -586,71 +592,6 @@
 	return 1;
 
 }
-
-int LaunchSkype(void)
-{
-	PROCESS_INFORMATION pi;
-	STARTUPINFO si = {0};
-	struct skypiax_interface *p = NULL;
-	int ret=1;
-	int times=0;
-	LPTSTR pszMessage;
-	DWORD dwLastError; 
-
-	ZeroMemory( &si, sizeof(si) );
-	si.cb = sizeof(si);
-	ZeroMemory( &pi, sizeof(pi) );
-
-
-	ShellExecute(NULL, "open", "C:\\Program Files\\Skype\\Phone\\Skype.exe", "/secondary /username:skypiax5 /password:xxx", ".", SW_SHOWNORMAL);
-
-#if 0
-	CreateProcess( "C:\\Program Files\\Skype\\Phone\\Skype.exe",
-			"/secondary /username:skypiax5 /password:xxx", // Command line.
-			NULL, // Process handle not inheritable.
-			NULL, // Thread handle not inheritable.
-			FALSE, // Set handle inheritance to FALSE.
-			0, // No creation flags.
-			NULL, // Use parent's environment block.
-			NULL, // Use parent's starting directory.
-			&si, // Pointer to STARTUPINFO structure.
-			&pi  // Pointer to PROCESS_INFORMATION structure.
-		     );
-#endif
-
-	dwLastError = GetLastError();
-
-	FormatMessage(
-			FORMAT_MESSAGE_ALLOCATE_BUFFER | 
-			FORMAT_MESSAGE_FROM_SYSTEM |
-			FORMAT_MESSAGE_IGNORE_INSERTS,
-			NULL,
-			dwLastError,
-			MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-			(LPTSTR)&pszMessage,
-			0, NULL );
-
-	// Display the error message and exit the process
-
-
-
-	NOTICA("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA %s\n", SKYPIAX_P_LOG,pszMessage);
-	LocalFree(pszMessage);
-#if 0
-	switch_sleep(10000000);
-
-	while(ret){
-		ret = EnumWindows(&EnumWindowsProc, pi.dwThreadId);
-		switch_sleep(10000);
-		times++;
-		if (times == 1000)
-			break;
-	}
-	NOTICA("HWND=%p\n", SKYPIAX_P_LOG, win32_hGlobal_SkypeAPIWindowHandle);
-#endif
-	return 1;
-
-}
 /*******************************************************/
 #endif //NOTDEF
 
@@ -706,7 +647,14 @@
 
   lReturnCode = 0;
   fIssueDefProc = 0;
+	  p = ( struct skypiax_interface *)GetWindowLong(hWindow, GWL_USERDATA);
   switch (uiMessage) {
+  case WM_CREATE:
+    NOTICA("got CREATE\n", SKYPIAX_P_LOG);
+	  p=( struct skypiax_interface *)((LPCREATESTRUCT)ulParam)->lpCreateParams;
+	  SetWindowLong(hWindow, GWL_USERDATA, (LONG)p);
+    NOTICA("got CREATE\n", SKYPIAX_P_LOG);
+    break;
   case WM_DESTROY:
     NOTICA("got DESTROY\n", SKYPIAX_P_LOG);
     win32_hInit_MainWindowHandle = NULL;
@@ -725,7 +673,7 @@
 
       howmany = strlen(msg_from_skype) + 1;
       switch_file_write(win32_AsteriskHandlesSkype->fdesc[1], msg_from_skype, &howmany);
-      //NOTICA("From Skype API: %s\n", SKYPIAX_P_LOG, (const char *) poCopyData->lpData);
+      NOTICA("From Skype API: %s\n", SKYPIAX_P_LOG, (const char *) poCopyData->lpData);
       lReturnCode = 1;
     }
     break;
@@ -818,12 +766,12 @@
   CloseHandle(win32_hInit_ProcessHandle), win32_hInit_ProcessHandle = NULL;
 }
 
-int win32_Initialize_CreateMainWindow(void)
+int win32_Initialize_CreateMainWindow(struct skypiax_interface *p)
 {
   win32_hInit_MainWindowHandle =
     CreateWindowEx(WS_EX_APPWINDOW | WS_EX_WINDOWEDGE, win32_acInit_WindowClassName, "",
                    WS_BORDER | WS_SYSMENU | WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT,
-                   128, 128, NULL, 0, win32_hInit_ProcessHandle, 0);
+                   128, 128, NULL, 0, win32_hInit_ProcessHandle, p);
   return (win32_hInit_MainWindowHandle != NULL ? 1 : 0);
 }
 
@@ -864,13 +812,11 @@
 
   LaunchSkype();
 	switch_sleep(1000000);
-  LaunchSkype2();
-	switch_sleep(1000000);
 
   if (win32_uiGlobal_MsgID_SkypeControlAPIAttach != 0
       && win32_uiGlobal_MsgID_SkypeControlAPIDiscover != 0) {
     if (win32_Initialize_CreateWindowClass()) {
-      if (win32_Initialize_CreateMainWindow()) {
+      if (win32_Initialize_CreateMainWindow(p)) {
 #if 1
         if (SendMessage
             (HWND_BROADCAST, win32_uiGlobal_MsgID_SkypeControlAPIDiscover,



More information about the Freeswitch-branches mailing list