[asterisk-commits] russell: branch russell/chan_console r54038 - /team/russell/chan_console/chan...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Feb 12 10:20:37 MST 2007


Author: russell
Date: Mon Feb 12 11:20:36 2007
New Revision: 54038

URL: http://svn.digium.com/view/asterisk?view=rev&rev=54038
Log:
Fix a couple little bugs ...

Modified:
    team/russell/chan_console/channels/chan_console.c

Modified: team/russell/chan_console/channels/chan_console.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_console.c?view=diff&rev=54038&r1=54037&r2=54038
==============================================================================
--- team/russell/chan_console/channels/chan_console.c (original)
+++ team/russell/chan_console/channels/chan_console.c Mon Feb 12 11:20:36 2007
@@ -241,6 +241,9 @@
 	if (pvt->streamstate)
 		return 0;
 
+	pvt->streamstate = 1;
+	ast_log(LOG_DEBUG, "Starting stream\n");
+
 	res = Pa_OpenDefaultStream(&pvt->stream, INPUT_CHANNELS, OUTPUT_CHANNELS, 
 		paInt16, SAMPLE_RATE, NUM_SAMPLES, console_callback, NULL);
 	if (res != paNoError) {
@@ -255,8 +258,6 @@
 			res, Pa_GetErrorText(res));
 		return -1;
 	}
-
-	pvt->streamstate = 1;
 
 	return 0;
 }
@@ -598,6 +599,11 @@
 	/* Get the rest from queued frames */
 	while (frame_count) { 
 		while (!(fr = AST_LIST_REMOVE_HEAD(&pvt->frames, frame_list))) {
+			if (!pvt->hookstate) {
+				memset(output + src, 0, frame_count * 2);
+				frame_count = 0;
+				break;
+			}
 			ast_cond_wait(&pvt->cond, &pvt->lock);
 			if (!pvt->hookstate) {
 				if (fr)
@@ -744,7 +750,7 @@
 	/* if we have an argument split it into extension and context */
 	if (a->argc == e->args + 1) {
 		s = ast_ext_ctx(pvt, a->argv[e->args], &mye, &myc);
-		ast_log(LOG_NOTICE, "provided '%s', exten '%s' context '%s'\n", a->argv[e->args], mye, myc);
+		ast_log(LOG_DEBUG, "provided '%s', exten '%s' context '%s'\n", a->argv[e->args], mye, myc);
 	}
 	/* supply default values if needed */
 	if (mye == NULL)



More information about the asterisk-commits mailing list