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

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


Author: gmaruzz
Date: Fri Dec 26 08:40:28 2008
New Revision: 10944

Log:
skypiax: continuing multiline on windows, api_connected when currentuserhandle == skype_user

Modified:
   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/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:40:28 2008
@@ -141,6 +141,7 @@
 char win32_acInit_WindowClassName[128];
 UINT win32_uiGlobal_MsgID_SkypeControlAPIAttach;
 UINT win32_uiGlobal_MsgID_SkypeControlAPIDiscover;
+int api_connected;
   switch_file_t *fdesc[2];
 };
 

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:40:28 2008
@@ -607,11 +607,13 @@
     if (uiMessage == p->AsteriskHandlesAst.win32_uiGlobal_MsgID_SkypeControlAPIAttach) {
       switch (ulParam) {
       case SKYPECONTROLAPI_ATTACH_SUCCESS:
+	if(!p->AsteriskHandlesAst.api_connected){
         NOTICA("\n\n\tConnected to Skype API!\n", SKYPIAX_P_LOG);
         p->AsteriskHandlesAst.win32_hGlobal_SkypeAPIWindowHandle = (HWND) uiParam;
         switch_sleep(5000);
         p->AsteriskHandlesAst.win32_hGlobal_SkypeAPIWindowHandle =
           p->AsteriskHandlesAst.win32_hGlobal_SkypeAPIWindowHandle;
+	}
         break;
       case SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION:
         WARNINGA
@@ -627,9 +629,11 @@
       case SKYPECONTROLAPI_ATTACH_API_AVAILABLE:
         DEBUGA_SKYPE("Skype API available\n", SKYPIAX_P_LOG);
 
+	if(!p->AsteriskHandlesAst.api_connected){
         SendMessage
             (HWND_BROADCAST, p->AsteriskHandlesAst.win32_uiGlobal_MsgID_SkypeControlAPIDiscover,
              (WPARAM) p->AsteriskHandlesAst.win32_hInit_MainWindowHandle, 0);
+	}
         break;
       default:
         WARNINGA("GOT AN UNKNOWN SKYPE WINDOWS MSG\n", SKYPIAX_P_LOG);
@@ -1202,6 +1206,20 @@
             p->interface_state = SKYPIAX_STATE_DOWN;
           }
         }
+          if (!strcasecmp(messaggio, "CURRENTUSERHANDLE") ) {
+          strncpy(obj, where, sizeof(obj) - 1);
+
+          where = strsep(stringp, " ");
+
+          strncpy(id, where, sizeof(id) - 1);
+
+
+          if (!strcasecmp(id, p->skype_user)) {
+		  p->AsteriskHandlesAst.api_connected = 1;
+            DEBUGA_SKYPE ("Skype MSG: messaggio: %s, currentuserhandle: %s, cuh: %s, skype_user: %s!\n", SKYPIAX_P_LOG, messaggio, obj, id, p->skype_user);
+          }
+          }
+
         if (!strcasecmp(messaggio, "CALL")) {
 
           strncpy(obj, where, sizeof(obj) - 1);
@@ -1225,6 +1243,7 @@
               ("Skype MSG: messaggio: %s, obj: %s, id: %s, prop: %s, value: %s,where: %s!\n",
                SKYPIAX_P_LOG, messaggio, obj, id, prop, value, where ? where : "NULL");
 
+
           if (!strcasecmp(prop, "PARTNER_HANDLE")) {
             strncpy(p->callid_number, value, sizeof(p->callid_number) - 1);
             WARNINGA



More information about the Freeswitch-branches mailing list