mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 11:32:25 +00:00
Notify CLI when modules is loaded / unloaded
(closes issue #17308) Reported by: pabelanger Patches: cli.modules.patch uploaded by pabelanger (license 224) Tested by: pabelanger, russell git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262800 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -263,6 +263,7 @@ static char *handle_load(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
|
|||||||
ast_cli(a->fd, "Unable to load module %s\n", a->argv[e->args]);
|
ast_cli(a->fd, "Unable to load module %s\n", a->argv[e->args]);
|
||||||
return CLI_FAILURE;
|
return CLI_FAILURE;
|
||||||
}
|
}
|
||||||
|
ast_cli(a->fd, "Loaded %s\n", a->argv[e->args]);
|
||||||
return CLI_SUCCESS;
|
return CLI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -586,7 +587,9 @@ static char *handle_unload(struct ast_cli_entry *e, int cmd, struct ast_cli_args
|
|||||||
ast_cli(a->fd, "Unable to unload resource %s\n", a->argv[x]);
|
ast_cli(a->fd, "Unable to unload resource %s\n", a->argv[x]);
|
||||||
return CLI_FAILURE;
|
return CLI_FAILURE;
|
||||||
}
|
}
|
||||||
|
ast_cli(a->fd, "Unloaded %s\n", a->argv[x]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return CLI_SUCCESS;
|
return CLI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode f
|
|||||||
if (!(mod = find_resource(resource_name, 0))) {
|
if (!(mod = find_resource(resource_name, 0))) {
|
||||||
AST_LIST_UNLOCK(&module_list);
|
AST_LIST_UNLOCK(&module_list);
|
||||||
ast_log(LOG_WARNING, "Unload failed, '%s' could not be found\n", resource_name);
|
ast_log(LOG_WARNING, "Unload failed, '%s' could not be found\n", resource_name);
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(mod->flags.running || mod->flags.declined))
|
if (!(mod->flags.running || mod->flags.declined))
|
||||||
|
|||||||
Reference in New Issue
Block a user