[asterisk-commits] junky: branch group/cli_cleanup r145008 - in /team/group/cli_cleanup: main/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Sep 27 17:03:37 CDT 2008


Author: junky
Date: Sat Sep 27 17:03:37 2008
New Revision: 145008

URL: http://svn.digium.com/view/asterisk?view=rev&rev=145008
Log:
changed the originate to channel originate
changed the soft hangup to channel request hangup
that will not have any impact cause a template friendly will be created
approved by corydon at devcon

Modified:
    team/group/cli_cleanup/main/cli.c
    team/group/cli_cleanup/res/res_clioriginate.c

Modified: team/group/cli_cleanup/main/cli.c
URL: http://svn.digium.com/view/asterisk/team/group/cli_cleanup/main/cli.c?view=diff&rev=145008&r1=145007&r2=145008
==============================================================================
--- team/group/cli_cleanup/main/cli.c (original)
+++ team/group/cli_cleanup/main/cli.c Sat Sep 27 17:03:37 2008
@@ -756,18 +756,18 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "soft hangup";
+		e->command = "channel request hangup";
 		e->usage =
-			"Usage: soft hangup <channel>\n"
+			"Usage: channel request hangup <channel>\n"
 			"       Request that a channel be hung up. The hangup takes effect\n"
 			"       the next time the driver reads or writes from the channel\n";
 		return NULL;
 	case CLI_GENERATE:
 		return ast_complete_channels(a->line, a->word, a->pos, a->n, 2);
 	}
-	if (a->argc != 3)
+	if (a->argc != 4)
 		return CLI_SHOWUSAGE;
-	c = ast_get_channel_by_name_locked(a->argv[2]);
+	c = ast_get_channel_by_name_locked(a->argv[3]);
 	if (c) {
 		ast_cli(a->fd, "Requested Hangup on channel '%s'\n", c->name);
 		ast_softhangup(c, AST_SOFTHANGUP_EXPLICIT);

Modified: team/group/cli_cleanup/res/res_clioriginate.c
URL: http://svn.digium.com/view/asterisk/team/group/cli_cleanup/res/res_clioriginate.c?view=diff&rev=145008&r1=145007&r2=145008
==============================================================================
--- team/group/cli_cleanup/res/res_clioriginate.c (original)
+++ team/group/cli_cleanup/res/res_clioriginate.c Sat Sep 27 17:03:37 2008
@@ -122,26 +122,26 @@
 	char *res;
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "originate";
+		e->command = "channel originate";
 		e->usage = 
 			"  There are two ways to use this command. A call can be originated between a\n"
 			"channel and a specific application, or between a channel and an extension in\n"
 			"the dialplan. This is similar to call files or the manager originate action.\n"
 			"Calls originated with this command are given a timeout of 30 seconds.\n\n"
 
-			"Usage1: originate <tech/data> application <appname> [appdata]\n"
+			"Usage1: channel originate <tech/data> application <appname> [appdata]\n"
 			"  This will originate a call between the specified channel tech/data and the\n"
 			"given application. Arguments to the application are optional. If the given\n"
 			"arguments to the application include spaces, all of the arguments to the\n"
 			"application need to be placed in quotation marks.\n\n"
 
-			"Usage2: originate <tech/data> extension [exten@][context]\n"
+			"Usage2: channel originate <tech/data> extension [exten@][context]\n"
 			"  This will originate a call between the specified channel tech/data and the\n"
 			"given extension. If no context is specified, the 'default' context will be\n"
 			"used. If no extension is given, the 's' extension will be used.\n";
 		return NULL;
 	case CLI_GENERATE:
-		if (a->pos != 2)
+		if (a->pos != 3)
 			return NULL;
 
 		/* ugly, can be removed when CLI entries have ast_module pointers */
@@ -152,18 +152,20 @@
 		return res;
 	}
 
-	if (ast_strlen_zero(a->argv[1]) || ast_strlen_zero(a->argv[2]))
+	if (ast_strlen_zero(a->argv[2]) || ast_strlen_zero(a->argv[3]))
 		return CLI_SHOWUSAGE;
 
 	/* ugly, can be removed when CLI entries have ast_module pointers */
 	ast_module_ref(ast_module_info->self);
 
-	if (!strcasecmp("application", a->argv[2])) {
-		res = orig_app(a->fd, a->argv[1], a->argv[3], a->argv[4]);	
-	} else if (!strcasecmp("extension", a->argv[2])) {
-		res = orig_exten(a->fd, a->argv[1], a->argv[3]);
-	} else
+	if (!strcasecmp("application", a->argv[3])) {
+		res = orig_app(a->fd, a->argv[2], a->argv[4], a->argv[5]);	
+	} else if (!strcasecmp("extension", a->argv[3])) {
+		res = orig_exten(a->fd, a->argv[2], a->argv[4]);
+	} else {
+		ast_log(LOG_WARNING, "else");
 		res = CLI_SHOWUSAGE;
+	}
 
 	ast_module_unref(ast_module_info->self);
 




More information about the asterisk-commits mailing list