diff --git a/channels/chan_motif.c b/channels/chan_motif.c index 4dbfb8e3a76edec9aa2174c6270d19dc2336d73c..0836972e167581261096b3d104aaacb359f35cb3 100644 --- a/channels/chan_motif.c +++ b/channels/chan_motif.c @@ -2719,7 +2719,7 @@ static int load_module(void) ast_format_cap_add_all_by_type(jingle_tech.capabilities, AST_FORMAT_TYPE_AUDIO); if (aco_process_config(&cfg_info, 0)) { - ast_log(LOG_ERROR, "Unable to read config file motif.conf. Not loading module.\n"); + ast_log(LOG_ERROR, "Unable to read config file motif.conf. Module loaded but not running.\n"); aco_info_destroy(&cfg_info); return AST_MODULE_LOAD_DECLINE; } diff --git a/include/asterisk/module.h b/include/asterisk/module.h index 46628586fdfee5243bafd6fc1759bcbd02a50477..a78160749cdcf788821e6a6342f28211a4a1fe9d 100644 --- a/include/asterisk/module.h +++ b/include/asterisk/module.h @@ -110,17 +110,17 @@ int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode); */ void ast_update_use_count(void); -/*! - * \brief Ask for a list of modules, descriptions, and use counts. +/*! + * \brief Ask for a list of modules, descriptions, use counts and status. * \param modentry A callback to an updater function. * \param like * * For each of the modules loaded, modentry will be executed with the resource, * description, and usecount values of each particular module. - * + * * \return the number of modules loaded */ -int ast_update_module_list(int (*modentry)(const char *module, const char *description, int usecnt, const char *like), +int ast_update_module_list(int (*modentry)(const char *module, const char *description, int usecnt, const char *status, const char *like), const char *like); /*! diff --git a/main/cli.c b/main/cli.c index 818ce757f3c5d9b97bb1d8ba6055961b8e62ef5b..b4e2c369c82a7df8736c2831b79aa0941875282e 100644 --- a/main/cli.c +++ b/main/cli.c @@ -651,17 +651,17 @@ static char *handle_unload(struct ast_cli_entry *e, int cmd, struct ast_cli_args return CLI_SUCCESS; } -#define MODLIST_FORMAT "%-30s %-40.40s %-10d\n" -#define MODLIST_FORMAT2 "%-30s %-40.40s %-10s\n" +#define MODLIST_FORMAT "%-30s %-40.40s %-10d %s\n" +#define MODLIST_FORMAT2 "%-30s %-40.40s %-10s %s\n" AST_MUTEX_DEFINE_STATIC(climodentrylock); static int climodentryfd = -1; -static int modlist_modentry(const char *module, const char *description, int usecnt, const char *like) +static int modlist_modentry(const char *module, const char *description, int usecnt, const char *status, const char *like) { /* Comparing the like with the module */ if (strcasestr(module, like) ) { - ast_cli(climodentryfd, MODLIST_FORMAT, module, description, usecnt); + ast_cli(climodentryfd, MODLIST_FORMAT, module, description, usecnt, status); return 1; } return 0; @@ -788,7 +788,7 @@ static char *handle_modlist(struct ast_cli_entry *e, int cmd, struct ast_cli_arg ast_mutex_lock(&climodentrylock); climodentryfd = a->fd; /* global, protected by climodentrylock */ - ast_cli(a->fd, MODLIST_FORMAT2, "Module", "Description", "Use Count"); + ast_cli(a->fd, MODLIST_FORMAT2, "Module", "Description", "Use Count", "Status"); ast_cli(a->fd,"%d modules loaded\n", ast_update_module_list(modlist_modentry, like)); climodentryfd = -1; ast_mutex_unlock(&climodentrylock); diff --git a/main/loader.c b/main/loader.c index 7ad515f8aa14c039982a2ae4ed9512dfe81bc4a7..5befafb5574bc1873be95223cc40b386a72d14c4 100644 --- a/main/loader.c +++ b/main/loader.c @@ -1240,7 +1240,7 @@ void ast_update_use_count(void) AST_LIST_UNLOCK(&updaters); } -int ast_update_module_list(int (*modentry)(const char *module, const char *description, int usecnt, const char *like), +int ast_update_module_list(int (*modentry)(const char *module, const char *description, int usecnt, const char *status, const char *like), const char *like) { struct ast_module *cur; @@ -1251,7 +1251,8 @@ int ast_update_module_list(int (*modentry)(const char *module, const char *descr unlock = 0; AST_LIST_TRAVERSE(&module_list, cur, entry) { - total_mod_loaded += modentry(cur->resource, cur->info->description, cur->usecount, like); + total_mod_loaded += modentry(cur->resource, cur->info->description, cur->usecount, + cur->flags.running ? "Running" : "Not Running", like); } if (unlock) diff --git a/res/snmp/agent.c b/res/snmp/agent.c index 6391f390108535897af0f8f611977208b112c41c..8a32fe3e1a94d058f6445b356e4751152be1d277 100644 --- a/res/snmp/agent.c +++ b/res/snmp/agent.c @@ -760,7 +760,7 @@ static u_char *ast_var_indications_table(struct variable *vp, oid *name, size_t return NULL; } -static int countmodule(const char *mod, const char *desc, int use, const char *like) +static int countmodule(const char *mod, const char *desc, int use, const char *status, const char *like) { return 1; }