[asterisk-commits] russell: branch russell/chan_console r95362 - in /team/russell/chan_console: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Dec 29 10:22:30 CST 2007


Author: russell
Date: Sat Dec 29 10:22:29 2007
New Revision: 95362

URL: http://svn.digium.com/view/asterisk?view=rev&rev=95362
Log:
tweak the sample config, and vastly improve the way handle_output() works

Modified:
    team/russell/chan_console/channels/chan_console.c
    team/russell/chan_console/configs/console.conf.sample

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=95362&r1=95361&r2=95362
==============================================================================
--- team/russell/chan_console/channels/chan_console.c (original)
+++ team/russell/chan_console/channels/chan_console.c Sat Dec 29 10:22:29 2007
@@ -491,20 +491,17 @@
 
 static int handle_output(struct console_pvt *pvt, void *output, unsigned long frame_count)
 {
-	int res;
-
-	res = jack_ringbuffer_read(pvt->output_rb, output, frame_count * 2);
-	if (res != frame_count * 2) {
-		char *out_buf = output;
-
-		/* ast_log(LOG_WARNING, "Wanted %ld bytes from the output ringbuffer, "
-			"but only got %d\n", frame_count * 2, res); */
-
-		out_buf += res;
-
-		/* zero out any samples that we didn't have data for */
-		memset(out_buf, 0, (frame_count * 2) - res);
-	}
+	size_t res;
+	unsigned long total_bytes = frame_count * 2;
+
+	res = jack_ringbuffer_read_space(pvt->output_rb);
+	if (res < total_bytes) {
+		/* ast_debug(1, "Missed a frame\n"); */
+		memset(output, 0, total_bytes);
+		return paContinue;
+	}
+
+	jack_ringbuffer_read(pvt->output_rb, output, frame_count * 2);
 
 	return paContinue;
 }

Modified: team/russell/chan_console/configs/console.conf.sample
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/configs/console.conf.sample?view=diff&rev=95362&r1=95361&r2=95362
==============================================================================
--- team/russell/chan_console/configs/console.conf.sample (original)
+++ team/russell/chan_console/configs/console.conf.sample Sat Dec 29 10:22:29 2007
@@ -1,5 +1,5 @@
 ;
-; Configuration for chan_console
+; Configuration for chan_console, a cross-platform console channel driver.
 ;
 
 [general]
@@ -8,33 +8,33 @@
 ; console.  This is very useful if the console is used as an intercom. 
 ; The default value is "no".
 ;
-; autoanswer = no
+;autoanswer = no
 
 ; Set the default context to use for outgoing calls.  This can be overridden by
 ; dialing some extension at context, unless the overridecontext option is enabled.
 ; The default is "default".
 ;
-; context = default
+;context = default
 
 ; Set the default extension to use for outgoing calls.  The default is "s".
 ;
-; extension = s
+;extension = s
 
 ; Set the default CallerID for created channels.
 ; 
-; callerid = MyName Here <(256) 428-6000>
+;callerid = MyName Here <(256) 428-6000>
 
 ; Set the default language for created channels.
 ;
-; language = en
+;language = en
 
 ; If you set overridecontext to 'yes', then the whole dial string
 ; will be interpreted as an extension, which is extremely useful
 ; to dial SIP, IAX and other extensions which use the '@' character.
 ; The default is "no".
 ;
-; overridecontext = no	; if 'no', the last @ will start the context
-			; if 'yes' the whole string is an extension.
+;overridecontext = no	; if 'no', the last @ will start the context
+                        ; if 'yes' the whole string is an extension.
 
 
 ; Default Music on Hold class to use when this channel is placed on hold in
@@ -42,7 +42,7 @@
 ; Set(CHANNEL(musicclass)=whatever) in the dialplan and the peer channel
 ; putting this one on hold did not suggest a class to use.
 ;
-; mohinterpret=default
+;mohinterpret=default
 
 ;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
 ; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of an




More information about the asterisk-commits mailing list