From c92dafd5512f0c674362aabe98c28b4f54386e64 Mon Sep 17 00:00:00 2001 From: Olle Johansson Date: Sun, 16 Dec 2007 13:35:09 +0000 Subject: [PATCH] Adding a new CLI command for "manager reload", which is important now that you need to reload after changes. Thanks YS. Reported by: ys Patches: trunk93163_manager_reload.c.diff uploaded by ys (license 281) (related to issue #11414) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93166 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- CHANGES | 1 + main/manager.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/CHANGES b/CHANGES index a195a3ef8f..2fc85752d4 100644 --- a/CHANGES +++ b/CHANGES @@ -31,6 +31,7 @@ AMI - The manager (TCP/TLS/HTTP) list (delete or add accounts) you need to reload manager. * Added Masquerade manager event for when a masquerade happens between two channels. + * Added "manager reload" command for the CLI Dialplan functions ------------------ diff --git a/main/manager.c b/main/manager.c index d46ae3760a..e229a78920 100644 --- a/main/manager.c +++ b/main/manager.c @@ -709,6 +709,26 @@ static char *handle_showmaneventq(struct ast_cli_entry *e, int cmd, struct ast_c return CLI_SUCCESS; } +/*! \brief CLI command manager reload */ +static char *handle_manager_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) +{ + switch (cmd) { + case CLI_INIT: + e->command = "manager reload"; + e->usage = + "Usage: manager reload\n" + " Reloads the manager configuration.\n"; + return NULL; + case CLI_GENERATE: + return NULL; + } + if (a->argc > 2) + return CLI_SHOWUSAGE; + reload_manager(); + return CLI_SUCCESS; +} + + static struct ast_cli_entry cli_manager[] = { AST_CLI_DEFINE(handle_showmancmd, "Show a manager interface command"), AST_CLI_DEFINE(handle_showmancmds, "List manager interface commands"), @@ -717,6 +737,7 @@ static struct ast_cli_entry cli_manager[] = { AST_CLI_DEFINE(handle_showmanagers, "List configured manager users"), AST_CLI_DEFINE(handle_showmanager, "Display information on a specific manager user"), AST_CLI_DEFINE(handle_mandebug, "Show, enable, disable debugging of the manager code"), + AST_CLI_DEFINE(handle_manager_reload, "Reload manager configurations"), }; /*