summaryrefslogtreecommitdiff
path: root/res/res_clioriginate.c
diff options
context:
space:
mode:
authorMichiel van Baak <michiel@vanbaak.info>2008-09-28 23:32:14 +0000
committerMichiel van Baak <michiel@vanbaak.info>2008-09-28 23:32:14 +0000
commit90751b16caec323d90ddf7d41db4a25085a3bd76 (patch)
treed5167b9db2e6c55e56def0e52038799c477d3e3d /res/res_clioriginate.c
parent434c69b7fde58f0613afa8477d5a21e4dc76bf0d (diff)
Merge the cli_cleanup branch.
This work is done by lmadsen, junky and mvanbaak during AstriDevCon. This is the second audit the CLI got, and this time lmadsen made sure he had _ALL_ modules loaded that have CLI commands in them. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@145121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_clioriginate.c')
-rw-r--r--res/res_clioriginate.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/res/res_clioriginate.c b/res/res_clioriginate.c
index 6a6371972..1052888dc 100644
--- a/res/res_clioriginate.c
+++ b/res/res_clioriginate.c
@@ -122,26 +122,26 @@ static char *handle_orig(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
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 @@ static char *handle_orig(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
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);