summaryrefslogtreecommitdiff
path: root/pbx/pbx_ael.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 /pbx/pbx_ael.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 'pbx/pbx_ael.c')
-rw-r--r--pbx/pbx_ael.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/pbx/pbx_ael.c b/pbx/pbx_ael.c
index cffa65f40..fa4b7d516 100644
--- a/pbx/pbx_ael.c
+++ b/pbx/pbx_ael.c
@@ -146,7 +146,7 @@ static int pbx_load_module(void)
}
/* CLI interface */
-static char *handle_cli_ael_debug_multiple(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_ael_debug_multiple_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
case CLI_INIT:
@@ -180,6 +180,40 @@ static char *handle_cli_ael_debug_multiple(struct ast_cli_entry *e, int cmd, str
return CLI_SUCCESS;
}
+static char *handle_cli_ael_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "ael set debug {read|tokens|macros|contexts|off}";
+ e->usage =
+ "Usage: ael debug {read|tokens|macros|contexts|off}\n"
+ " Enable AEL read, token, macro, or context debugging,\n"
+ " or disable all AEL debugging messages. Note: this\n"
+ " currently does nothing.\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+
+ if (a->argc != e->args)
+ return CLI_SHOWUSAGE;
+
+ if (!strcasecmp(a->argv[3], "read"))
+ aeldebug |= DEBUG_READ;
+ else if (!strcasecmp(a->argv[3], "tokens"))
+ aeldebug |= DEBUG_TOKENS;
+ else if (!strcasecmp(a->argv[3], "macros"))
+ aeldebug |= DEBUG_MACROS;
+ else if (!strcasecmp(a->argv[3], "contexts"))
+ aeldebug |= DEBUG_CONTEXTS;
+ else if (!strcasecmp(a->argv[3], "off"))
+ aeldebug = 0;
+ else
+ return CLI_SHOWUSAGE;
+
+ return CLI_SUCCESS;
+}
+
static char *handle_cli_ael_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
@@ -199,9 +233,10 @@ static char *handle_cli_ael_reload(struct ast_cli_entry *e, int cmd, struct ast_
return (pbx_load_module() ? CLI_FAILURE : CLI_SUCCESS);
}
+static struct ast_cli_entry cli_ael_debug_multiple_deprecated = AST_CLI_DEFINE(handle_cli_ael_debug_multiple_deprecated, "Enable AEL debugging flags");
static struct ast_cli_entry cli_ael[] = {
- AST_CLI_DEFINE(handle_cli_ael_reload, "Reload AEL configuration"),
- AST_CLI_DEFINE(handle_cli_ael_debug_multiple, "Enable AEL debugging flags")
+ AST_CLI_DEFINE(handle_cli_ael_reload, "Reload AEL configuration"),
+ AST_CLI_DEFINE(handle_cli_ael_set_debug, "Enable AEL debugging flags", .deprecate_cmd = &cli_ael_debug_multiple_deprecated)
};
static int unload_module(void)