Asterisk - The Open Source Telephony Project
18.5.0
|
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_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" |
Module configuration file.
Definition at line 59 of file module.h.
Referenced by loader_config_init().
#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__) |
Hold a reference to the module.
mod | Module to reference |
Definition at line 443 of file module.h.
Referenced by __ast_datastore_alloc(), action_dahdishowchannels(), allocate_subscription_tree(), alsa_new(), ast_iax2_new(), ast_sip_session_add_supplements(), ast_srtp_create(), bridge_builtin_set_limits(), dahdi_new(), get_lock(), instance_created_observer(), mgcp_new(), mixmonitor_exec(), module_reffed_deps_add(), moh_alloc(), moh_files_alloc(), my_on_hook(), newpvt(), ooh323_new(), ooh323c_start_call_thread(), oss_new(), phone_check_exception(), phone_new(), sdp_crypto_alloc(), sip_create_publication(), sip_handle_cc(), sip_new(), skinny_new(), and smdi_load().
#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.
Definition at line 455 of file module.h.
Referenced by __ast_cli_generator(), __ast_sorcery_object_type_insert_wizard(), agi_handle_command(), ast_app_exec_sub(), ast_app_expand_sub_args(), ast_cli_command_full(), ast_hook_send_action(), ast_rtp_instance_new(), ast_timer_open(), fax_session_new(), fax_session_reserve(), find_best_technology(), get_filestream(), and process_message().
#define ast_module_shutdown_ref | ( | mod | ) | __ast_module_shutdown_ref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Prevent unload of the module before shutdown.
mod | Module to hold |
Definition at line 464 of file module.h.
Referenced by __ast_bucket_scheme_register(), __ast_codec_register_with_format(), __ast_format_interface_register(), load_module(), and start_resource().
#define ast_module_unref | ( | mod | ) | __ast_module_unref(mod, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Release a reference to the module.
mod | Module to release |
Definition at line 469 of file module.h.
Referenced by __ast_cli_generator(), __ast_sorcery_object_type_insert_wizard(), action_dahdishowchannels(), agi_handle_command(), alsa_hangup(), ast_app_exec_sub(), ast_app_expand_sub_args(), ast_cli_command_full(), ast_datastore_free(), ast_hook_send_action(), ast_rtp_instance_new(), ast_sip_session_remove_supplements(), ast_srtp_destroy(), ast_timer_close(), ast_timer_open(), bridge_builtin_set_limits(), bridge_features_limits_dtor(), bridge_tech_deferred_destroy(), codec_dtor(), dahdi_destroy_channel_range(), dahdi_hangup(), destroy(), destroy_bridge(), destroy_session(), fax_session_new(), filestream_destructor(), find_best_technology(), get_filestream(), iax2_predestroy(), instance_destroying_observer(), instance_destructor(), local_ast_moh_cleanup(), lock_free(), mgcp_hangup(), mixmonitor_exec(), mixmonitor_thread(), module_destroy(), modules_shutdown(), my_on_hook(), newpvt(), onCallCleared(), ooh323_destroy(), ooh323_hangup(), ooh323c_call_thread(), oss_hangup(), phone_check_exception(), phone_hangup(), process_message(), publication_destroy_fn(), res_sdp_crypto_dtor(), sip_cc_monitor_destructor(), sip_hangup(), skinny_hangup(), smart_bridge_operation(), smdi_interface_destroy(), sorcery_object_wizard_destructor(), and subscription_tree_destructor().
#define ast_module_user_add | ( | chan | ) | __ast_module_user_add(AST_MODULE_SELF, chan) |
Definition at line 426 of file module.h.
Referenced by ast_calendar_register(), canmatch(), exec(), exists(), matchmore(), nbs_new(), smdi_msg_read(), and smdi_msg_retrieve_read().
#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) |
Definition at line 427 of file module.h.
Referenced by ast_calendar_unregister(), canmatch(), exec(), exists(), matchmore(), nbs_destroy(), smdi_msg_read(), and smdi_msg_retrieve_read().
#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. |
Definition at line 610 of file module.h.
Referenced by load_module().
#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. |
Definition at line 626 of file module.h.
Referenced by load_module(), and load_parking_applications().
#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.
Definition at line 46 of file module.h.
Referenced by ast_beep_stop(), ast_cel_backend_register(), ast_manager_event_blob_create(), ast_sounds_get_index_for_file(), chan_misdn_log(), do_reload(), find_member_by_queuename_and_interface(), handle_cli_realtime_mysql_status(), handle_cli_realtime_pgsql_status(), load_module(), load_values_config(), ooh323_convert_hangupcause_h323ToAsterisk(), realtime_ldap_status(), reload(), reload_module(), unload_module(), and vm_msg_play().
#define SCOPED_MODULE_USE | ( | module | ) | RAII_VAR(struct ast_module *, __self__ ## __LINE__, ast_module_ref(module), ast_module_unref) |
Macro to safely ref and unref the self module for the current scope
Definition at line 665 of file module.h.
Referenced by ast_ari_events_event_websocket_ws_established_cb(), ast_parking_blind_transfer_park(), ast_parking_is_exten_park(), ast_parking_park_bridge_channel(), ast_parking_park_call(), ast_websocket_uri_cb(), and feature_park_call().
enum ast_module_flags |
Enumerator | |
---|---|
AST_MODFLAG_DEFAULT | |
AST_MODFLAG_GLOBAL_SYMBOLS | |
AST_MODFLAG_LOAD_ORDER |
Used to specify which modules should be returned by ast_module_helper.
Definition at line 127 of file module.h.
Definition at line 320 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.
Enumerator | |
---|---|
AST_MODULE_SUPPORT_UNKNOWN | |
AST_MODULE_SUPPORT_CORE | |
AST_MODULE_SUPPORT_EXTENDED | |
AST_MODULE_SUPPORT_DEPRECATED |
struct ast_module* __ast_module_ref | ( | struct ast_module * | mod, |
const char * | file, | ||
int | line, | ||
const char * | func | ||
) |
Definition at line 2698 of file loader.c.
References __ao2_ref(), ast_atomic_fetchadd_int(), ast_update_use_count(), 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 2714 of file loader.c.
References __ast_module_ref(), 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 2724 of file loader.c.
References __ast_module_ref(), 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 2734 of file loader.c.
References __ao2_ref(), ast_atomic_fetchadd_int(), ast_update_use_count(), ast_module::ref_debug, and ast_module::usecount.
struct ast_module_user* __ast_module_user_add | ( | struct ast_module * | , |
struct ast_channel * | |||
) |
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 * | ) |
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 ast_unload_resource().
void __ast_module_user_remove | ( | struct ast_module * | , |
struct ast_module_user * | |||
) |
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 1819 of file loader.c.
References AST_DLLIST_LOCK, AST_DLLIST_UNLOCK, ast_test_suite_event_notify, load_resource(), and NULL.
Referenced by ast_ari_asterisk_load_module(), 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 2666 of file loader.c.
References AST_LIST_INSERT_HEAD, AST_LIST_LOCK, AST_LIST_UNLOCK, ast_malloc, tmp(), and loadupdate::updater.
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 2681 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_sip.so" |
1 | if true |
0 | if false |
Check if module with the name given is loaded.
Definition at line 2653 of file loader.c.
References ast_strlen_zero, find_resource(), 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(), 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. |
Definition at line 1374 of file loader.c.
References AST_DLLIST_LOCK, AST_DLLIST_TRAVERSE, AST_DLLIST_UNLOCK, AST_MODULE_HELPER_LOAD, ast_strdup, module_load_helper(), module_matches_helper_type(), NULL, and ast_module::resource.
Referenced by handle_debug(), handle_load(), handle_modlist(), 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(), resource_list_recursive_decline(), start_resource_list(), and unload_dynamic_module().
void ast_module_register | ( | const struct ast_module_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, ast_module::info, sip_to_pjsip::info(), loader_ready, ast_module_info::name, 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, ast_module_info::self, and ast_module::users.
Referenced by get_name_from_resource(), and 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 1562 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_info::description, ast_module::flags, ast_module::info, LOG_WARNING, publish_reload_message(), queue_reload_request(), ast_module_info::reload, 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_moh_reload(), handle_core_reload(), handle_reload(), manager_moduleload(), and monitor_sig_flags().
const char* ast_module_support_level_to_string | ( | enum ast_module_support_level | support_level | ) |
Definition at line 2755 of file loader.c.
Referenced by identify_module(), modlist_modentry(), and process_module_list().
void ast_module_unregister | ( | const struct ast_module_info * | ) |
Definition at line 768 of file loader.c.
References ast_cli_unregister_multiple(), ast_debug, AST_DLLIST_LOCK, AST_DLLIST_REMOVE_CURRENT, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END, AST_DLLIST_UNLOCK, ast_module::info, module_destroy(), ast_module_info::name, NULL, and ast_module::usecount.
Referenced by get_name_from_resource().
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 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::docsrc, ast_app::execute, LOG_WARNING, pbx_findapp_nolock(), ast_app::seealso, 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 1229 of file loader.c.
References __ast_module_user_hangup_all(), AST_DLLIST_LOCK, AST_DLLIST_UNLOCK, AST_FORCE_FIRM, ast_log, ast_test_suite_event_notify, ast_update_use_count(), ast_verb, ast_module::declined, error(), find_resource(), ast_module::flags, ast_module::info, LOG_WARNING, publish_unload_message(), ast_module::resource, ast_module::running, ast_module_info::unload, unload_dynamic_module(), and ast_module::usecount.
Referenced by ast_ari_asterisk_unload_module(), 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 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 2567 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 2622 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 2594 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 calulates use counts and notifies anyone trying to keep track of them. It should be called whenever your module's usecount changes.
Definition at line 2528 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(), ast_unload_resource(), handle_request_do(), ooh323_hangup(), ooh323_new(), ooh323c_call_thread(), sip_request_call(), start_resource(), and unistim_new().
|
static |