135{ 0x87, 0x76, 0x79, 0x35, 0x23, 0xea, 0x3a, 0xd3,
136 0x25, 0x2a, 0xbb, 0x35, 0x87, 0xe4, 0x22, 0x24 };
144#define STR_APPEND_TEXT(txt, str) \
145 ast_str_append(str, 0, "%s%s", \
146 ast_str_strlen(*(str)) > 0 ? ", " : "", \
156#if defined(HAVE_PERMANENT_DLOPEN) || defined(AST_XML_DOCS)
160 const char *last_three;
167 len = strlen(resource);
169 last_three = &resource[
len-3];
170 if (!strcasecmp(last_three,
".so")) {
194#if defined(HAVE_PERMANENT_DLOPEN)
195#define FIRST_DLOPEN 999
199struct info_list_obj {
205static struct info_list_obj *info_list_obj_alloc(
const char *
name,
208 struct info_list_obj *new_entry;
216 strcpy(new_entry->name,
name);
217 new_entry->info =
info;
218 new_entry->dlopened = FIRST_DLOPEN;
225static void manual_mod_reg(
const void *lib,
const char *resource)
227 struct info_list_obj *obj_tmp;
235 if (obj_tmp->dlopened == FIRST_DLOPEN) {
236 obj_tmp->dlopened = 1;
247static void manual_mod_unreg(
const char *resource)
249 struct info_list_obj *obj_tmp;
351#define AST_MODULE_LOAD_UNKNOWN_STRING "Unknown"
368 return strcasecmp(
a->resource,
b->resource);
373 int preload_diff = (int)
b->flags.preload - (
int)
a->flags.preload;
393 return a_pri - b_pri;
487 int ref_enhancers,
int isoptional)
496 if (isoptional && !dep) {
617 if (!mod || !mod->
info) {
668 fprintf(stderr,
"Allocation failure during startup.\n");
714#if defined(HAVE_PERMANENT_DLOPEN)
716 struct info_list_obj *obj_tmp =
ao2_find(info_list,
info->name,
720 obj_tmp = info_list_obj_alloc(
info->name,
info);
880 for (pos = 0, x = 0; x < 16; x++)
881 pos += sprintf(
buf + pos,
" %02hhx", *
d++);
888#define key_matches(a, b) (memcmp((a), (b), 16) == 0)
893 unsigned char digest[16];
911 if (
len > 3 && !strcasecmp(
name +
len - 3,
".so")) {
924 return strncasecmp(name1, name2, baselen1);
966#if defined(HAVE_PERMANENT_DLOPEN)
968 manual_mod_unreg(
name);
973#if defined(HAVE_RTLD_NOLOAD)
989 lib = dlopen(fn, RTLD_LAZY | RTLD_NOLOAD);
1002#if defined(HAVE_RTLD_NOLOAD)
1023#if defined(HAVE_RTLD_NOLOAD)
1061 const char *filename,
int flags,
unsigned int suppress_logging)
1067 mod =
ast_calloc(1,
sizeof(*mod) + strlen(resource_in) + strlen(so_ext) + 1);
1072 sprintf(mod->
resource,
"%s%s", resource_in, so_ext);
1075 mod->
lib = dlopen(filename,
flags);
1076#if defined(HAVE_PERMANENT_DLOPEN)
1086 module_load_error(
"Module '%s' did not register itself during load\n", resource_in);
1092 if (suppress_logging) {
1098#if defined(HAVE_PERMANENT_DLOPEN)
1125 resource_in,
c == 1 ?
"dependency" :
"dependencies",
ast_str_buffer(list));
1149 size_t resource_in_len = strlen(resource_in);
1150 const char *so_ext =
"";
1152 if (resource_in_len < 4 || strcasecmp(resource_in + resource_in_len - 3,
".so")) {
1175 int somethingchanged;
1185 somethingchanged = 0;
1189 ast_debug(1,
"Passing on %s: its use count is %d\n",
1199 somethingchanged = 1;
1202 if (!somethingchanged) {
1207 somethingchanged = 1;
1211 }
while (somethingchanged);
1307 ast_log(
LOG_NOTICE,
"Unloading module '%s' that previously declined to load\n", resource_name);
1339 ast_log(
LOG_WARNING,
"Failed to unload %lu module%s automatically (%s could not be unloaded)\n", num_deps,
ESS(num_deps), depname);
1342 for (i++; i < num_deps; i++) {
1361 ast_log(
LOG_WARNING,
"%s unload failed, '%s' has use count %d\n", recursive ?
"Recursive soft" :
"Soft", resource_name, mod->
usecount);
1377 ast_log(
LOG_WARNING,
"** Dangerous **: Unloading resource anyway, at user request\n");
1421 ast_log(
LOG_WARNING,
"Failed to load module '%s' again automatically\n", resource_name);
1438 return res ? -1 : 0;
1487 char *filename_merged =
NULL;
1490 dir_name +=
word->moddir_len;
1495 if (
ast_asprintf(&filename_merged,
"%s/%s", dir_name, filename) < 0) {
1499 filename = filename_merged;
1502 if (!strncasecmp(filename,
word->word,
word->len)) {
1519 .len = strlen(
word),
1532 int wordlen = strlen(
word);
1717 snprintf(res_buffer,
sizeof(res_buffer),
"%u",
result);
1732 goto module_reload_exit;
1736 ast_verb(3,
"The previous reload command didn't finish yet\n");
1738 goto module_reload_exit;
1755 goto module_reload_done;
1777 if (!
info->reload) {
1829 module_load_error(
"Module '%s' was not compiled with the same compile-time options as this version of Asterisk.\n", mod->
resource);
1923 struct module_vector *module_priorities,
int required,
int preload)
1940 goto prestart_error;
1948 goto prestart_error;
1953 if (module_priorities) {
1955 goto prestart_error;
1988 ast_debug(1,
"Module %s previously declined to load, unloading it first before loading again\n", resource_name);
2033 if (!
order->resource) {
2077 struct ast_str **printmissing)
2093 if (!*printmissing) {
2095 if (!*printmissing) {
2188 ast_debug(1,
"%s has %d dependencies\n",
2198 ast_debug(1,
"%s tried to start %s but it's already declined\n",
2231 if (!printmissing) {
2248 printmissing ?
ast_str_buffer(printmissing) :
"allocation failure creating list");
2295 ast_debug(3,
"PASS %d: %-46s %d\n", attempt,
order->resource, lres);
2311 fprintf(stderr,
"*** Failed to load module %s - Required\n",
order->resource);
2342 *mod_count += count;
2404 if (!strncasecmp(v->
name,
"preload", strlen(
"preload"))) {
2406 if (!strcasecmp(v->
name,
"preload")) {
2408 }
else if (!strcasecmp(v->
name,
"preload-require")) {
2414 }
else if (!strcasecmp(v->
name,
"load")) {
2416 }
else if (!strcasecmp(v->
name,
"require")) {
2418 }
else if (!strcasecmp(v->
name,
"noload") || !strcasecmp(v->
name,
"autoload")) {
2439 struct dirent *dirent;
2442 while ((dirent = readdir(dir))) {
2443 int ld = strlen(dirent->d_name);
2450 if (strcasecmp(dirent->d_name + ld - 3,
".so"))
2476 if (strcasecmp(v->
name,
"noload")) {
2483 if (
order->builtin) {
2488 if (
order->required) {
2489 ast_log(
LOG_ERROR,
"%s is configured with '%s' and 'noload', this is impossible.\n",
2490 v->
value,
order->preload ?
"preload-require" :
"require");
2511 unsigned int load_count;
2514 int modulecount = 0;
2519 char deprecated_in[33];
2520 char removed_in[33];
2521 char replacement[129];
2523 struct timeval start_time =
ast_tvnow();
2524 struct timeval end_time;
2527 ast_verb(1,
"Asterisk Dynamic Loader Starting:\n");
2529#if defined(HAVE_PERMANENT_DLOPEN)
2531 info_list_obj_cmp_fn);
2533 fprintf(stderr,
"Module info list allocation failure.\n");
2579 char *mod_name =
NULL;
2580 struct ast_xml_xpath_results *results;
2589 if (!warning_msg || !mod_name) {
2596 deprecated_in[0] = removed_in[0] = replacement[0] = 0;
2600 struct ast_xml_node *deprecated_node, *removed_node, *replacement_node;
2604 if (deprecated_node) {
2620 if (replacement_node) {
2634 int already_butted = 0;
2636 ast_str_append(&warning_msg, -1,
"Module '%s' has been loaded", mod_name);
2638 ast_str_append(&warning_msg, -1,
" but %s deprecated in Asterisk version %s",
2644 ast_str_append(&warning_msg, -1,
" %s will be removed in Asterisk version %s", already_butted ?
"and" :
"but", removed_in);
2646 ast_str_append(&warning_msg, -1,
" %s may be removed in a future release", already_butted ?
"and" :
"but");
2652 ast_str_append(&warning_msg, -1,
" Its replacement is '%s'.", replacement);
2663 ast_log(
LOG_WARNING,
"The deprecated module '%s' has been loaded and is running, it may be removed in a future version\n", cur->
resource);
2690 ast_debug(1,
"Loader time with AST_XML_DOCS: %" PRId64
".%06" PRId64
"\n", usElapsed / 1000000, usElapsed % 1000000);
2692 ast_debug(1,
"Loader time without AST_XML_DOCS: %" PRId64
".%06" PRId64
"\n", usElapsed / 1000000, usElapsed % 1000000);
2742 int total_mod_loaded = 0;
2761 return total_mod_loaded;
2768 const char *like,
void *data)
2770 int total_mod_loaded = 0;
2789 return total_mod_loaded;
2796 void *data,
const char *condition),
2797 const char *like,
void *data,
const char *condition)
2799 int conditions_met = 0;
2819 return conditions_met;
2832 return (cur !=
NULL);
2865 return cur ? 0 : -1;
2885 const char *
file,
int line,
const char *func)
Prototypes for public functions only of internal interest,.
static int copy(char *infile, char *outfile)
Utility function to copy a file.
Asterisk main include file. File version handling, generic pbx functions.
int ast_shutdown_final(void)
void ast_std_free(void *ptr)
void * ast_std_calloc(size_t nmemb, size_t size) attribute_malloc
#define ast_strdup(str)
A wrapper for strdup()
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ast_asprintf(ret, fmt,...)
A wrapper for asprintf()
#define ast_calloc(num, len)
A wrapper for calloc()
#define ast_malloc(len)
A wrapper for malloc()
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_NOLOCK
#define AO2_STRING_FIELD_CMP_FN(stype, field)
Creates a compare function for a structure string field.
#define ao2_t_alloc_options(data_size, destructor_fn, options, debug_msg)
Allocate and initialize an object.
#define ao2_find(container, arg, flags)
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
int __ao2_ref(void *o, int delta, const char *tag, const char *file, int line, const char *func)
@ OBJ_SEARCH_KEY
The arg parameter is a search key, but is not an object.
#define ao2_container_alloc_list(ao2_options, container_options, sort_fn, cmp_fn)
Allocate and initialize a list container.
#define ao2_alloc(data_size, destructor_fn)
General Asterisk PBX channel definitions.
int ast_softhangup(struct ast_channel *chan, int cause)
Softly hangup up a channel.
@ AST_SOFTHANGUP_APPUNLOAD
Standard Command Line Interface.
int ast_cli_completion_add(char *value)
Add a result to a request for completion options.
A set of macros to manage doubly-linked lists.
#define AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
#define AST_DLLIST_EMPTY(head)
Checks whether the specified list contains any entries.
#define AST_DLLIST_ENTRY(type)
Declare previous/forward links inside a list entry.
#define AST_DLLIST_LOCK(head)
Locks a list.
#define AST_DLLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a list of specified type, statically initialized.
#define AST_DLLIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
#define AST_DLLIST_UNLOCK(head)
Attempts to unlock a list.
#define AST_DLLIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_DLLIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_DLLIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
#define AST_DLLIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
#define AST_DLLIST_HEAD(name, type)
Defines a structure to be used to hold a list of specified type.
#define AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END
Closes a safe loop traversal block.
int ast_file_read_dirs(const char *dir_name, ast_file_on_file on_file, void *obj, int max_depth)
Recursively iterate through files and directories up to max_depth.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
struct stasis_topic * ast_manager_get_topic(void)
Get the Stasis Message Bus API topic for AMI.
struct ast_flags ast_options
@ AST_OPT_FLAG_FULLY_BOOTED
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
enum AST_LOCK_RESULT ast_lock_path(const char *path)
Lock a filesystem path.
int ast_unlock_path(const char *path)
Unlock a path.
Configuration File Parser.
struct ast_config * ast_config_load2(const char *filename, const char *who_asked, struct ast_flags flags)
Load a config file.
#define CONFIG_STATUS_FILEMISSING
#define CONFIG_STATUS_FILEINVALID
void ast_config_destroy(struct ast_config *cfg)
Destroys a config.
const char * ast_variable_retrieve(struct ast_config *config, const char *category, const char *variable)
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
#define ast_debug(level,...)
Log a DEBUG message.
void ast_log_ap(int level, const char *file, int line, const char *function, const char *fmt, va_list ap)
#define ast_verb(level,...)
I/O Management (derived from Cheops-NG)
int ast_sd_notify(const char *state)
a wrapper for sd_notify(): notify systemd of any state changes.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
struct ast_json_payload * ast_json_payload_create(struct ast_json *json)
Create an ao2 object to pass json blobs as data payloads for stasis.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
#define AST_LIST_HEAD_INIT_NOLOCK(head)
Initializes a list head structure.
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_LIST_HEAD_DESTROY(head)
Destroys a list head structure.
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_LIST_HEAD_INIT(head)
Initializes a list head structure.
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
#define AST_LIST_LOCK(head)
Locks a list.
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
void __ast_module_unref(struct ast_module *mod, const char *file, int line, const char *func)
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.
static void publish_unload_message(const char *name, const char *status)
void ast_process_pending_reloads(void)
Process reload requests received during startup.
int modules_shutdown(void)
struct ast_module * __ast_module_ref(struct ast_module *mod, const char *file, int line, const char *func)
static struct load_order_entry * add_to_load_order(const char *resource, struct load_order *load_order, int required, int preload, int builtin)
void __ast_module_user_remove(struct ast_module *mod, struct ast_module_user *u)
void __ast_module_user_hangup_all(struct ast_module *mod)
int ast_module_check(const char *name)
Check if module exists.
static int start_resource_list(struct module_vector *resources, int *mod_count)
static int module_load_helper_on_file(const char *dir_name, const char *filename, void *obj)
void ast_update_use_count(void)
Notify when usecount has been changed.
const char * ast_module_support_level_to_string(enum ast_module_support_level support_level)
static void logged_dlclose(const char *name, void *lib)
dlclose(), with failure logging.
void ast_module_register(const struct ast_module_info *info)
void ast_module_unregister(const struct ast_module_info *info)
static int modules_loaded
Internal flag to indicate all modules have been initially loaded.
static int module_post_register(struct ast_module *mod)
static ast_mutex_t reloadlock
const char * support_level_map[]
static int load_resource_list(struct load_order *load_order, int *mod_count)
static struct ast_module * load_dynamic_module(const char *resource_in, unsigned int suppress_logging)
static void publish_load_message_type(const char *type, const char *name, const char *status)
static int module_deps_reference(struct ast_module *mod, struct ast_vector_const_string *missing)
static struct ast_module * find_resource(const char *resource, int do_lock)
static void unload_dynamic_module(struct ast_module *mod)
static int resource_name_match(const char *name1, size_t baselen1, const char *name2)
static unsigned int loader_ready
static int module_deps_missing_recursive(struct ast_module *mod, struct module_vector *missingdeps)
Recursively find required dependencies that are not running.
static char buildopt_sum[33]
static struct ast_vector_string startup_errors
static const unsigned char expected_key[]
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.
static int do_full_reload
static int auto_unload_resource(const char *resource_name, enum ast_module_unload_mode force, int recursive, struct ast_vector_const_string *dependents)
Unload a resource.
enum ast_module_load_result ast_load_resource(const char *resource_name)
Load a module.
static struct ast_str * startup_error_builder
static int loader_config_init(struct load_order *load_order)
static const char * loadresult2str(enum ast_module_load_result result)
static void module_destroy(struct ast_module *mod)
static int load_dlopen_missing(struct ast_str **list, struct ast_vector_string *deps)
static int module_reffed_deps_add(struct ast_module *mod, struct ast_module *dep, struct ast_vector_const_string *missing)
int ast_refresh_resource(const char *resource_name, enum ast_module_unload_mode force, int recursive)
Unload and load a module again.
void __ast_module_shutdown_ref(struct ast_module *mod, const char *file, int line, const char *func)
static const struct load_results_map load_results[]
int ast_loader_register(int(*v)(void))
Add a procedure to be run when modules have been updated.
static enum ast_module_load_result load_resource(const char *resource_name, unsigned int suppress_logging, struct module_vector *module_priorities, int required, int preload)
static int module_reffed_deps_add_dep_enhancers(struct ast_module *mod, struct ast_module *dep, struct ast_vector_const_string *missing)
#define AST_MODULE_LOAD_UNKNOWN_STRING
static int module_vector_cmp(struct ast_module *a, struct ast_module *b)
static int module_deps_process_reqlist(struct ast_module *mod, struct ast_vector_string *vec, struct ast_vector_const_string *missing, int ref_enhancers, int isoptional)
static struct module_list builtin_module_list
static int resource_list_recursive_decline(struct module_vector *resources, struct ast_module *mod, struct ast_str **printmissing)
static void queue_reload_request(const char *module)
struct ast_module_user * __ast_module_user_add(struct ast_module *mod, struct ast_channel *chan)
static enum ast_module_load_result start_resource_attempt(struct ast_module *mod, int *count)
static void module_load_error(const char *fmt,...)
static unsigned int inspect_module(const struct ast_module *mod)
static int printdigest(const unsigned char *d)
int ast_loader_unregister(int(*v)(void))
Remove a procedure to be run when modules are updated.
#define STR_APPEND_TEXT(txt, str)
static enum ast_module_load_result start_resource(struct ast_module *mod)
static void publish_reload_message(const char *name, enum ast_module_reload_result result)
int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode force)
Unload a module.
static int loader_builtin_init(struct load_order *load_order)
static size_t resource_name_baselen(const char *name)
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.
static int graceful_unload_possible(struct ast_module *target, struct ast_vector_const_string *dependents)
Whether or not this module should be able to be unloaded successfully, if we recursively unload any m...
#define key_matches(a, b)
static char * get_name_from_resource(const char *resource)
static int module_matches_helper_type(struct ast_module *mod, enum ast_module_helper_type type)
static int verify_key(const unsigned char *key)
const char * ast_module_name(const struct ast_module *mod)
Get the name of a module.
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.
struct ast_module * __ast_module_running_ref(struct ast_module *mod, const char *file, int line, const char *func)
static struct ast_module * load_dlopen(const char *resource_in, const char *so_ext, const char *filename, int flags, unsigned int suppress_logging)
static int is_module_loaded(const char *resource_name)
Check to see if the given resource is loaded.
static int alpha_module_list_create(struct module_vector *alpha_module_list)
static void publish_load_message(const char *name, enum ast_module_load_result result)
static void module_load_helper(const char *word)
enum ast_module_reload_result ast_module_reload(const char *name)
Reload asterisk modules.
static int module_vector_strcasecmp(struct ast_module *a, struct ast_module *b)
static struct ast_module *volatile resource_being_loaded
Asterisk locking-related definitions:
#define ast_mutex_unlock(a)
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
#define ast_mutex_trylock(a)
#define AST_MUTEX_DEFINE_STATIC(mutex)
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
#define EVENT_FLAG_SYSTEM
struct stasis_message_type * ast_manager_get_generic_type(void)
Get the stasis_message_type for generic messages.
void MD5Update(struct MD5Context *context, unsigned char const *buf, unsigned len)
void MD5Init(struct MD5Context *context)
void MD5Final(unsigned char digest[16], struct MD5Context *context)
Asterisk module definitions.
@ AST_MODFLAG_GLOBAL_SYMBOLS
#define ast_module_unref(mod)
Release a reference to the module.
#define ast_module_ref(mod)
Hold a reference to the module.
#define ast_module_shutdown_ref(mod)
Prevent unload of the module before shutdown.
#define AST_MODULE_CONFIG
Module configuration file.
@ AST_MODULE_SUPPORT_DEPRECATED
@ AST_MODULE_SUPPORT_CORE
@ AST_MODULE_SUPPORT_EXTENDED
@ AST_MODULE_SUPPORT_UNKNOWN
ast_module_reload_result
Possible return types for ast_module_reload.
@ AST_MODULE_RELOAD_IN_PROGRESS
@ AST_MODULE_RELOAD_QUEUED
@ AST_MODULE_RELOAD_SUCCESS
@ AST_MODULE_RELOAD_ERROR
@ AST_MODULE_RELOAD_NOT_IMPLEMENTED
@ AST_MODULE_RELOAD_NOT_FOUND
@ AST_MODULE_RELOAD_UNINITIALIZED
@ AST_MODULE_LOAD_PRIORITY
@ AST_MODULE_LOAD_FAILURE
Module could not be loaded properly.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
@ AST_MODULE_HELPER_RELOAD
@ AST_MODULE_HELPER_LOADED
@ AST_MODULE_HELPER_UNLOAD
@ AST_MODULE_HELPER_RUNNING
#define ast_opt_lock_confdir
#define ast_opt_ref_debug
struct timeval ast_lastreloadtime
Asterisk file paths, configured in asterisk.conf.
const char * ast_config_AST_MODULE_DIR
const char * ast_config_AST_CONFIG_DIR
struct stasis_message * stasis_message_create(struct stasis_message_type *type, void *data)
Create a new message.
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
int ast_str_set_va(struct ast_str **buf, ssize_t max_len, const char *fmt, va_list ap)
Set a dynamic string from a va_list.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true"....
static force_inline int attribute_pure ast_strlen_zero(const char *s)
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Main Channel structure associated with a channel.
Structure used to handle boolean flags.
Abstract JSON element (object, array, string, int, ...).
enum ast_module_load_result(* load)(void)
enum ast_module_support_level support_level
const char buildopt_sum[33]
const char *const char * optional_modules
Comma-separated list of optionally required modules.
const char * enhances
Modules that we provide enhanced functionality for.
struct ast_module_user::@361 entry
struct ast_channel * chan
struct module_user_list users
struct ast_module::@363 entry
struct ast_vector_string requires
struct ast_vector_string optional_modules
struct module_vector reffed_deps
Vector holding pointers to modules we have a reference to.
unsigned int keepuntilshutdown
const struct ast_module_info * info
struct ast_module::@362 flags
struct ast_vector_string enhances
Support for dynamic strings.
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
String vector definitions.
struct load_order_entry::@366 entry
struct loadupdate::@364 entry
struct reload_queue_item::@365 entry
A vector of strings commonly used throughout this module.
list of users found in the config file
Handy terminal functions for vt* terms.
char * term_color(char *outbuf, const char *inbuf, int fgcolor, int bgcolor, int maxout)
Colorize a specified string by adding terminal color codes.
#define ast_test_suite_event_notify(s, f,...)
static struct aco_type item
int64_t ast_tvdiff_us(struct timeval end, struct timeval start)
Computes the difference (in microseconds) between two struct timeval instances.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
int error(const char *format,...)
#define ast_test_flag(p, flag)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Vector container support.
#define AST_VECTOR_RESET(vec, cleanup)
Reset vector.
#define AST_VECTOR_ELEM_CLEANUP_NOOP(elem)
Vector element cleanup that does nothing.
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
#define AST_VECTOR_INSERT_AT(vec, idx, elem)
Insert an element at a specific position in a vector, growing the vector if needed.
#define AST_VECTOR_REMOVE_CMP_ORDERED(vec, value, cmp, cleanup)
Remove an element from a vector that matches the given comparison while maintaining order.
#define AST_VECTOR_FREE(vec)
Deallocates this vector.
#define AST_VECTOR_GET_CMP(vec, value, cmp)
Get an element from a vector that matches the given comparison.
#define AST_VECTOR_ELEM_DEFAULT_CMP(elem, value)
Default comparator for AST_VECTOR_REMOVE_ELEM_UNORDERED()
#define AST_VECTOR_ADD_SORTED(vec, elem, cmp)
Add an element into a sorted vector.
#define AST_VECTOR_REMOVE(vec, idx, preserve_ordered)
Remove an element from a vector by index.
int ast_vector_string_split(struct ast_vector_string *dest, const char *input, const char *delim, int flags, int(*excludes_cmp)(const char *s1, const char *s2))
Append a string vector by splitting a string.
#define AST_VECTOR_INIT(vec, size)
Initialize a vector.
#define AST_VECTOR_APPEND(vec, elem)
Append an element to a vector, growing the vector if needed.
#define AST_VECTOR_CALLBACK_VOID(vec, callback,...)
Execute a callback on every element in a vector disregarding callback return.
#define AST_VECTOR(name, type)
Define a vector structure.
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.
struct ast_xml_node * ast_xml_node_get_children(struct ast_xml_node *node)
Get the node's children.
const char * ast_xml_get_text(struct ast_xml_node *node)
Get an element content string.
struct ast_xml_node * ast_xml_xpath_get_first_result(struct ast_xml_xpath_results *results)
Return the first result node of an XPath query.
void ast_xml_xpath_results_free(struct ast_xml_xpath_results *results)
Free the XPath results.
struct ast_xml_node * ast_xml_find_element(struct ast_xml_node *root_node, const char *name, const char *attrname, const char *attrvalue)
Find a node element by name.
struct ast_xml_xpath_results * ast_xmldoc_query(const char *fmt,...)
Execute an XPath query on the loaded XML documentation.