[Freeswitch-branches] [commit] r11733 - freeswitch/branches/gmaruzz/mod_skypiax

FreeSWITCH SVN gmaruzz at freeswitch.org
Tue Feb 10 13:30:06 PST 2009


Author: gmaruzz
Date: Tue Feb 10 15:30:05 2009
New Revision: 11733

Log:
skypiax: better sounding by keeping busy with zeros the skype accepting socket when we would not send packets. No more scratches going from one word to another in IVRs

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	Tue Feb 10 15:30:05 2009
@@ -474,7 +474,6 @@
           }
 
         } else if (len == 0) {
-          DEBUGA_SKYPE("Skype incoming audio GONE\n", SKYPIAX_P_LOG);
           skypiax_sleep(1000);
         } else {
           ERRORA("len=%d\n", SKYPIAX_P_LOG, len);
@@ -507,7 +506,7 @@
       break;
   }
 
-  DEBUGA_SKYPE("incoming audio server (I am it) GONE\n", SKYPIAX_P_LOG);
+  DEBUGA_SKYPE("incoming audio server (I am it) EXITING\n", SKYPIAX_P_LOG);
   skypiax_close_socket(s);
   return NULL;
 }
@@ -614,8 +613,9 @@
             ERRORA("SAMPLERATE_SKYPIAX can only be 8000 or 16000\n", SKYPIAX_P_LOG);
           }
 
-          /* send the 16khz frame to the Skype client waiting for incoming audio */
+          /* send the 16khz frame to the Skype client waiting for incoming audio to be sent to the remote party*/
           len = send(fd, (char *) cli_out, got, 0);
+	  skypiax_sleep(5000); //5 msec
 
           if (len == -1) {
             break;
@@ -631,11 +631,12 @@
                    (int)(SAMPLES_PER_FRAME * sizeof(short)));
         }
       } else {
-        //if (rt)
+        if (rt)
           ERRORA("CLI rt=%d\n", SKYPIAX_P_LOG, rt);
 	  memset(cli_out, 0, sizeof(cli_out));
           len = send(fd, (char *) cli_out, sizeof(cli_out), 0);
-        //skypiax_sleep(10000);
+          len = send(fd, (char *) cli_out, sizeof(cli_out)/2, 0);
+          DEBUGA_SKYPE("sent %d of zeros to keep the Skype client socket busy\n", SKYPIAX_P_LOG, sizeof(cli_out) + sizeof(cli_out)/2);
       }
 
     }
@@ -644,7 +645,7 @@
     break;
   }
 
-  DEBUGA_SKYPE("outbound audio server (I am it) GONE\n", SKYPIAX_P_LOG);
+  DEBUGA_SKYPE("outbound audio server (I am it) EXITING\n", SKYPIAX_P_LOG);
   skypiax_close_socket(s);
   return NULL;
 }



More information about the Freeswitch-branches mailing list