[asterisk-commits] oej: trunk r93166 - in /trunk: CHANGES main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Dec 16 07:35:10 CST 2007


Author: oej
Date: Sun Dec 16 07:35:09 2007
New Revision: 93166

URL: http://svn.digium.com/view/asterisk?view=rev&rev=93166
Log:
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)

Modified:
    trunk/CHANGES
    trunk/main/manager.c

Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?view=diff&rev=93166&r1=93165&r2=93166
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Sun Dec 16 07:35:09 2007
@@ -31,6 +31,7 @@
     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
 ------------------

Modified: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?view=diff&rev=93166&r1=93165&r2=93166
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Sun Dec 16 07:35:09 2007
@@ -709,6 +709,26 @@
 	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 @@
 	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"),
 };
 
 /*




More information about the asterisk-commits mailing list