[Freeswitch-svn] [commit] r11687 - freeswitch/branches/gmaruzz/mod_skypiax

FreeSWITCH SVN gmaruzz at freeswitch.org
Sun Feb 8 05:01:09 PST 2009


Author: gmaruzz
Date: Sun Feb  8 07:01:09 2009
New Revision: 11687

Log:
skypiax: cleaning skypiax_protocol.c, will it works on linux?

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

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	Sun Feb  8 07:01:09 2009
@@ -25,7 +25,14 @@
 
 #if defined(WIN32) && !defined(__CYGWIN__) 
 int skypiax_file_write(switch_file_t *pipe, short *buf, int howmany){
-              switch_file_write(pipe, buf, &howmany);
+	switch_size_t quantity;
+
+	quantity = howmany;
+
+              switch_file_write(pipe, buf, &quantity);
+
+	      howmany = quantity;
+
 	      return howmany;
 }
 #else /* WIN32 */
@@ -42,7 +49,11 @@
   unsigned int len;
   unsigned int i;
   unsigned int a;
+#if defined(WIN32) && !defined(__CYGWIN__) 
+  int sin_size;
+#else /* WIN32 */
   unsigned int sin_size;
+#endif /* WIN32 */
   unsigned int fd;
   short srv_in[SAMPLES_PER_FRAME];
   short srv_out[SAMPLES_PER_FRAME / 2];
@@ -190,6 +201,7 @@
         skypiax_sleep(10000);
       }
     }
+#if 0
 #if defined(WIN32) && !defined(__CYGWIN__) 
     kill_cli_size = SAMPLES_PER_FRAME * sizeof(short);
     skypiax_file_write(tech_pvt->audiopipe[1], kill_cli_buff, &kill_cli_size);
@@ -211,6 +223,20 @@
     kill_cli_size = SAMPLES_PER_FRAME * sizeof(short);
     len = write(tech_pvt->audioskypepipe[1], kill_cli_buff, kill_cli_size);
 #endif /* WIN32 */
+#endif
+
+    kill_cli_size = SAMPLES_PER_FRAME * sizeof(short);
+    len = skypiax_file_write(tech_pvt->audiopipe[1], kill_cli_buff, kill_cli_size);
+    kill_cli_size = SAMPLES_PER_FRAME * sizeof(short);
+    len = skypiax_file_write(tech_pvt->audioskypepipe[1], kill_cli_buff, kill_cli_size);
+    tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
+    kill_cli_size = SAMPLES_PER_FRAME * sizeof(short);
+    len = skypiax_file_write(tech_pvt->audiopipe[1], kill_cli_buff, kill_cli_size);
+    kill_cli_size = SAMPLES_PER_FRAME * sizeof(short);
+    len = skypiax_file_write(tech_pvt->audioskypepipe[1], kill_cli_buff, kill_cli_size);
+
+
+
     DEBUGA_SKYPE("Skype client GONE\n", SKYPIAX_P_LOG);
 #if defined(WIN32) && !defined(__CYGWIN__) 
     closesocket(fd);
@@ -569,13 +595,13 @@
               sizeof(msg_from_skype) - 2);
 
       howmany = strlen(msg_from_skype) + 1;
-#if defined(WIN32) && !defined(__CYGWIN__) 
-      skypiax_file_write(tech_pvt->SkypiaxHandles.fdesc[1], msg_from_skype, &howmany);
+//#if defined(WIN32) && !defined(__CYGWIN__) 
+      howmany = skypiax_file_write(tech_pvt->SkypiaxHandles.fdesc[1], (short *)msg_from_skype, howmany);
       //NOTICA("From Skype API: %s\n", SKYPIAX_P_LOG, msg_from_skype);
-#else
-    howmany = write(tech_pvt->SkypiaxHandles.fdesc[1], msg_from_skype, howmany);
+//#else
+    //howmany = write(tech_pvt->SkypiaxHandles.fdesc[1], msg_from_skype, howmany);
       //NOTICA("From Skype API: %s\n", SKYPIAX_P_LOG, msg_from_skype);
-#endif
+//#endif
       lReturnCode = 1;
     }
     break;



More information about the Freeswitch-svn mailing list