*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)
{
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 */
/* 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);