summaryrefslogtreecommitdiff
path: root/main/cli.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-05-24 20:44:07 +0000
committerMatthew Jordan <mjordan@digium.com>2013-05-24 20:44:07 +0000
commit06be8463b683333c79845402d55168ef1b582fa9 (patch)
tree2fe0871cfec4d5edf3aae763541ff7efa32a444a /main/cli.c
parentc1b51fd2654736fd7c614d1571f904e236006651 (diff)
Migrate a large number of AMI events over to Stasis-Core
This patch moves a number of AMI events over to the Stasis-Core message bus. This includes: * ChanSpyStart/Stop * MonitorStart/Stop * MusicOnHoldStart/Stop * FullyBooted/Reload * All Voicemail/MWI related events In addition, it adds some Stasis-Core and AMI support for generic AMI messages, refactors the message router in AMI to use a single router with topic forwarding for the topics that AMI cares about, and refactors MWI message types and topics to be more name compliant. Review: https://reviewboard.asterisk.org/r/2532 (closes issue ASTERISK-21462) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/main/cli.c b/main/cli.c
index 22232acbc..683ae9c3e 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -303,14 +303,30 @@ static char *handle_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args
return CLI_SUCCESS;
}
for (x = e->args; x < a->argc; x++) {
- int res = ast_module_reload(a->argv[x]);
- /* XXX reload has multiple error returns, including -1 on error and 2 on success */
+ enum ast_module_reload_result res = ast_module_reload(a->argv[x]);
switch (res) {
- case 0:
+ case AST_MODULE_RELOAD_NOT_FOUND:
ast_cli(a->fd, "No such module '%s'\n", a->argv[x]);
break;
- case 1:
- ast_cli(a->fd, "Module '%s' does not support reload\n", a->argv[x]);
+ case AST_MODULE_RELOAD_NOT_IMPLEMENTED:
+ ast_cli(a->fd, "The module '%s' does not support reloads\n", a->argv[x]);
+ break;
+ case AST_MODULE_RELOAD_QUEUED:
+ ast_cli(a->fd, "Asterisk cannot reload a module yet; request queued\n");
+ break;
+ case AST_MODULE_RELOAD_ERROR:
+ ast_cli(a->fd, "The module '%s' reported a reload failure\n", a->argv[x]);
+ break;
+ case AST_MODULE_RELOAD_IN_PROGRESS:
+ ast_cli(a->fd, "A module reload request is already in progress; please be patient\n");
+ break;
+ case AST_MODULE_RELOAD_UNINITIALIZED:
+ ast_cli(a->fd, "The module '%s' was not properly initialized. Before reloading"
+ " the module, you must run \"module load %s\" and fix whatever is"
+ " preventing the module from being initialized.\n", a->argv[x], a->argv[x]);
+ break;
+ case AST_MODULE_RELOAD_SUCCESS:
+ ast_cli(a->fd, "Module '%s' reloaded successfully.\n", a->argv[x]);
break;
}
}