summaryrefslogtreecommitdiff
path: root/channels/console_gui.c
diff options
context:
space:
mode:
authorLuigi Rizzo <rizzo@icir.org>2008-01-07 11:22:01 +0000
committerLuigi Rizzo <rizzo@icir.org>2008-01-07 11:22:01 +0000
commiteb86067cba8ad084a48d6d710524928b8750d33b (patch)
tree471f25951a95ec93f41389cfc7453754b6e44567 /channels/console_gui.c
parent4f0cb30f4a0fbed33b0fbd96c624dbb0e57f3ac7 (diff)
resolve a load-time problem avoiding a call to console_do_answer.
On passing, fix dialling from the keypad. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96776 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/console_gui.c')
-rw-r--r--channels/console_gui.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/channels/console_gui.c b/channels/console_gui.c
index 73aa94a05..c9cfa6ed0 100644
--- a/channels/console_gui.c
+++ b/channels/console_gui.c
@@ -251,6 +251,12 @@ static void append_char(char *str, int *str_pos, const char c)
*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 @@ static void keypad_pick_up(struct video_desc *env)
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 @@ static struct gui_info *gui_init(const char *keypad_file)
/* 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);