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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 4 22:52:56 CDT 2007


Author: russell
Date: Tue Sep  4 22:52:56 2007
New Revision: 81490

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81490
Log:
Add a "console flash" CLI command, knocking another line off of the TODO list

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=81490&r1=81489&r2=81490
==============================================================================
--- team/russell/chan_console/channels/chan_console.c (original)
+++ team/russell/chan_console/channels/chan_console.c Tue Sep  4 22:52:56 2007
@@ -38,7 +38,6 @@
  * Multiple device support
  * Set Auto-answer from the dialplan
  *
- * flash CLI command
  * transfer CLI command
  * autoanswer CLI command (maybe general settings CLI command, instead?)
  * active CLI command
@@ -633,6 +632,35 @@
 	return *ext;
 }
 
+static char *cli_console_flash(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_FLASH };
+	struct console_pvt *pvt = &console_pvt;
+
+	if (cmd == CLI_INIT) {
+		e->command = "console flash";
+		e->usage =
+			"Usage: console flash\n"
+			"       Flashes the call currently placed on the console.\n";
+		return NULL;
+	} else if (cmd == CLI_GENERATE)
+		return NULL;
+
+	if (a->argc != e->args)
+		return CLI_SHOWUSAGE;
+
+	if (!pvt->owner) {
+		ast_cli(a->fd, "No call to flash\n");
+		return CLI_FAILURE;
+	}
+
+	pvt->hookstate = 0;
+
+	ast_queue_frame(pvt->owner, &f);
+
+	return CLI_SUCCESS;
+}
+
 static char *cli_console_dial(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	char *s = NULL;
@@ -873,6 +901,7 @@
 	NEW_CLI(cli_console_mute, "Disable/Enable mic input"),
 	NEW_CLI(cli_console_answer, "Answer an incoming console call"),
 	NEW_CLI(cli_console_sendtext, "Send text to a connected party"),
+	NEW_CLI(cli_console_flash, "Send a flash to the connected party"),
 	NEW_CLI(cli_list_devices, "List available devices"),
 };
 




More information about the asterisk-commits mailing list