Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Asterisk module definitions. More...
#include "asterisk/utils.h"
Go to the source code of this file.
Data Structures | |
struct | ast_module_info |
Macros | |
#define | AST_MODULE_CONFIG "modules.conf" |
Module configuration file. More... | |
#define | AST_MODULE_INFO(keystr, flags_to_set, desc, fields...) |
#define | AST_MODULE_INFO_STANDARD(keystr, desc) |
#define | AST_MODULE_INFO_STANDARD_DEPRECATED(keystr, desc) |
#define | AST_MODULE_INFO_STANDARD_EXTENDED(keystr, desc) |
#define | ast_module_ref(mod) __ast_module_ref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Hold a reference to the module. More... | |
#define | ast_module_running_ref(mod) __ast_module_running_ref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Hold a reference to the module if it is running. More... | |
#define | ast_module_shutdown_ref(mod) __ast_module_shutdown_ref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Prevent unload of the module before shutdown. More... | |
#define | ast_module_unref(mod) __ast_module_unref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Release a reference to the module. More... | |
#define | ast_module_user_add(chan) __ast_module_user_add(AST_MODULE_SELF, chan) |
#define | ast_module_user_hangup_all() __ast_module_user_hangup_all(AST_MODULE_SELF) |
#define | ast_module_user_remove(user) __ast_module_user_remove(AST_MODULE_SELF, user) |
#define | ast_register_application(app, execute, synopsis, description) ast_register_application2(app, execute, synopsis, description, AST_MODULE_SELF) |
Register an application. More... | |
#define | ast_register_application_xml(app, execute) ast_register_application(app, execute, NULL, NULL) |
Register an application using XML documentation. More... | |
#define | ASTERISK_GPL_KEY "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" |
The text the key() function should return. More... | |
#define | SCOPED_MODULE_USE(module) RAII_VAR(struct ast_module *, __self__ ## __LINE__, ast_module_ref(module), ast_module_unref) |
Functions | |
struct ast_module * | __ast_module_ref (struct ast_module *mod, const char *file, int line, const char *func) |
struct ast_module * | __ast_module_running_ref (struct ast_module *mod, const char *file, int line, const char *func) |
void | __ast_module_shutdown_ref (struct ast_module *mod, const char *file, int line, const char *func) |
void | __ast_module_unref (struct ast_module *mod, const char *file, int line, const char *func) |
struct ast_module_user * | __ast_module_user_add (struct ast_module *, struct ast_channel *) |
void | __ast_module_user_hangup_all (struct ast_module *) |
void | __ast_module_user_remove (struct ast_module *, struct ast_module_user *) |
enum ast_module_load_result | ast_load_resource (const char *resource_name) |
Load a module. More... | |
int | ast_loader_register (int(*updater)(void)) |
Add a procedure to be run when modules have been updated. More... | |
int | ast_loader_unregister (int(*updater)(void)) |
Remove a procedure to be run when modules are updated. More... | |
int | ast_module_check (const char *name) |
Check if module with the name given is loaded. More... | |
char * | ast_module_helper (const char *line, const char *word, int pos, int state, int rpos, enum ast_module_helper_type type) |
Match modules names for the Asterisk cli. More... | |
const char * | ast_module_name (const struct ast_module *mod) |
Get the name of a module. More... | |
void | ast_module_register (const struct ast_module_info *) |
enum ast_module_reload_result | ast_module_reload (const char *name) |
Reload asterisk modules. More... | |
const char * | ast_module_support_level_to_string (enum ast_module_support_level support_level) |
void | ast_module_unregister (const struct ast_module_info *) |
int | ast_refresh_resource (const char *resource_name, enum ast_module_unload_mode force, int recursive) |
Unload and load a module again. More... | |
int | ast_register_application2 (const char *app, int(*execute)(struct ast_channel *, const char *), const char *synopsis, const char *description, void *mod) |
Register an application. More... | |
int | ast_unload_resource (const char *resource_name, enum ast_module_unload_mode) |
Unload a module. More... | |
int | ast_unregister_application (const char *app) |
Unregister an application. More... | |
int | ast_update_module_list (int(*modentry)(const char *module, const char *description, int usecnt, const char *status, const char *like, enum ast_module_support_level support_level), const char *like) |
Ask for a list of modules, descriptions, use counts and status. More... | |
int | ast_update_module_list_condition (int(*modentry)(const char *module, const char *description, int usecnt, const char *status, const char *like, enum ast_module_support_level support_level, void *data, const char *condition), const char *like, void *data, const char *condition) |
Ask for a list of modules, descriptions, use counts and status. More... | |
int | ast_update_module_list_data (int(*modentry)(const char *module, const char *description, int usecnt, const char *status, const char *like, enum ast_module_support_level support_level, void *data), const char *like, void *data) |
Ask for a list of modules, descriptions, use counts and status. More... | |
void | ast_update_use_count (void) |
Notify when usecount has been changed. More... | |
Variables | |
static const struct ast_module_info * | ast_module_info |
Asterisk module definitions.
This file contains the definitons for functions Asterisk modules should provide and some other module related functions.
Definition in file module.h.
#define AST_MODULE_CONFIG "modules.conf" |
#define AST_MODULE_INFO | ( | keystr, | |
flags_to_set, | |||
desc, | |||
fields... | |||
) |
#define AST_MODULE_INFO_STANDARD_DEPRECATED | ( | keystr, | |
desc | |||
) |
#define ast_module_ref | ( | mod | ) | __ast_module_ref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define ast_module_running_ref | ( | mod | ) | __ast_module_running_ref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Hold a reference to the module if it is running.
mod | Module to reference |
mod | if running |
NULL | if not running |
The returned pointer should be released with ast_module_unref.
#define ast_module_shutdown_ref | ( | mod | ) | __ast_module_shutdown_ref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define ast_module_unref | ( | mod | ) | __ast_module_unref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define ast_module_user_add | ( | chan | ) | __ast_module_user_add(AST_MODULE_SELF, chan) |
#define ast_module_user_hangup_all | ( | ) | __ast_module_user_hangup_all(AST_MODULE_SELF) |
#define ast_module_user_remove | ( | user | ) | __ast_module_user_remove(AST_MODULE_SELF, user) |
#define ast_register_application | ( | app, | |
execute, | |||
synopsis, | |||
description | |||
) | ast_register_application2(app, execute, synopsis, description, AST_MODULE_SELF) |
Register an application.
app | Short name of the application |
execute | a function callback to execute the application. It should return non-zero if the channel needs to be hung up. |
synopsis | a short description (one line synopsis) of the application |
description | long description with all of the details about the use of the application |
This registers an application with Asterisk's internal application list.
0 | success |
-1 | failure. |
#define ast_register_application_xml | ( | app, | |
execute | |||
) | ast_register_application(app, execute, NULL, NULL) |
Register an application using XML documentation.
app | Short name of the application |
execute | a function callback to execute the application. It should return non-zero if the channel needs to be hung up. |
This registers an application with Asterisk's internal application list.
0 | success |
-1 | failure. |
#define ASTERISK_GPL_KEY "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" |
The text the key() function should return.
#define SCOPED_MODULE_USE | ( | module | ) | RAII_VAR(struct ast_module *, __self__ ## __LINE__, ast_module_ref(module), ast_module_unref) |
enum ast_module_flags |
Enumerator | |
---|---|
AST_MODFLAG_DEFAULT | |
AST_MODFLAG_GLOBAL_SYMBOLS | |
AST_MODFLAG_LOAD_ORDER |
Definition at line 328 of file module.h.
Used to specify which modules should be returned by ast_module_helper.
Definition at line 127 of file module.h.
Definition at line 334 of file module.h.
Enumerator | |
---|---|
AST_MODULE_LOAD_SUCCESS | Module is loaded and configured. |
AST_MODULE_LOAD_DECLINE | Module has failed to load, may be in an inconsistent state. This value is used when a module fails to start but does not risk system-wide stability. Declined modules will prevent any other dependent module from starting. |
AST_MODULE_LOAD_SKIP | |
AST_MODULE_LOAD_PRIORITY | |
AST_MODULE_LOAD_FAILURE | Module could not be loaded properly. This return should only be returned by modules for unrecoverable failures that cause the whole system to become unstable. In almost all cases AST_MODULE_LOAD_DECLINE should be used instead.
|
Definition at line 68 of file module.h.
Possible return types for ast_module_reload.
Definition at line 109 of file module.h.
struct ast_module * __ast_module_ref | ( | struct ast_module * | mod, |
const char * | file, | ||
int | line, | ||
const char * | func | ||
) |
Definition at line 2868 of file loader.c.
References __ao2_ref(), ast_atomic_fetchadd_int(), ast_update_use_count(), make_ari_stubs::file, NULL, ast_module::ref_debug, and ast_module::usecount.
Referenced by __ast_module_running_ref(), and __ast_module_shutdown_ref().
struct ast_module * __ast_module_running_ref | ( | struct ast_module * | mod, |
const char * | file, | ||
int | line, | ||
const char * | func | ||
) |
Definition at line 2884 of file loader.c.
References __ast_module_ref(), make_ari_stubs::file, ast_module::flags, NULL, and ast_module::running.
void __ast_module_shutdown_ref | ( | struct ast_module * | mod, |
const char * | file, | ||
int | line, | ||
const char * | func | ||
) |
Definition at line 2894 of file loader.c.
References __ast_module_ref(), make_ari_stubs::file, ast_module::flags, and ast_module::keepuntilshutdown.
void __ast_module_unref | ( | struct ast_module * | mod, |
const char * | file, | ||
int | line, | ||
const char * | func | ||
) |
Definition at line 2904 of file loader.c.
References __ao2_ref(), ast_atomic_fetchadd_int(), ast_update_use_count(), make_ari_stubs::file, ast_module::ref_debug, and ast_module::usecount.
struct ast_module_user * __ast_module_user_add | ( | struct ast_module * | mod, |
struct ast_channel * | chan | ||
) |
Definition at line 800 of file loader.c.
References ao2_ref, ast_atomic_fetchadd_int(), ast_calloc, AST_LIST_INSERT_HEAD, AST_LIST_LOCK, AST_LIST_UNLOCK, ast_update_use_count(), ast_module_user::chan, NULL, ast_module::ref_debug, ast_module::usecount, and ast_module::users.
Referenced by ast_func_read(), ast_func_read2(), ast_func_write(), and pbx_exec().
void __ast_module_user_hangup_all | ( | struct ast_module * | mod | ) |
Definition at line 853 of file loader.c.
References ao2_ref, ast_atomic_fetchadd_int(), ast_free, AST_LIST_LOCK, AST_LIST_REMOVE_HEAD, AST_LIST_UNLOCK, ast_softhangup(), AST_SOFTHANGUP_APPUNLOAD, ast_update_use_count(), ast_module_user::chan, ast_module::ref_debug, ast_module::usecount, and ast_module::users.
Referenced by auto_unload_resource().
void __ast_module_user_remove | ( | struct ast_module * | mod, |
struct ast_module_user * | u | ||
) |
Definition at line 826 of file loader.c.
References ao2_ref, ast_atomic_fetchadd_int(), ast_free, AST_LIST_LOCK, AST_LIST_REMOVE, AST_LIST_UNLOCK, ast_update_use_count(), ast_module::ref_debug, ast_module::usecount, and ast_module::users.
Referenced by ast_func_read(), ast_func_read2(), ast_func_write(), and pbx_exec().
enum ast_module_load_result ast_load_resource | ( | const char * | resource_name | ) |
Load a module.
resource_name | The name of the module to load. |
This function is run by the PBX to load the modules. It performs all loading and initialization tasks. Basically, to load a module, just give it the name of the module and it will do the rest.
Definition at line 1978 of file loader.c.
References ast_debug, AST_DLLIST_LOCK, AST_DLLIST_UNLOCK, ast_test_suite_event_notify, ast_unload_resource(), ast_module::declined, find_resource(), ast_module::flags, load_resource(), and NULL.
Referenced by ast_ari_asterisk_load_module(), ast_refresh_resource(), auto_unload_resource(), handle_load(), and manager_moduleload().
int ast_loader_register | ( | int(*)(void) | updater | ) |
Add a procedure to be run when modules have been updated.
updater | The function to run when modules have been updated. |
This function adds the given function to a linked list of functions to be run when the modules are updated.
0 | on success |
-1 | on failure. |
Definition at line 2836 of file loader.c.
References AST_LIST_INSERT_HEAD, AST_LIST_LOCK, AST_LIST_UNLOCK, ast_malloc, and tmp().
int ast_loader_unregister | ( | int(*)(void) | updater | ) |
Remove a procedure to be run when modules are updated.
updater | The updater function to unregister. |
This removes the given function from the updater list.
0 | on success |
-1 | on failure. |
Definition at line 2851 of file loader.c.
References AST_LIST_LOCK, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, AST_LIST_UNLOCK, and loadupdate::updater.
int ast_module_check | ( | const char * | name | ) |
Check if module with the name given is loaded.
name | Module name, like "chan_pjsip.so" |
1 | if true |
0 | if false |
Check if module with the name given is loaded.
Definition at line 2823 of file loader.c.
References ast_strlen_zero(), find_resource(), name, and NULL.
Referenced by ast_ari_asterisk_get_module(), ast_ari_asterisk_load_module(), ast_ari_asterisk_reload_module(), ast_ari_asterisk_unload_module(), AST_TEST_DEFINE(), ifmodule_read(), load_module(), and manager_modulecheck().
char * ast_module_helper | ( | const char * | line, |
const char * | word, | ||
int | pos, | ||
int | state, | ||
int | rpos, | ||
enum ast_module_helper_type | type | ||
) |
Match modules names for the Asterisk cli.
line | Unused by this function, but this should be the line we are matching. |
word | The partial name to match. |
pos | The position the word we are completing is in. |
state | The possible match to return. |
rpos | The position we should be matching. This should be the same as pos. |
type | The type of action that will be performed by CLI. |
A | possible completion of the partial match. |
NULL | if no matches were found or Asterisk is not yet fully booted. |
Definition at line 1528 of file loader.c.
References AST_DLLIST_LOCK, AST_DLLIST_TRAVERSE, AST_DLLIST_UNLOCK, AST_MODULE_HELPER_LOAD, AST_OPT_FLAG_FULLY_BOOTED, ast_options, ast_strdup, ast_test_flag, module_load_helper(), module_matches_helper_type(), NULL, ast_module::resource, and type.
Referenced by handle_debug(), handle_load(), handle_modlist(), handle_refresh(), handle_reload(), handle_trace(), and handle_unload().
const char * ast_module_name | ( | const struct ast_module * | mod | ) |
Get the name of a module.
mod | A pointer to the module. |
NULL | if mod or mod->info is NULL |
Definition at line 615 of file loader.c.
References ast_module::info, ast_module_info::name, and NULL.
Referenced by acf_retrieve_docs(), ast_register_application2(), graceful_unload_possible(), resource_list_recursive_decline(), start_resource_list(), and unload_dynamic_module().
void ast_module_register | ( | const struct ast_module_info * | info | ) |
Definition at line 659 of file loader.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_find, ao2_link, ao2_ref, ao2_t_alloc_options, ast_debug, AST_DLLIST_INSERT_TAIL, AST_DLLIST_LOCK, AST_DLLIST_UNLOCK, AST_LIST_HEAD_INIT, ast_opt_ref_debug, ast_std_calloc(), AST_VECTOR_INIT, ast_module::builtin, builtin_module_list, ast_module::enhances, ast_module::flags, sip_to_pjsip::info(), ast_module::info, loader_ready, NULL, OBJ_SEARCH_KEY, ast_module::optional_modules, ast_module::ref_debug, ast_module::reffed_deps, ast_module::requires, ast_module::resource, resource_being_loaded, and ast_module::users.
Referenced by loader_builtin_init().
enum ast_module_reload_result ast_module_reload | ( | const char * | name | ) |
Reload asterisk modules.
name | the name of the module to reload |
This function reloads the specified module, or if no modules are specified, it will reload all loaded modules.
The | ast_module_reload_result status of the module load request |
Definition at line 1721 of file loader.c.
References ast_config_AST_CONFIG_DIR, AST_DLLIST_LOCK, AST_DLLIST_TRAVERSE, AST_DLLIST_UNLOCK, ast_lastreloadtime, ast_lock_path(), AST_LOCK_SUCCESS, AST_LOCK_TIMEOUT, ast_log, AST_LOG_WARNING, AST_MODULE_LOAD_SUCCESS, AST_MODULE_RELOAD_ERROR, AST_MODULE_RELOAD_IN_PROGRESS, AST_MODULE_RELOAD_NOT_FOUND, AST_MODULE_RELOAD_NOT_IMPLEMENTED, AST_MODULE_RELOAD_QUEUED, AST_MODULE_RELOAD_SUCCESS, AST_MODULE_RELOAD_UNINITIALIZED, ast_mutex_trylock, ast_mutex_unlock, ast_opt_lock_confdir, ast_sd_notify(), ast_tvnow(), ast_unlock_path(), ast_verb, ast_module::declined, ast_module::flags, sip_to_pjsip::info(), ast_module::info, LOG_WARNING, modules_loaded, name, publish_reload_message(), queue_reload_request(), reloadlock, ast_module::resource, resource_name_baselen(), resource_name_match(), and ast_module::running.
Referenced by action_reload(), action_updateconfig(), ast_ari_asterisk_reload_module(), ast_process_pending_reloads(), handle_cli_ael_reload(), handle_cli_moh_reload(), handle_core_reload(), handle_reload(), manager_moduleload(), monitor_sig_flags(), and reload_exec().
const char * ast_module_support_level_to_string | ( | enum ast_module_support_level | support_level | ) |
Definition at line 2925 of file loader.c.
References support_level_map.
Referenced by identify_module(), modlist_modentry(), and process_module_list().
void ast_module_unregister | ( | const struct ast_module_info * | info | ) |
Definition at line 768 of file loader.c.
References ast_debug, AST_DLLIST_LOCK, AST_DLLIST_REMOVE_CURRENT, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END, AST_DLLIST_UNLOCK, sip_to_pjsip::info(), ast_module::info, module_destroy(), NULL, and ast_module::usecount.
int ast_refresh_resource | ( | const char * | resource_name, |
enum ast_module_unload_mode | force, | ||
int | recursive | ||
) |
Unload and load a module again.
resource_name | The name of the module to unload. |
ast_module_unload_mode | The force flag. This should be set using one of the AST_FORCE flags. |
recursive | Attempt to recursively unload any dependents of this module if that will allow the module to unload, and load them back again afterwards. |
0 | on success. |
1 | on error unloading modules. |
-1 | on error loading modules back. |
Definition at line 1407 of file loader.c.
References ast_load_resource(), ast_log, ast_unload_resource(), AST_VECTOR_FREE, AST_VECTOR_GET, AST_VECTOR_INIT, AST_VECTOR_SIZE, auto_unload_resource(), and LOG_WARNING.
Referenced by handle_refresh(), and manager_moduleload().
int ast_register_application2 | ( | const char * | app, |
int(*)(struct ast_channel *, const char *) | execute, | ||
const char * | synopsis, | ||
const char * | description, | ||
void * | mod | ||
) |
Register an application.
app | Short name of the application |
execute | a function callback to execute the application. It should return non-zero if the channel needs to be hung up. |
synopsis | a short description (one line synopsis) of the application |
description | long description with all of the details about the use of the application |
mod | module this application belongs to |
This registers an application with Asterisk's internal application list.
0 | success |
-1 | failure. |
Register an application.
Definition at line 103 of file pbx_app.c.
References app, ast_app::arguments, ast_calloc, ast_free, ast_log, ast_module_name(), AST_RWLIST_INSERT_BEFORE_CURRENT, AST_RWLIST_INSERT_TAIL, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, AST_STATIC_DOC, ast_string_field_init, ast_string_field_set, ast_strlen_zero(), ast_verb, AST_XML_DOC, ast_xmldoc_build_arguments(), ast_xmldoc_build_description(), ast_xmldoc_build_seealso(), ast_xmldoc_build_synopsis(), ast_xmldoc_build_syntax(), COLOR_BRCYAN, COLORIZE, COLORIZE_FMT, ast_app::description, execute(), LOG_WARNING, pbx_findapp_nolock(), ast_app::seealso, synopsis, ast_app::syntax, and tmp().
Referenced by ast_msg_init(), load_module(), load_pbx_builtins(), and load_pbx_variables().
int ast_unload_resource | ( | const char * | resource_name, |
enum | ast_module_unload_mode | ||
) |
Unload a module.
resource_name | The name of the module to unload. |
ast_module_unload_mode | The force flag. This should be set using one of the AST_FORCE flags. |
This function unloads a module. It will only unload modules that are not in use (usecount not zero), unless AST_FORCE_FIRM or AST_FORCE_HARD is specified. Setting AST_FORCE_FIRM or AST_FORCE_HARD will unload the module regardless of consequences (NOT RECOMMENDED).
0 | on success. |
-1 | on error. |
Definition at line 1448 of file loader.c.
References auto_unload_resource(), and NULL.
Referenced by ast_ari_asterisk_unload_module(), ast_load_resource(), ast_refresh_resource(), auto_unload_resource(), handle_unload(), manager_moduleload(), and unload_module().
int ast_unregister_application | ( | const char * | app | ) |
Unregister an application.
app | name of the application (does not have to be the same string as the one that was registered) |
This unregisters an application from Asterisk's internal application list.
0 | success |
-1 | failure |
Definition at line 392 of file pbx_app.c.
References app, ast_free, ast_rdlock_contexts(), AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_string_field_free_memory, ast_unlock_contexts(), ast_verb, NULL, and unreference_cached_app().
Referenced by __unload_module(), load_module(), message_shutdown(), unload_module(), unload_parking_applications(), unload_pbx_builtins(), and unload_pbx_variables().
int ast_update_module_list | ( | int(*)(const char *module, const char *description, int usecnt, const char *status, const char *like, enum ast_module_support_level support_level) | modentry, |
const char * | like | ||
) |
Ask for a list of modules, descriptions, use counts and status.
modentry | A callback to an updater function. |
like |
For each of the modules loaded, modentry will be executed with the resource, description, and usecount values of each particular module.
Definition at line 2737 of file loader.c.
References alpha_module_list_create(), AST_DLLIST_LOCK, AST_DLLIST_UNLOCK, AST_VECTOR_FREE, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_module_info::description, ast_module::flags, ast_module::info, ast_module::resource, ast_module::running, ast_module_info::support_level, and ast_module::usecount.
Referenced by ast_var_Modules(), and handle_modlist().
int ast_update_module_list_condition | ( | int(*)(const char *module, const char *description, int usecnt, const char *status, const char *like, enum ast_module_support_level support_level, void *data, const char *condition) | modentry, |
const char * | like, | ||
void * | data, | ||
const char * | condition | ||
) |
Ask for a list of modules, descriptions, use counts and status.
modentry | A callback to an updater function |
like | |
data | Data passed into the callback for manipulation |
condition | The condition to meet |
For each of the modules loaded, modentry will be executed with the resource, description, and usecount values of each particular module.
Definition at line 2792 of file loader.c.
References alpha_module_list_create(), AST_DLLIST_LOCK, AST_DLLIST_UNLOCK, AST_VECTOR_FREE, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_module_info::description, ast_module::flags, ast_module::info, ast_module::resource, ast_module::running, ast_module_info::support_level, and ast_module::usecount.
Referenced by ast_ari_asterisk_get_module().
int ast_update_module_list_data | ( | int(*)(const char *module, const char *description, int usecnt, const char *status, const char *like, enum ast_module_support_level support_level, void *data) | modentry, |
const char * | like, | ||
void * | data | ||
) |
Ask for a list of modules, descriptions, use counts and status.
modentry | A callback to an updater function |
like | |
data | Data passed into the callback for manipulation |
For each of the modules loaded, modentry will be executed with the resource, description, and usecount values of each particular module.
Definition at line 2764 of file loader.c.
References alpha_module_list_create(), AST_DLLIST_LOCK, AST_DLLIST_UNLOCK, AST_VECTOR_FREE, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_module_info::description, ast_module::flags, ast_module::info, ast_module::resource, ast_module::running, ast_module_info::support_level, and ast_module::usecount.
Referenced by ast_ari_asterisk_list_modules().
void ast_update_use_count | ( | void | ) |
Notify when usecount has been changed.
This function calculates use counts and notifies anyone trying to keep track of them. It should be called whenever your module's usecount changes.
Definition at line 2698 of file loader.c.
References AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, and loadupdate::updater.
Referenced by __ast_module_ref(), __ast_module_unref(), __ast_module_user_add(), __ast_module_user_hangup_all(), __ast_module_user_remove(), auto_unload_resource(), ooh323_hangup(), ooh323_new(), ooh323c_call_thread(), start_resource(), and unistim_new().
|
static |