[Freeswitch-branches] [commit] r11737 - in freeswitch/branches/gmaruzz/mod_skypiax: . asterisk

FreeSWITCH SVN gmaruzz at freeswitch.org
Tue Feb 10 15:46:42 PST 2009


Author: gmaruzz
Date: Tue Feb 10 17:46:42 2009
New Revision: 11737

Log:
skypiax: * wait for all interfaces to be connected to Skype client AND identified the correct client on cygwin

Modified:
   freeswitch/branches/gmaruzz/mod_skypiax/asterisk/chan_skypiax.c
   freeswitch/branches/gmaruzz/mod_skypiax/skypiax_protocol.c

Modified: freeswitch/branches/gmaruzz/mod_skypiax/asterisk/chan_skypiax.c
==============================================================================
--- freeswitch/branches/gmaruzz/mod_skypiax/asterisk/chan_skypiax.c	(original)
+++ freeswitch/branches/gmaruzz/mod_skypiax/asterisk/chan_skypiax.c	Tue Feb 10 17:46:42 2009
@@ -783,6 +783,7 @@
   struct ast_config *cfg;
   struct skypiax_pvt *tmp;
   struct skypiax_pvt *p = NULL;
+  struct skypiax_pvt *p2 = NULL;
 #ifdef ASTERISK_VERSION_1_6
   struct ast_flags config_flags = { 0 };
 #endif /* ASTERISK_VERSION_1_6 */
@@ -857,6 +858,28 @@
     ERRORA("skypiax_restart_monitor failed, BAD\n", SKYPIAX_P_LOG);
     return -1;
   }
+  /* go through the interfaces list (skypiax_iflist) WITHOUT locking */
+  p = skypiax_iflist;
+  while (p) {
+	  int i;
+	  /* for each interface in list */
+	  p2 = p->next;
+	  NOTICA("STARTING interface %s, please be patient\n", SKYPIAX_P_LOG, p->name);
+	  i=0;
+	  while (p->SkypiaxHandles.api_connected == 0 && running && i < 60000) { // 60sec FIXME
+		  usleep(1000);
+		  i++;
+	  }
+	  if (p->SkypiaxHandles.api_connected){
+		  NOTICA("Interface %s is now STARTED\n", SKYPIAX_P_LOG, p->name);
+	  } else {
+		  ERRORA("Interface %s FAILED to start\n", SKYPIAX_P_LOG, p->name);
+		  running = 0;
+		  return -1;
+	  }
+	  /* next one, please */
+	  p = p2;
+  }
   return 0;
 }
 
@@ -1832,7 +1855,6 @@
 
 
 #endif
-        NOTICA("Here\n", SKYPIAX_P_LOG);
 	return 0;
 }
 int outbound_channel_answered(private_t *p) {

Modified: freeswitch/branches/gmaruzz/mod_skypiax/skypiax_protocol.c
==============================================================================
--- freeswitch/branches/gmaruzz/mod_skypiax/skypiax_protocol.c	(original)
+++ freeswitch/branches/gmaruzz/mod_skypiax/skypiax_protocol.c	Tue Feb 10 17:46:42 2009
@@ -82,7 +82,7 @@
         WARNINGA("Skype MSG without spaces: %s\n", SKYPIAX_P_LOG, message);
       }
       if (!strcasecmp(message, "ERROR")) {
-        WARNINGA("Skype got ERROR: |||%s|||\n", SKYPIAX_P_LOG, message);
+        DEBUGA_SKYPE("Skype got ERROR: |||%s|||\n", SKYPIAX_P_LOG, message);
         tech_pvt->skype_callflow = CALLFLOW_STATUS_FINISHED;
         DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG);
         tech_pvt->skype_call_id[0] = '\0';
@@ -1062,7 +1062,7 @@
              (WPARAM) tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, 0) != 0) {
           tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle =
             tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle;
-          while (1) {
+          while (running) {
             MSG oMessage;
             if (!running)
               break;



More information about the Freeswitch-branches mailing list