]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
cli.c: Remove deprecated and redundant CLI command.
authorNaveen Albert <asterisk@phreaknet.org>
Thu, 7 Aug 2025 19:13:13 +0000 (15:13 -0400)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Mon, 11 Aug 2025 12:22:45 +0000 (12:22 +0000)
The "no debug channel" command has been deprecated since
1.6 (commit 691363656fbdc83edf04b125317aebae6525c9e7),
as it is replaced by "core set debug channel", which also
supports tab-completion on channels. Remove the redundant
command.

Resolves: #1343

UpgradeNote: The deprecated "no debug channel" command has
now been removed; use "core set debug channel" instead.

main/cli.c

index 67f92bf2bb765a12414b6b357dd11557d045c3f7..57bafa60de24e60cc57308244e3496ea888c2abd 100644 (file)
@@ -1538,10 +1538,7 @@ static char *handle_core_set_debug_channel(struct ast_cli_entry *e, int cmd, str
                return NULL;
        }
 
-       if (cmd == (CLI_HANDLER + 1000)) {
-               /* called from handle_nodebugchan_deprecated */
-               args.is_off = 1;
-       } else if (a->argc == e->args + 2) {
+       if (a->argc == e->args + 2) {
                /* 'core set debug channel {all|chan_id}' */
                if (!strcasecmp(a->argv[e->args + 1], "off"))
                        args.is_off = 1;
@@ -1615,33 +1612,6 @@ static char *handle_debug_category(struct ast_cli_entry *e, int cmd, struct ast_
        return CLI_SUCCESS;
 }
 
-static char *handle_nodebugchan_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
-       char *res;
-
-       switch (cmd) {
-       case CLI_INIT:
-               e->command = "no debug channel";
-               return NULL;
-       case CLI_HANDLER:
-               /* exit out of switch statement */
-               break;
-       default:
-               return NULL;
-       }
-
-       if (a->argc != e->args + 1)
-               return CLI_SHOWUSAGE;
-
-       /* add a 'magic' value to the CLI_HANDLER command so that
-        * handle_core_set_debug_channel() will act as if 'off'
-        * had been specified as part of the command
-        */
-       res = handle_core_set_debug_channel(e, CLI_HANDLER + 1000, a);
-
-       return res;
-}
-
 static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
        struct ast_channel *chan;
@@ -2056,7 +2026,6 @@ static struct ast_cli_entry cli_cli[] = {
 };
 
 static struct ast_cli_entry cli_channels_cli[] = {
-       AST_CLI_DEFINE(handle_nodebugchan_deprecated, "Disable debugging on channel(s)"),
        AST_CLI_DEFINE(handle_chanlist, "Display information on channels"),
        AST_CLI_DEFINE(handle_showcalls, "Display information on calls"),
        AST_CLI_DEFINE(handle_showchan, "Display information on a specific channel"),