Revision
16645
Author
gmaruzz
Date
2010-02-15 14:16:00 -0600 (Mon, 15 Feb 2010)

Log Message

skypiax: better timin on windoz (thx anthm), let's see if it works on *nix

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c (16644 => 16645)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c	2010-02-15 17:40:13 UTC (rev 16644)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c	2010-02-15 20:16:00 UTC (rev 16645)
@@ -987,6 +987,7 @@
 			switch_mutex_unlock(globals.mutex);
 			return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
 		}
+		switch_channel_set_variable(channel, "send_silence_when_idle", "true");
 		if (skypiax_tech_init(tech_pvt, *new_session) != SWITCH_STATUS_SUCCESS) {
 			ERRORA("Doh! no tech_init?\n", SKYPIAX_P_LOG);
 			switch_core_session_destroy(new_session);
@@ -1808,6 +1809,7 @@
 			switch_core_session_destroy(&session);
 			return 0;
 		}
+		switch_channel_set_variable(channel, "send_silence_when_idle", "true");
 		if (skypiax_tech_init(tech_pvt, session) != SWITCH_STATUS_SUCCESS) {
 			ERRORA("Doh! no tech_init?\n", SKYPIAX_P_LOG);
 			switch_core_session_destroy(&session);

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (16644 => 16645)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	2010-02-15 17:40:13 UTC (rev 16644)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	2010-02-15 20:16:00 UTC (rev 16645)
@@ -1061,20 +1061,21 @@
 					fdselect = fd;
 					FD_SET(fdselect, &fs);
 
-					//FIXME rt = select(fdselect + 1, NULL, &fs, NULL, &to);
+					//rt = select(fdselect + 1, NULL, &fs, NULL, &to);
 					waitin=0;
 					big_waited=0;
 					while (tech_pvt->flag_audio_cli == 0) {
 #ifdef WIN32
-						skypiax_sleep(100);	//0.1 millisec
+						skypiax_sleep(1000);	//0.1 millisec
 #else
 						skypiax_sleep(1000);	//1 millisec
 #endif //WIN32
 						waitin++;
+#if 0
 						if(big_waited == 1 && waitin==lil_waitin && tech_pvt->flag_audio_cli == 0){
 							memset(cli_out, 255, SAMPLES_PER_FRAME * sizeof(short));
 							send(fd, (char *) cli_out, SAMPLES_PER_FRAME * sizeof(short), 0);
-							//WARNINGA("write buffer filled at %d\n", SKYPIAX_P_LOG, waitin);
+							WARNINGA("write buffer filled at %d\n", SKYPIAX_P_LOG, waitin);
 							waitin=0;
 							continue;
 						}
@@ -1082,17 +1083,16 @@
 							memset(cli_out, 255, SAMPLES_PER_FRAME * sizeof(short));
 							send(fd, (char *) cli_out, SAMPLES_PER_FRAME * sizeof(short), 0);
 							send(fd, (char *) cli_out, SAMPLES_PER_FRAME * sizeof(short), 0);
-							//DEBUGA_SKYPE("write buffer filled at %d\n", SKYPIAX_P_LOG, waitin);
+							NOTICA("write buffer filled at %d\n", SKYPIAX_P_LOG, waitin);
 							waitin=0;
 							big_waited=1;
 							continue;
 						}
-
+#endif //0
 					}
 					if(waitin > 21){
-						//DEBUGA_SKYPE("waitin is now %d\n", SKYPIAX_P_LOG, waitin);
+						NOTICA("waitin is now %d\n", SKYPIAX_P_LOG, waitin);
 					}
-
 					rt = 1;
 
 					if (rt > 0) {
@@ -1196,7 +1196,7 @@
 	waitin=0;
 	while (tech_pvt->flag_audio_srv == 0) {
 #ifdef WIN32
-		skypiax_sleep(100);		//0.1 millisec
+		skypiax_sleep(1000);		//0.1 millisec
 #else
 		skypiax_sleep(1000);	//1 millisec
 #endif //WIN32