summaryrefslogtreecommitdiff
path: root/main/asterisk.c
diff options
context:
space:
mode:
authorMichiel van Baak <michiel@vanbaak.info>2008-11-12 06:46:04 +0000
committerMichiel van Baak <michiel@vanbaak.info>2008-11-12 06:46:04 +0000
commit86f900b20105bf5e918d8347cab8557f33d5fdae (patch)
tree95cbe393b660ef9b967378388db5bd09c7a890f4 /main/asterisk.c
parent5b25c263181989a1f86be2c2c94c4425ec30721a (diff)
This commit does two things:
- Add CLI aliases module to asterisk. - Remove all deprecated CLI commands from the code Initial work done by file. Junk-Y and lmadsen did a lot of work and testing to get the list of deprecated commands into the configuration file. Deprecated CLI commands are now handled by this new module, see cli_aliases.conf for more info about that. ok russellb@ via reviewboard (closes issue #13735) Reported by: mvanbaak git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c80
1 files changed, 7 insertions, 73 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 27c221353..79e5e7be0 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -1590,14 +1590,6 @@ static char *handle_stop_now(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
return CLI_SUCCESS;
}
-static char *handle_stop_now_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
- char *res = handle_stop_now(e, cmd, a);
- if (cmd == CLI_INIT)
- e->command = "stop now";
- return res;
-}
-
static char *handle_stop_gracefully(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
@@ -1618,14 +1610,6 @@ static char *handle_stop_gracefully(struct ast_cli_entry *e, int cmd, struct ast
return CLI_SUCCESS;
}
-static char *handle_stop_gracefully_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
- char *res = handle_stop_gracefully(e, cmd, a);
- if (cmd == CLI_INIT)
- e->command = "stop gracefully";
- return res;
-}
-
static char *handle_stop_when_convenient(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
@@ -1646,14 +1630,6 @@ static char *handle_stop_when_convenient(struct ast_cli_entry *e, int cmd, struc
return CLI_SUCCESS;
}
-static char *handle_stop_when_convenient_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
- char *res = handle_stop_when_convenient(e, cmd, a);
- if (cmd == CLI_INIT)
- e->command = "stop when convenient";
- return res;
-}
-
static char *handle_restart_now(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
@@ -1674,14 +1650,6 @@ static char *handle_restart_now(struct ast_cli_entry *e, int cmd, struct ast_cli
return CLI_SUCCESS;
}
-static char *handle_restart_now_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
- char *res = handle_restart_now(e, cmd, a);
- if (cmd == CLI_INIT)
- e->command = "restart now";
- return res;
-}
-
static char *handle_restart_gracefully(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
@@ -1702,14 +1670,6 @@ static char *handle_restart_gracefully(struct ast_cli_entry *e, int cmd, struct
return CLI_SUCCESS;
}
-static char *handle_restart_gracefully_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
- char *res = handle_restart_gracefully(e, cmd, a);
- if (cmd == CLI_INIT)
- e->command = "restart gracefully";
- return res;
-}
-
static char *handle_restart_when_convenient(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
@@ -1730,14 +1690,6 @@ static char *handle_restart_when_convenient(struct ast_cli_entry *e, int cmd, st
return CLI_SUCCESS;
}
-static char *handle_restart_when_convenient_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
- char *res = handle_restart_when_convenient(e, cmd, a);
- if (cmd == CLI_INIT)
- e->command = "restart when convenient";
- return res;
-}
-
static char *handle_abort_shutdown(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
@@ -1759,14 +1711,6 @@ static char *handle_abort_shutdown(struct ast_cli_entry *e, int cmd, struct ast_
return CLI_SUCCESS;
}
-static char *handle_abort_shutdown_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
- char *res = handle_abort_shutdown(e, cmd, a);
- if (cmd == CLI_INIT)
- e->command = "abort shutdown";
- return res;
-}
-
static char *handle_bang(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
@@ -1866,24 +1810,14 @@ static char *show_license(struct ast_cli_entry *e, int cmd, struct ast_cli_args
#define ASTERISK_PROMPT2 "%s*CLI> "
-/* deprecated cli entries */
-static struct ast_cli_entry cli_abort_shutdown_deprecated = AST_CLI_DEFINE(handle_abort_shutdown_deprecated, "Cancel a running shutdown.");
-static struct ast_cli_entry cli_stop_now_deprecated = AST_CLI_DEFINE(handle_stop_now_deprecated, "Shut down Asterisk immediately.");
-static struct ast_cli_entry cli_stop_gracefully_deprecated = AST_CLI_DEFINE(handle_stop_gracefully_deprecated, "Gracefully shut down Asterisk.");
-static struct ast_cli_entry cli_stop_when_convenient_deprecated = AST_CLI_DEFINE(handle_stop_when_convenient_deprecated, "Shut down Asterisk at empty call volume.");
-static struct ast_cli_entry cli_restart_now_deprecated = AST_CLI_DEFINE(handle_restart_now_deprecated, "Restart Asterisk immediately.");
-static struct ast_cli_entry cli_restart_gracefully_deprecated = AST_CLI_DEFINE(handle_restart_gracefully_deprecated, "Restart Asterisk gracefully.");
-static struct ast_cli_entry cli_restart_when_convenient_deprecated = AST_CLI_DEFINE(handle_restart_when_convenient_deprecated, "Restart Asterisk at empty call volume.");
-/* end deprecated cli entries */
-
static struct ast_cli_entry cli_asterisk[] = {
- AST_CLI_DEFINE(handle_abort_shutdown, "Cancel a running shutdown", .deprecate_cmd = &cli_abort_shutdown_deprecated),
- AST_CLI_DEFINE(handle_stop_now, "Shut down Asterisk immediately", .deprecate_cmd = &cli_stop_now_deprecated),
- AST_CLI_DEFINE(handle_stop_gracefully, "Gracefully shut down Asterisk", .deprecate_cmd = &cli_stop_gracefully_deprecated),
- AST_CLI_DEFINE(handle_stop_when_convenient, "Shut down Asterisk at empty call volume", .deprecate_cmd = &cli_stop_when_convenient_deprecated),
- AST_CLI_DEFINE(handle_restart_now, "Restart Asterisk immediately", .deprecate_cmd = &cli_restart_now_deprecated),
- AST_CLI_DEFINE(handle_restart_gracefully, "Restart Asterisk gracefully", .deprecate_cmd = &cli_restart_gracefully_deprecated),
- AST_CLI_DEFINE(handle_restart_when_convenient, "Restart Asterisk at empty call volume", .deprecate_cmd = &cli_restart_when_convenient_deprecated),
+ AST_CLI_DEFINE(handle_abort_shutdown, "Cancel a running shutdown"),
+ AST_CLI_DEFINE(handle_stop_now, "Shut down Asterisk immediately"),
+ AST_CLI_DEFINE(handle_stop_gracefully, "Gracefully shut down Asterisk"),
+ AST_CLI_DEFINE(handle_stop_when_convenient, "Shut down Asterisk at empty call volume"),
+ AST_CLI_DEFINE(handle_restart_now, "Restart Asterisk immediately"),
+ AST_CLI_DEFINE(handle_restart_gracefully, "Restart Asterisk gracefully"),
+ AST_CLI_DEFINE(handle_restart_when_convenient, "Restart Asterisk at empty call volume"),
AST_CLI_DEFINE(show_warranty, "Show the warranty (if any) for this copy of Asterisk"),
AST_CLI_DEFINE(show_license, "Show the license(s) for this copy of Asterisk"),
AST_CLI_DEFINE(handle_version, "Display version info"),