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

FreeSWITCH SVN gmaruzz at freeswitch.org
Fri Dec 26 05:05:12 PST 2008


Author: gmaruzz
Date: Fri Dec 26 08:05:11 2008
New Revision: 10943

Log:
skypiax: continuing multiline on windows, skype_name and skype_password from config

Modified:
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.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	Fri Dec 26 08:05:11 2008
@@ -680,6 +680,8 @@
       char *X11_display = NULL;
       char *tcp_cli_port = NULL;
       char *tcp_srv_port = NULL;
+      char *skype_user = NULL;
+      char *skype_password = NULL;
 
       uint32_t interface_id = 0, to = 0, max = 0;
 
@@ -703,6 +705,10 @@
           fail_dial_regex = val;
         } else if (!strcasecmp(var, "hold-music")) {
           hold_music = val;
+        } else if (!strcasecmp(var, "skype_user")) {
+          skype_user = val;
+        } else if (!strcasecmp(var, "skype_password")) {
+          skype_password = val;
         } else if (!strcasecmp(var, "tcp_cli_port")) {
           tcp_cli_port = val;
         } else if (!strcasecmp(var, "tcp_srv_port")) {
@@ -716,7 +722,17 @@
         }
 
       }
+      if (!skype_user) {
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
+                          "interface missing REQUIRED param 'skype_user'\n");
+        continue;
+      }
 
+      if (!skype_password) {
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
+                          "interface missing REQUIRED param 'skype_password'\n");
+        continue;
+      }
       if (!X11_display) {
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
                           "interface missing REQUIRED param 'X11_display'\n");
@@ -798,6 +814,8 @@
         //switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port, tcp_cli_port);
         //switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port, tcp_srv_port);
         switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].X11_display, X11_display);
+        switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].skype_user, skype_user);
+        switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].skype_password, skype_password);
         switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].context, context);
         switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].dialplan, dialplan);
 
@@ -806,6 +824,12 @@
                           "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].X11_display=%s\n",
                           interface_id, globals.SKYPIAX_INTERFACES[interface_id].X11_display);
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
+                          "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].skype_user=%s\n",
+                          interface_id, globals.SKYPIAX_INTERFACES[interface_id].skype_user);
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
+                          "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].skype_password=%s\n",
+                          interface_id, globals.SKYPIAX_INTERFACES[interface_id].skype_password);
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
                           "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port=%d\n",
                           interface_id, globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port);
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h	Fri Dec 26 08:05:11 2008
@@ -199,6 +199,8 @@
   FILE *phonebook_writing_fp;
   int skypiax_dir_entry_extension_prefix;
   void *tech_pvt;
+  char skype_user[256];
+  char skype_password[256];
 };
 
 typedef struct skypiax_interface skypiax_interface_t;

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 08:05:11 2008
@@ -16,19 +16,8 @@
 
 
 #ifdef WIN32
-//HWND win32_hInit_MainWindowHandle;
-//HINSTANCE win32_hInit_ProcessHandle;
-//char win32_acInit_WindowClassName[128];
-//UINT win32_uiGlobal_MsgID_SkypeControlAPIAttach;
-//UINT win32_uiGlobal_MsgID_SkypeControlAPIDiscover;
-//HWND win32_hGlobal_SkypeAPIWindowHandle = NULL;
-//DWORD win32_ulGlobal_PromptConsoleMode = 0;
-//HANDLE volatile win32_hGlobal_PromptConsoleHandle = NULL;
 #else /* NOT WIN32 */
 #define SKYPE_X11_BUF_SIZE 512
-//Window skype_win = (Window) - 1;
-//static XErrorHandler old_handler = 0;
-//static int xerror = 0;
 #endif /* WIN32 */
 
 
@@ -505,9 +494,13 @@
 {
 	LPTSTR pszMessage;
 	DWORD dwLastError; 
+	char skypelogin[256];
 
+	memset(skypelogin, '\0', sizeof(skypelogin));
+	sprintf(skypelogin, "/secondary /username:%s /password:%s", p->skype_user, p->skype_password);
 
-	ShellExecute(NULL, "open", "C:\\Program Files\\Skype\\Phone\\Skype.exe", "/secondary /username:skypiax5 /password:ciapalo", ".", SW_SHOWNORMAL);
+
+	ShellExecute(NULL, "open", "C:\\Program Files\\Skype\\Phone\\Skype.exe", skypelogin, ".", SW_SHOWNORMAL);
 
 	dwLastError = GetLastError();
 
@@ -521,7 +514,7 @@
 			(LPTSTR)&pszMessage,
 			0, NULL );
 
-	NOTICA("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA %s\n", SKYPIAX_P_LOG,pszMessage);
+	NOTICA("ShellExecute gave: %s\n", SKYPIAX_P_LOG,pszMessage);
 	LocalFree(pszMessage);
 	return 1;
 



More information about the Freeswitch-branches mailing list