[asterisk-commits] rizzo: trunk r96776 - /trunk/channels/console_gui.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 7 05:22:02 CST 2008


Author: rizzo
Date: Mon Jan  7 05:22:01 2008
New Revision: 96776

URL: http://svn.digium.com/view/asterisk?view=rev&rev=96776
Log:
resolve a load-time problem avoiding a call to console_do_answer.
On passing, fix dialling from the keypad.


Modified:
    trunk/channels/console_gui.c

Modified: trunk/channels/console_gui.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/console_gui.c?view=diff&rev=96776&r1=96775&r2=96776
==============================================================================
--- trunk/channels/console_gui.c (original)
+++ trunk/channels/console_gui.c Mon Jan  7 05:22:01 2008
@@ -251,6 +251,12 @@
 	*str_pos = i;
 }
 
+static void append_string(char *str, int *str_pos, const char *s)
+{
+	while (*s)
+		append_char(str, str_pos, *s++);
+}
+
 /* accumulate digits, possibly call dial if in connected mode */
 static void keypad_digit(struct video_desc *env, int digit)
 {	
@@ -316,12 +322,12 @@
 	ast_log(LOG_WARNING, "keypad_pick_up called\n");
 
 	if (env->owner) { /* someone is calling us, just answer */
-		console_do_answer(-1);
+		ast_cli_command(gui->outfd, "console answer");
 	} else if (gui->inbuf_pos) { /* we have someone to call */
 		ast_cli_command(gui->outfd, gui->inbuf);
 	}
-
 	append_char(gui->inbuf, &gui->inbuf_pos, '\0'); /* clear buffer */
+	append_string(gui->inbuf, &gui->inbuf_pos, "console dial ");
 }
 
 #if 0 /* still unused */
@@ -626,6 +632,7 @@
 
 	/* initialize keyboard buffer */
 	append_char(gui->inbuf, &gui->inbuf_pos, '\0');
+	append_string(gui->inbuf, &gui->inbuf_pos, "console dial ");
 	append_char(gui->msgbuf, &gui->msgbuf_pos, '\0');
 
 	keypad_setup(gui, keypad_file);




More information about the asterisk-commits mailing list