summaryrefslogtreecommitdiff
path: root/main/cdr.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2008-02-08 21:26:32 +0000
committerRussell Bryant <russell@russellbryant.com>2008-02-08 21:26:32 +0000
commit1ec8cb41a8170201f45ff0efe65e96aa97e0b8d3 (patch)
tree425b3dafd75451669e2311d091127fe03d3c9693 /main/cdr.c
parent52595c5d30f311b4e8d1c089577b8679adde232e (diff)
Merge changes from team/mvanbaak/cli-command-audit
(closes issue #8925) About a year ago, as Leif Madsen and Jim van Meggelen were going over the CLI commands in Asterisk 1.4 for the next version of their book, they documented a lot of inconsistencies. This set of changes addresses all of these issues and has been reviewed by Leif. While this does introduce even more changes to the CLI command structure, it makes everything consistent, which is the most important thing. Thanks to all that helped with this one! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/cdr.c')
-rw-r--r--main/cdr.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/main/cdr.c b/main/cdr.c
index 85545be62..488eeee1c 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -1236,16 +1236,16 @@ static char *handle_cli_status(struct ast_cli_entry *e, int cmd, struct ast_cli_
switch (cmd) {
case CLI_INIT:
- e->command = "cdr status";
+ e->command = "cdr show status";
e->usage =
- "Usage: cdr status\n"
+ "Usage: cdr show status\n"
" Displays the Call Detail Record engine system status.\n";
return NULL;
case CLI_GENERATE:
return NULL;
}
- if (a->argc > 2)
+ if (a->argc > 3)
return CLI_SHOWUSAGE;
ast_cli(a->fd, "CDR logging: %s\n", enabled ? "enabled" : "disabled");
@@ -1274,6 +1274,14 @@ static char *handle_cli_status(struct ast_cli_entry *e, int cmd, struct ast_cli_
return CLI_SUCCESS;
}
+static char *handle_cli_status_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ char *res = handle_cli_status(e, cmd, a);
+ if (cmd == CLI_INIT)
+ e->command = "cdr status";
+ return res;
+}
+
static char *handle_cli_submit(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
@@ -1296,7 +1304,8 @@ static char *handle_cli_submit(struct ast_cli_entry *e, int cmd, struct ast_cli_
}
static struct ast_cli_entry cli_submit = AST_CLI_DEFINE(handle_cli_submit, "Posts all pending batched CDR data");
-static struct ast_cli_entry cli_status = AST_CLI_DEFINE(handle_cli_status, "Display the CDR status");
+static struct ast_cli_entry cli_status_deprecated = AST_CLI_DEFINE(handle_cli_status_deprecated, "Display the CDR status");
+static struct ast_cli_entry cli_status = AST_CLI_DEFINE(handle_cli_status, "Display the CDR status", .deprecate_cmd = &cli_status_deprecated);
static int do_reload(int reload)
{