aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_usbradio.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-08 21:26:32 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-08 21:26:32 +0000
commite9d6c2ff9b22167c463b055b65e8351dc0a4cc0c (patch)
tree425b3dafd75451669e2311d091127fe03d3c9693 /channels/chan_usbradio.c
parent381f0dce1439f8c5344300a846760ea930987ed3 (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: http://svn.digium.com/svn/asterisk/trunk@103171 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_usbradio.c')
-rw-r--r--channels/chan_usbradio.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/channels/chan_usbradio.c b/channels/chan_usbradio.c
index 6b2154c82..06f97939d 100644
--- a/channels/chan_usbradio.c
+++ b/channels/chan_usbradio.c
@@ -1622,7 +1622,7 @@ static int set_txctcss_level(struct chan_usbradio_pvt *o)
/*
CLI debugging on and off
*/
-static char *handle_cli_radio_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_radio_set_debug_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct chan_usbradio_pvt *o = NULL;
@@ -1652,11 +1652,43 @@ static char *handle_cli_radio_set_debug(struct ast_cli_entry *e, int cmd, struct
return CLI_SUCCESS;
}
+static char *handle_cli_radio_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ struct chan_usbradio_pvt *o = NULL;
+
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "radio set debug {on|off}";
+ e->usage =
+ "Usage: radio set debug {on|off}\n"
+ " Enable/Disable radio debugging.\n";
+ case CLI_GENERATE:
+ return NULL;
+ }
+
+ if (a->argc != e->args)
+ return CLI_SHOWUSAGE;
+
+ o = find_desc(usbradio_active);
+
+ if (!strncasecmp(a->argv[e->args - 1], "on", 2))
+ o->debuglevel = 1;
+ else if (!strncasecmp(a->argv[e->args - 1], "off", 3))
+ o->debuglevel = 0;
+ else
+ return CLI_SHOWUSAGE;
+
+ ast_cli(a->fd, "USB Radio debugging %s.\n", o->debuglevel ? "enabled" : "disabled");
+
+ return CLI_SUCCESS;
+}
+
+static struct ast_cli_entry cli_radio_set_debug_deprecated = AST_CLI_DEFINE(handle_cli_radio_set_debug_deprecated, "Enable/Disable Radio Debugging");
static struct ast_cli_entry cli_usbradio[] = {
AST_CLI_DEFINE(handle_cli_radio_key, "Simulate Rx Signal Present"),
AST_CLI_DEFINE(handle_cli_radio_unkey, "Simulate Rx Signal Lusb"),
AST_CLI_DEFINE(handle_cli_radio_tune, "Radio Tune"),
- AST_CLI_DEFINE(handle_cli_radio_set_debug, "Enable/Disable Radio Debugging"),
+ AST_CLI_DEFINE(handle_cli_radio_set_debug, "Enable/Disable Radio Debugging", .deprecate_cmd = &cli_radio_set_debug_deprecated),
};
/*