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

FreeSWITCH SVN gmaruzz at freeswitch.org
Tue Dec 9 03:39:00 PST 2008


Author: gmaruzz
Date: Tue Dec  9 06:39:00 2008
New Revision: 10674

Log:
skypiax: less warnings on windows

Modified:
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c
   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	Tue Dec  9 06:39:00 2008
@@ -1,6 +1,5 @@
 #include "skypiax.h"
 
-
 SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load);
 SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown);
 //SWITCH_MODULE_RUNTIME_FUNCTION(mod_skypiax_runtime);
@@ -540,16 +539,16 @@
 {
   struct skypiax_interface *p = obj;
   int res;
+  int forever=1;
 
   DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG);
 
   DEBUGA_SKYPE("In skypiax_do_controldev_thread: started, p=%p\n", SKYPIAX_P_LOG,
                (void *) p);
 
-  while (1) {
+  while (forever) {
     switch_sleep(1000);
     res = skypiax_skype_read(p);
-#if 1
     //if (res == CALLFLOW_INCOMING_HANGUP && p->interface_state != SKYPIAX_STATE_DOWN) 
     if (res == CALLFLOW_INCOMING_HANGUP) {
       switch_core_session_t *session = NULL;
@@ -566,10 +565,7 @@
 
       switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
       DEBUGA_SKYPE("after channel_on_hangup\n", SKYPIAX_P_LOG);
-
-      //DEBUGA_SKYPE("set state to CS_HANGUP\n", SKYPIAX_P_LOG);
     }
-#endif
   }
 
   //if (option_debug > 10) {
@@ -737,6 +733,11 @@
       }
       if (interface_id && interface_id < SKYPIAX_MAX_INTERFACES) {
         struct skypiax_interface newconf;
+          switch_thread_t *do_skype_thread_thread;
+          switch_threadattr_t *do_skype_thd_attr = NULL;
+          switch_thread_t *skypiax_do_controldev_thread_thread;
+          switch_threadattr_t *skypiax_do_controldev_thread_thd_attr = NULL;
+
         memset(&newconf, '\0', sizeof(newconf));
         SKYPIAX_INTERFACES[interface_id] = newconf;
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
@@ -765,28 +766,20 @@
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
                           "STARTING interface_id=%d\n", interface_id);
 
-        if (1) {
-          switch_thread_t *thread;
-          switch_threadattr_t *thd_attr = NULL;
-
-          switch_threadattr_create(&thd_attr, skypiax_module_pool);
-          switch_threadattr_detach_set(thd_attr, 1);
-          switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
-          switch_thread_create(&thread, thd_attr, do_skype_thread,
+
+          switch_threadattr_create(&do_skype_thd_attr, skypiax_module_pool);
+          switch_threadattr_detach_set(do_skype_thd_attr, 1);
+          switch_threadattr_stacksize_set(do_skype_thd_attr, SWITCH_THREAD_STACKSIZE);
+          switch_thread_create(&do_skype_thread_thread, do_skype_thd_attr, do_skype_thread,
                                &SKYPIAX_INTERFACES[interface_id], skypiax_module_pool);
-        }
 
         switch_sleep(100000);
-        if (1) {
-          switch_thread_t *thread;
-          switch_threadattr_t *thd_attr = NULL;
-
-          switch_threadattr_create(&thd_attr, skypiax_module_pool);
-          switch_threadattr_detach_set(thd_attr, 1);
-          switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
-          switch_thread_create(&thread, thd_attr, skypiax_do_controldev_thread,
+
+          switch_threadattr_create(&skypiax_do_controldev_thread_thd_attr, skypiax_module_pool);
+          switch_threadattr_detach_set(skypiax_do_controldev_thread_thd_attr, 1);
+          switch_threadattr_stacksize_set(skypiax_do_controldev_thread_thd_attr, SWITCH_THREAD_STACKSIZE);
+          switch_thread_create(&skypiax_do_controldev_thread_thread, skypiax_do_controldev_thread_thd_attr, skypiax_do_controldev_thread,
                                &SKYPIAX_INTERFACES[interface_id], skypiax_module_pool);
-        }
 
         switch_sleep(1000000);
 
@@ -832,7 +825,7 @@
 
 SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load)
 {
-  struct skypiax_interface *p = NULL;
+  //struct skypiax_interface *p = NULL;
 
   skypiax_module_pool = pool;
 

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	Tue Dec  9 06:39:00 2008
@@ -1,4 +1,6 @@
 #include "skypiax.h"
+
+
 extern switch_memory_pool_t *skypiax_module_pool;
 extern int option_debug;
 extern switch_core_session_t *global_session;
@@ -16,8 +18,14 @@
   struct skypiax_interface *p = obj;
   short in[GG];
   short out[GG / 2];
-  int s, fd, len;
+  int s, len;
+#ifdef WIN32
+  int sin_size;
+  unsigned int fd;
+#else
   unsigned int sin_size;
+  int fd;
+#endif /* WIN32 */
   struct sockaddr_in my_addr;
   struct sockaddr_in remote_addr;
   int exit = 0;
@@ -60,7 +68,11 @@
            && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS
                || p->skype_callflow == SKYPIAX_STATE_UP)) {
 
+#ifdef WIN32
+      unsigned int fdselect;
+#else
       int fdselect;
+#endif /* WIN32 */
       int rt;
       fd_set fs;
       struct timeval to;
@@ -1090,7 +1102,7 @@
               if (p->interface_state != SKYPIAX_STATE_DIALING) {
                 /* we are not calling out */
 
-                if (1) {
+                if (1) { //FIXME
                   /* we are not inside an active call */
                   p->skype_callflow = CALLFLOW_STATUS_RINGING;
                   p->interface_state = SKYPIAX_STATE_RING;
@@ -1227,10 +1239,10 @@
                 DEBUGA_SKYPE("skype_call: %s SKYPIAX_CONTROL_ANSWER sent\n",
                              SKYPIAX_P_LOG, id);
 
-              if (1) {
+              if (1) { //FIXME
                 char msg_to_skype[1024];
 
-                if (1) {
+                if (1) { //FIXME
                   switch_threadattr_t *thd_attr = NULL;
 
                   switch_threadattr_create(&thd_attr, skypiax_module_pool);



More information about the Freeswitch-branches mailing list