Asterisk - The Open Source Telephony Project  18.5.0
Data Structures | Macros | Typedefs | Enumerations | Functions
astobj2.h File Reference
#include "asterisk/compat.h"
#include "asterisk/lock.h"
#include "asterisk/linkedlists.h"
#include "asterisk/inline_api.h"
Include dependency graph for astobj2.h:

Go to the source code of this file.

Data Structures

struct  ao2_global_obj
 
struct  ao2_iterator
 When we need to walk through a container, we use an ao2_iterator to keep track of the current position. More...
 
struct  ao2_weakproxy
 This struct should be opaque, but it's size is needed. More...
 

Macros

#define ao2_alloc_with_lockobj(data_size, destructor_fn, lockobj, tag)   __ao2_alloc_with_lockobj((data_size), (destructor_fn), (lockobj), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 Allocate and initialize an object with separate locking. More...
 
#define ao2_callback_data(container, flags, cb_fn, arg, data)   __ao2_callback_data((container), (flags), (cb_fn), (arg), (data), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_cleanup(obj)   __ao2_cleanup_debug((obj), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define AO2_FIELD_CMP_FN(stype, fn_suffix, field, key_cmp, partial_key_cmp, transform, argconst)
 
#define AO2_FIELD_HASH_FN(stype, field, hash_fn)
 Creates a hash function for a structure field. More...
 
#define AO2_FIELD_TRANSFORM_CMP_FN(cmp)   ((cmp) ? 0 : CMP_MATCH)
 
#define AO2_FIELD_TRANSFORM_SORT_FN(cmp)   (cmp)
 
#define ao2_find(container, arg, flags)   __ao2_find((container), (arg), (flags), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_global_obj_ref(holder)   __ao2_global_obj_ref(&holder, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)
 
#define ao2_global_obj_release(holder)   __ao2_global_obj_replace_unref(&holder, NULL, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)
 
#define ao2_global_obj_replace(holder, obj)   __ao2_global_obj_replace(&holder, (obj), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)
 
#define ao2_global_obj_replace_unref(holder, obj)   __ao2_global_obj_replace_unref(&holder, (obj), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)
 
#define AO2_GLOBAL_OBJ_STATIC(name)
 Define a global object holder to be used to hold an ao2 object, statically initialized. More...
 
#define ao2_iterator_next(iter)   __ao2_iterator_next((iter), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_lock(a)   __ao2_lock(a, AO2_LOCK_REQ_MUTEX, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
 
#define ao2_rdlock(a)   __ao2_lock(a, AO2_LOCK_REQ_RDLOCK, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
 
#define AO2_STRING_FIELD_CASE_CMP_FN(stype, field)   AO2_FIELD_CMP_FN(stype, _cmp_fn, field, strcasecmp, strncasecmp, AO2_FIELD_TRANSFORM_CMP_FN,)
 
#define AO2_STRING_FIELD_CASE_HASH_FN(stype, field)   AO2_FIELD_HASH_FN(stype, field, ast_str_case_hash)
 
#define AO2_STRING_FIELD_CASE_SORT_FN(stype, field)   AO2_FIELD_CMP_FN(stype, _sort_fn, field, strcasecmp, strncasecmp, AO2_FIELD_TRANSFORM_SORT_FN, const)
 
#define AO2_STRING_FIELD_CMP_FN(stype, field)   AO2_FIELD_CMP_FN(stype, _cmp_fn, field, strcmp, strncmp, AO2_FIELD_TRANSFORM_CMP_FN,)
 Creates a compare function for a structure string field. More...
 
#define AO2_STRING_FIELD_HASH_FN(stype, field)   AO2_FIELD_HASH_FN(stype, field, ast_str_hash)
 Creates a hash function for a structure string field. More...
 
#define AO2_STRING_FIELD_SORT_FN(stype, field)   AO2_FIELD_CMP_FN(stype, _sort_fn, field, strcmp, strncmp, AO2_FIELD_TRANSFORM_SORT_FN, const)
 Creates a sort function for a structure string field. More...
 
#define ao2_t_callback_data(container, flags, cb_fn, arg, data, tag)   __ao2_callback_data((container), (flags), (cb_fn), (arg), (data), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 ao2_callback_data() is a generic function that applies cb_fn() to all objects in a container. It is functionally identical to ao2_callback() except that instead of taking an ao2_callback_fn *, it takes an ao2_callback_data_fn *, and allows the caller to pass in arbitrary data. More...
 
#define ao2_t_cleanup(obj, tag)   __ao2_cleanup_debug((obj), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_find(container, arg, flags, tag)   __ao2_find((container), (arg), (flags), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_global_obj_ref(holder, tag)   __ao2_global_obj_ref(&holder, (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)
 Get a reference to the object stored in the global holder. More...
 
#define ao2_t_global_obj_release(holder, tag)   __ao2_global_obj_replace_unref(&holder, NULL, (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)
 Release the ao2 object held in the global holder. More...
 
#define ao2_t_global_obj_replace(holder, obj, tag)   __ao2_global_obj_replace(&holder, (obj), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)
 Replace an ao2 object in the global holder. More...
 
#define ao2_t_global_obj_replace_unref(holder, obj, tag)   __ao2_global_obj_replace_unref(&holder, (obj), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)
 Replace an ao2 object in the global holder, throwing away any old object. More...
 
#define ao2_t_iterator_next(iter, tag)   __ao2_iterator_next((iter), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_trylock(a)   __ao2_trylock(a, AO2_LOCK_REQ_MUTEX, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
 
#define ao2_tryrdlock(a)   __ao2_trylock(a, AO2_LOCK_REQ_RDLOCK, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
 
#define ao2_trywrlock(a)   __ao2_trylock(a, AO2_LOCK_REQ_WRLOCK, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
 
#define ao2_unlock(a)   __ao2_unlock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
 
#define ao2_weakproxy_find(c, arg, flags, tag)   __ao2_weakproxy_find(c, arg, flags, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 Perform an ao2_find on a container with ao2_weakproxy objects, returning the real object. More...
 
#define ao2_wrlock(a)   __ao2_lock(a, AO2_LOCK_REQ_WRLOCK, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
 
#define OBJ_KEY   OBJ_SEARCH_KEY
 
#define OBJ_PARTIAL_KEY   OBJ_SEARCH_PARTIAL_KEY
 
#define OBJ_POINTER   OBJ_SEARCH_OBJECT
 

Typedefs

typedef int() ao2_callback_data_fn(void *obj, void *arg, void *data, int flags)
 Type of a generic callback function. More...
 
typedef int() ao2_callback_fn(void *obj, void *arg, int flags)
 Type of a generic callback function. More...
 
typedef void(* ao2_destructor_fn) (void *vdoomed)
 Typedef for an object destructor. More...
 
typedef int() ao2_hash_fn(const void *obj, int flags)
 
typedef int() ao2_sort_fn(const void *obj_left, const void *obj_right, int flags)
 Type of generic container sort function. More...
 

Enumerations

enum  _cb_results { CMP_MATCH = 0x1, CMP_STOP = 0x2 }
 A callback function will return a combination of CMP_MATCH and CMP_STOP. The latter will terminate the search in a container. More...
 
enum  ao2_alloc_opts {
  AO2_ALLOC_OPT_LOCK_MUTEX = (0 << 0), AO2_ALLOC_OPT_LOCK_RWLOCK = (1 << 0), AO2_ALLOC_OPT_LOCK_NOLOCK = (2 << 0), AO2_ALLOC_OPT_LOCK_MASK = (3 << 0),
  AO2_ALLOC_OPT_LOCK_OBJ = AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_NO_REF_DEBUG = (1 << 2)
}
 Options available when allocating an ao2 object. More...
 
enum  ao2_container_opts {
  AO2_CONTAINER_ALLOC_OPT_INSERT_BEGIN = (1 << 0), AO2_CONTAINER_ALLOC_OPT_DUPS_MASK = (3 << 1), AO2_CONTAINER_ALLOC_OPT_DUPS_ALLOW = (0 << 1), AO2_CONTAINER_ALLOC_OPT_DUPS_REJECT = (1 << 1),
  AO2_CONTAINER_ALLOC_OPT_DUPS_OBJ_REJECT = (2 << 1), AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE = (3 << 1)
}
 Options available when allocating an ao2 container object. More...
 
enum  ao2_iterator_flags { AO2_ITERATOR_DONTLOCK = (1 << 0), AO2_ITERATOR_MALLOCD = (1 << 1), AO2_ITERATOR_UNLINK = (1 << 2), AO2_ITERATOR_DESCENDING = (1 << 3) }
 
enum  ao2_lock_req { AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_RDLOCK, AO2_LOCK_REQ_WRLOCK }
 Which lock to request. More...
 
enum  search_flags {
  OBJ_UNLINK = (1 << 0), OBJ_NODATA = (1 << 1), OBJ_MULTIPLE = (1 << 2), OBJ_NOLOCK = (1 << 4),
  OBJ_SEARCH_MASK = (0x07 << 5), OBJ_SEARCH_NONE = (0 << 5), OBJ_SEARCH_OBJECT = (1 << 5), OBJ_SEARCH_KEY = (2 << 5),
  OBJ_SEARCH_PARTIAL_KEY = (4 << 5), OBJ_ORDER_MASK = (0x03 << 8), OBJ_ORDER_ASCENDING = (0 << 8), OBJ_ORDER_DESCENDING = (1 << 8),
  OBJ_ORDER_PRE = (2 << 8), OBJ_ORDER_POST = (3 << 8)
}
 Flags passed to ao2_callback_fn(), ao2_hash_fn(), and ao2_sort_fn() to modify behaviour. More...
 

Functions

void * __ao2_alloc_with_lockobj (size_t data_size, ao2_destructor_fn destructor_fn, void *lockobj, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
 
void * __ao2_callback_data (struct ao2_container *c, enum search_flags flags, ao2_callback_data_fn *cb_fn, void *arg, void *data, const char *tag, const char *file, int line, const char *func)
 
void __ao2_cleanup (void *obj)
 
void __ao2_cleanup_debug (void *obj, const char *tag, const char *file, int line, const char *function)
 
void * __ao2_find (struct ao2_container *c, const void *arg, enum search_flags flags, const char *tag, const char *file, int line, const char *func)
 
void * __ao2_global_obj_ref (struct ao2_global_obj *holder, const char *tag, const char *file, int line, const char *func, const char *name) attribute_warn_unused_result
 
void * __ao2_global_obj_replace (struct ao2_global_obj *holder, void *obj, const char *tag, const char *file, int line, const char *func, const char *name) attribute_warn_unused_result
 
int __ao2_global_obj_replace_unref (struct ao2_global_obj *holder, void *obj, const char *tag, const char *file, int line, const char *func, const char *name)
 
void * __ao2_iterator_next (struct ao2_iterator *iter, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
 
int __ao2_lock (void *a, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var)
 Lock an object. More...
 
int __ao2_trylock (void *a, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var)
 Try locking– (don't block if fail) More...
 
int __ao2_unlock (void *a, const char *file, const char *func, int line, const char *var)
 Unlock an object. More...
 
void * __ao2_weakproxy_find (struct ao2_container *c, const void *arg, enum search_flags flags, const char *tag, const char *file, int line, const char *func)
 
void ao2_iterator_cleanup (struct ao2_iterator *iter)
 
int ao2_iterator_count (struct ao2_iterator *iter)
 Get a count of the iterated container objects. More...
 
void ao2_iterator_destroy (struct ao2_iterator *iter)
 Destroy a container iterator. More...
 
struct ao2_iterator ao2_iterator_init (struct ao2_container *c, int flags) attribute_warn_unused_result
 Create an iterator for a container. More...
 
void ao2_iterator_restart (struct ao2_iterator *iter)
 Restart an iteration. More...
 
int ao2_match_by_addr (void *obj, void *arg, int flags)
 A common ao2_callback is one that matches by address. More...
 
void * ao2_object_get_lockaddr (void *obj)
 Return the mutex lock address of an object. More...
 
int ao2_ref_and_lock (void *obj)
 Increment reference count on an object and lock it. More...
 
int ao2_unlock_and_unref (void *obj)
 Unlock an object and decrement its reference count. More...
 
#define ao2_t_alloc_options(data_size, destructor_fn, options, debug_msg)   __ao2_alloc((data_size), (destructor_fn), (options), (debug_msg), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 Allocate and initialize an object. More...
 
#define ao2_alloc_options(data_size, destructor_fn, options)   __ao2_alloc((data_size), (destructor_fn), (options), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_alloc(data_size, destructor_fn, debug_msg)   __ao2_alloc((data_size), (destructor_fn), AO2_ALLOC_OPT_LOCK_MUTEX, (debug_msg), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_alloc(data_size, destructor_fn)   __ao2_alloc((data_size), (destructor_fn), AO2_ALLOC_OPT_LOCK_MUTEX, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
void * __ao2_alloc (size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
 
#define ao2_t_ref(o, delta, tag)   __ao2_ref((o), (delta), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 Reference/unreference an object and return the old refcount. More...
 
#define ao2_ref(o, delta)   __ao2_ref((o), (delta), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_bump(obj, tag)
 Bump refcount on an AO2 object by one, returning the object. More...
 
#define ao2_bump(obj)   ao2_t_bump((obj), NULL)
 
#define ao2_t_replace(dst, src, tag)
 Replace one object reference with another cleaning up the original. More...
 
#define ao2_replace(dst, src)   ao2_t_replace((dst), (src), NULL)
 
unsigned int ao2_options_get (void *obj)
 Retrieve the ao2 options used to create the object. More...
 
int __ao2_ref (void *o, int delta, const char *tag, const char *file, int line, const char *func)
 
#define AO2_WEAKPROXY()   struct ao2_weakproxy __weakproxy##__LINE__
 Macro which must be used at the beginning of weakproxy capable objects. More...
 
#define ao2_weakproxy_alloc(data_size, destructor_fn)   __ao2_weakproxy_alloc(data_size, destructor_fn, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_weakproxy_alloc(data_size, destructor_fn, tag)   __ao2_weakproxy_alloc(data_size, destructor_fn, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_weakproxy_set_object(weakproxy, obj, flags)   __ao2_weakproxy_set_object(weakproxy, obj, flags, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_weakproxy_set_object(weakproxy, obj, flags, tag)   __ao2_weakproxy_set_object(weakproxy, obj, flags, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_weakproxy_ref_object(weakproxy, delta, flags, tag)
 
#define ao2_weakproxy_ref_object(weakproxy, delta, flags)   ao2_t_weakproxy_ref_object(weakproxy, delta, flags, NULL)
 
#define ao2_weakproxy_get_object(weakproxy, flags)   __ao2_weakproxy_get_object(weakproxy, flags, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_weakproxy_get_object(weakproxy, flags, tag)   __ao2_weakproxy_get_object(weakproxy, flags, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_get_weakproxy(obj)   __ao2_get_weakproxy(obj, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_get_weakproxy(obj, tag)   __ao2_get_weakproxy(obj, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
typedef void(* ao2_weakproxy_notification_cb) (void *weakproxy, void *data)
 
void * __ao2_weakproxy_alloc (size_t data_size, ao2_destructor_fn destructor_fn, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
 Allocate an ao2_weakproxy object. More...
 
int __ao2_weakproxy_set_object (void *weakproxy, void *obj, int flags, const char *tag, const char *file, int line, const char *func)
 Associate weakproxy with obj. More...
 
int __ao2_weakproxy_ref_object (void *weakproxy, int delta, int flags, const char *tag, const char *file, int line, const char *func)
 Run ao2_t_ref on the object associated with weakproxy. More...
 
void * __ao2_weakproxy_get_object (void *weakproxy, int flags, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
 Get the object associated with weakproxy. More...
 
int ao2_weakproxy_subscribe (void *weakproxy, ao2_weakproxy_notification_cb cb, void *data, int flags)
 Request notification when weakproxy points to NULL. More...
 
int ao2_weakproxy_unsubscribe (void *weakproxy, ao2_weakproxy_notification_cb cb, void *data, int flags)
 Remove notification of real object destruction. More...
 
void * __ao2_get_weakproxy (void *obj, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
 Get the weakproxy attached to obj. More...
 

Object Containers

Here start declarations of containers.

#define ao2_t_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn, tag)   __ao2_container_alloc_hash((ao2_options), (container_options), (n_buckets), (hash_fn), (sort_fn), (cmp_fn), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 Allocate and initialize a hash container with the desired number of buckets. More...
 
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)   __ao2_container_alloc_hash((ao2_options), (container_options), (n_buckets), (hash_fn), (sort_fn), (cmp_fn), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_container_alloc_list(ao2_options, container_options, sort_fn, cmp_fn, tag)   __ao2_container_alloc_list((ao2_options), (container_options), (sort_fn), (cmp_fn), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 Allocate and initialize a list container. More...
 
#define ao2_container_alloc_list(ao2_options, container_options, sort_fn, cmp_fn)   __ao2_container_alloc_list((ao2_options), (container_options), (sort_fn), (cmp_fn), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_container_alloc_rbtree(ao2_options, container_options, sort_fn, cmp_fn, tag)   __ao2_container_alloc_rbtree((ao2_options), (container_options), (sort_fn), (cmp_fn), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 Allocate and initialize a red-black tree container. More...
 
#define ao2_container_alloc_rbtree(ao2_options, container_options, sort_fn, cmp_fn)   __ao2_container_alloc_rbtree((ao2_options), (container_options), (sort_fn), (cmp_fn), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_container_clone(orig, flags, tag)   __ao2_container_clone(orig, flags, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_container_clone(orig, flags)   __ao2_container_clone(orig, flags, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
typedef void() ao2_prnt_fn(void *where, const char *fmt,...)
 Print output. More...
 
typedef void() ao2_prnt_obj_fn(void *v_obj, void *where, ao2_prnt_fn *prnt)
 Print object key. More...
 
struct ao2_container__ao2_container_alloc_hash (unsigned int ao2_options, unsigned int container_options, unsigned int n_buckets, ao2_hash_fn *hash_fn, ao2_sort_fn *sort_fn, ao2_callback_fn *cmp_fn, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
 
struct ao2_container__ao2_container_alloc_list (unsigned int ao2_options, unsigned int container_options, ao2_sort_fn *sort_fn, ao2_callback_fn *cmp_fn, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
 
struct ao2_container__ao2_container_alloc_rbtree (unsigned int ao2_options, unsigned int container_options, ao2_sort_fn *sort_fn, ao2_callback_fn *cmp_fn, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
 
int ao2_container_count (struct ao2_container *c)
 Returns the number of elements in a container. More...
 
int ao2_container_dup (struct ao2_container *dest, struct ao2_container *src, enum search_flags flags)
 Copy all object references in the src container into the dest container. More...
 
int ao2_container_dup_weakproxy_objs (struct ao2_container *dest, struct ao2_container *src, enum search_flags flags)
 Copy object references associated with src container weakproxies into the dest container. More...
 
struct ao2_container__ao2_container_clone (struct ao2_container *orig, enum search_flags flags, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
 Create a clone/copy of the given container. More...
 
void ao2_container_dump (struct ao2_container *self, enum search_flags flags, const char *name, void *where, ao2_prnt_fn *prnt, ao2_prnt_obj_fn *prnt_obj)
 Display contents of the specified container. More...
 
void ao2_container_stats (struct ao2_container *self, enum search_flags flags, const char *name, void *where, ao2_prnt_fn *prnt)
 Display statistics of the specified container. More...
 
int ao2_container_check (struct ao2_container *self, enum search_flags flags)
 Perform an integrity check on the specified container. More...
 
int ao2_container_register (const char *name, struct ao2_container *self, ao2_prnt_obj_fn *prnt_obj)
 Register a container for CLI stats and integrity check. More...
 
void ao2_container_unregister (const char *name)
 Unregister a container for CLI stats and integrity check. More...
 

Object Management

Here we have functions to manage objects.

We can use the functions below on any kind of object defined by the user.

#define ao2_t_link(container, obj, tag)   __ao2_link((container), (obj), 0, (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 Add an object to a container. More...
 
#define ao2_link(container, obj)   __ao2_link((container), (obj), 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_link_flags(container, obj, flags, tag)   __ao2_link((container), (obj), (flags), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 Add an object to a container. More...
 
#define ao2_link_flags(container, obj, flags)   __ao2_link((container), (obj), (flags), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_unlink(container, obj, tag)   __ao2_unlink((container), (obj), 0, (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 Remove an object from a container. More...
 
#define ao2_unlink(container, obj)   __ao2_unlink((container), (obj), 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
#define ao2_t_unlink_flags(container, obj, flags, tag)   __ao2_unlink((container), (obj), (flags), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 Remove an object from a container. More...
 
#define ao2_unlink_flags(container, obj, flags)   __ao2_unlink((container), (obj), (flags), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
int __ao2_link (struct ao2_container *c, void *obj_new, int flags, const char *tag, const char *file, int line, const char *func)
 
void * __ao2_unlink (struct ao2_container *c, void *obj, int flags, const char *tag, const char *file, int line, const char *func)
 
#define ao2_t_callback(c, flags, cb_fn, arg, tag)   __ao2_callback((c), (flags), (cb_fn), (arg), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)
 ao2_callback() is a generic function that applies cb_fn() to all objects in a container, as described below. More...
 
#define ao2_callback(c, flags, cb_fn, arg)   __ao2_callback((c), (flags), (cb_fn), (arg), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
void * __ao2_callback (struct ao2_container *c, enum search_flags flags, ao2_callback_fn *cb_fn, void *arg, const char *tag, const char *file, int line, const char *func)
 

Detailed Description

Object Model implementing objects and containers.

Definition in file astobj2.h.

Macro Definition Documentation

◆ ao2_alloc

#define ao2_alloc (   data_size,
  destructor_fn 
)    __ao2_alloc((data_size), (destructor_fn), AO2_ALLOC_OPT_LOCK_MUTEX, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 411 of file astobj2.h.

Referenced by __allocate_taskprocessor(), __ast_bucket_scheme_register(), __ast_sorcery_object_field_register(), __ast_sorcery_object_type_insert_wizard(), __ast_sorcery_wizard_register(), __ast_test_suite_event_notify(), __features_config_alloc(), _ast_odbc_request_obj2(), add_calltoken_ignore(), add_column_name(), agent_pvt_new(), alias_mailbox_mapping_create(), alloc_new_parking_lot(), alloc_notify_task_data(), alloc_smdi_interface(), allocate_subscription_tree(), ao2_dup_event(), app_data_create(), applicationmap_item_alloc(), ast_add_hint(), ast_ari_add_handler(), ast_ari_remove_handler(), ast_ari_websocket_session_create(), ast_attended_transfer_message_create(), ast_blind_transfer_message_create(), ast_bridge_blob_create(), ast_bridge_blob_create_from_snapshots(), ast_bridge_transfer_blind(), ast_calendar_event_alloc(), ast_cdr_engine_term(), ast_cel_general_config_alloc(), ast_channel_dialed_causes_add(), ast_channel_get_vars(), ast_channel_suppress(), ast_config_hook_register(), ast_datastores_alloc_datastore(), ast_dns_resolve_recurring(), ast_endpoint_blob_create(), ast_json_payload_create(), ast_media_index_create(), ast_msg_alloc(), ast_multi_channel_blob_create(), ast_multi_object_blob_create(), ast_mwi_blob_create(), ast_parked_call_payload_create(), ast_parking_register_bridge_features(), ast_phoneprov_provider_register(), ast_res_pjsip_initialize_configuration(), ast_rtp_ice_add_cand(), ast_rtp_ice_add_remote_candidate(), ast_rtp_instance_new(), ast_rtp_publish_rtcp_message(), ast_rtp_rtcp_report_alloc(), ast_serializer_shutdown_group_alloc(), ast_sip_channel_pvt_alloc(), ast_sip_dialog_set_endpoint(), ast_sip_dialog_set_serializer(), ast_sip_initialize_sorcery_auth(), ast_sip_initialize_sorcery_location(), ast_sip_initialize_sorcery_transport(), ast_sip_publish_client_alloc_datastore(), ast_sip_schedule_task(), ast_sip_session_alloc(), ast_sip_session_alloc_datastore(), ast_sip_session_register_sdp_handler(), ast_sip_session_suspend(), ast_sorcery_global_observer_add(), ast_sorcery_instance_observer_add(), ast_sorcery_object_fields_register(), ast_sorcery_observer_add(), ast_sorcery_wizard_observer_add(), ast_taskprocessor_listener_alloc(), ast_tcptls_client_create(), ast_tcptls_server_root(), AST_TEST_DEFINE(), ast_threadpool_listener_alloc(), ast_tone_zone_alloc(), ast_unreal_alloc_stream_topology(), ast_uri_create_(), ast_websocket_sub_protocol_alloc(), ast_websocket_uri_cb(), ast_xmpp_client_config_alloc(), async_data_alloc(), async_minimal_data_alloc(), attended_transfer_properties_alloc(), auth_create(), bridge_alloc(), bridge_basic_personality_alloc(), bridge_channel_internal_alloc(), bridge_manager_create(), bridge_merge_message_create(), bridge_profile_alloc(), bridge_profile_sounds_alloc(), bucket_metadata_alloc(), build_calendar(), build_callno_limits(), build_device(), build_entity_id(), build_mansession(), build_peer(), build_profile(), build_route(), build_user(), cache_test_message_create_full(), caldav_load_calendar(), calendar_query_exec(), cdr_object_alloc(), cdr_prop_write(), cdr_read(), cdr_write(), cel_config_alloc(), chan_list_init(), channel_get_external_vars(), command_create(), conf_alloc(), conf_run(), confbridge_cfg_alloc(), consumer_create(), control_create(), control_list_create(), create_channel_blob_message(), create_cts(), create_dsn(), create_esc_entry(), create_foo_type_message(), create_message_types(), create_queue_member(), create_trunk_ref(), device_state_subscription_create(), dial_masquerade_datastore_alloc(), dialgroup_write(), endpoint_internal_create(), endpt_send_request(), event_session_alloc(), ewscal_load_calendar(), exchangecal_load_calendar(), exten_state_data_alloc(), exten_state_subscription_alloc(), extension_state_add_destroy(), fax_detect_new(), fax_gateway_new(), fax_session_new(), fax_session_reserve(), featuregroup_alloc(), featuregroup_handler(), find_or_create_temporary_state(), forkcdr_exec(), generate_parked_user(), get_filestream(), get_name_from_resource(), global_config_alloc(), hangup_data_alloc(), hepv3_config_alloc(), hepv3_create_capture_info(), hepv3_data_alloc(), ht_new(), ical_load_calendar(), indicate_data_alloc(), info_dtmf_data_alloc(), inprocess_count(), insert_test_duplicates(), insert_test_vector(), internal_state_alloc(), jingle_alloc(), jingle_config_alloc(), jingle_endpoint_alloc(), jingle_endpoint_state_create(), join_conference_bridge(), kqueue_timer_open(), load_config(), load_module(), load_odbc_config(), menu_alloc(), module_config_alloc(), msg_data_alloc(), msg_data_create(), mwi_create_state(), mwi_get_notify_data(), mwi_stasis_subscription_alloc(), mwi_subscription_alloc(), named_acl_alloc(), named_acl_config_alloc(), new_iax(), new_realtime_sqlite3_db(), nocdr_exec(), notify_ami_data_create(), notify_ami_uri_data_create(), notify_cfg_alloc(), notify_cli_data_create(), notify_cli_uri_data_create(), notify_option_alloc(), notify_option_handler(), off_nominal_async_data_alloc(), parking_config_alloc(), parking_lot_cfg_alloc(), pbx_outgoing_attempt(), peercnt_add(), pjsip_channel_cli_register(), playback_create(), presence_state_alloc(), prometheus_general_config_alloc(), proxy_from_config(), pthread_timer_open(), query_set_data_alloc(), queue_stasis_data_alloc(), realtime_common(), recording_alloc(), recurring_data_alloc(), refer_progress_alloc(), refer_progress_notification_alloc(), register_aor_core(), reload(), resetcdr_exec(), root_handler_create(), rtp_direct_media_data_create(), scheduler(), send_msg(), send_start_msg_snapshots(), sendtext_data_create(), session_details_new(), set_fn(), shutdown_data_create(), sip_create_publication(), sip_monitor_instance_init(), sip_options_endpoint_state_compositor_find_or_alloc(), sip_outbound_publish_state_alloc(), sip_outbound_publisher_alloc(), sip_outbound_registration_response_cb(), sip_outbound_registration_state_alloc(), sip_prepare_socket(), sip_tcptls_write(), sip_threadinfo_create(), skel_config_alloc(), skel_game_alloc(), skel_level_alloc(), skel_state_alloc(), sla_build_station(), sla_build_trunk(), sla_create_station_ref(), smdi_read(), sorcery_memory_cached_object_alloc(), sorcery_object_type_alloc(), stasis_app_control_record(), stasis_app_recording_options_create(), stasis_config_alloc(), stasis_message_sink_create(), stasis_subscription_statistics_create(), stasis_test_message_create(), stasis_topic_statistics_create(), t38_parameters_task_data_alloc(), task_data_create(), test_config_alloc(), test_item_alloc(), test_performance(), threadpool_alloc(), timerfd_timer_open(), transfer_data_alloc(), try_calling(), udptl_snapshot_alloc(), user_profile_alloc(), ustmtext(), websocket_client_args_create(), websocket_client_create(), websocket_server_create_impl(), worker_thread_alloc(), xml_translate(), xmpp_client_alloc(), xmpp_client_create_buddy(), xmpp_config_alloc(), and xmpp_pak_presence().

◆ ao2_alloc_options

#define ao2_alloc_options (   data_size,
  destructor_fn,
  options 
)    __ao2_alloc((data_size), (destructor_fn), (options), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
Examples:
/usr/src/asterisk-18.5.0/main/app.c.

Definition at line 406 of file astobj2.h.

Referenced by __aco_option_register(), __ast_format_cap_append(), __ast_format_interface_register(), __ast_vm_greeter_register(), __ast_vm_register(), __sip_reliable_xmit(), aco_option_register_deprecated(), agent_cfg_alloc(), agents_cfg_alloc(), aoc_publish_blob(), app_create(), application_tuple_alloc(), ast_bridge_snapshot_create(), ast_cel_backend_register(), ast_channel_snapshot_create(), ast_dns_query_set_create(), ast_dns_resolve(), ast_dns_resolve_async(), ast_endpoint_snapshot_create(), ast_extension_state3(), ast_get_namedgroups(), ast_iostream_from_fd(), ast_manager_event_blob_create(), ast_multi_channel_blob_add_channel(), ast_query_set_resolve(), ast_register_indication(), ast_sip_for_each_contact(), ast_sip_initialize_distributor(), ast_sip_session_media_state_add(), ast_sorcery_generic_alloc(), ast_str_container_add(), ast_stream_topology_alloc(), ast_vm_test_swap_table_in(), ast_xml_doc_item_alloc(), bridge_builtin_set_limits(), bridge_hook_generic(), bridge_moh_create(), bridge_snapshot_update_create(), bridge_stasis_queue_join_action(), cache_entry_create(), cel_linkedid_ref(), chan_pjsip_add_hold(), chan_pjsip_new(), channel_snapshot_base_create(), channel_snapshot_bridge_create(), channel_snapshot_caller_create(), channel_snapshot_connected_create(), channel_snapshot_dialplan_create(), channel_snapshot_hangup_create(), channel_snapshot_peer_create(), channel_snapshot_update_create(), cli_gather_contact(), conf_alloc(), context_table_create_autohints(), corosync_node_alloc(), device_state_alloc(), dns_query_alloc(), endpoint_lookup(), hash_ao2_new_node(), httpd_helper_thread(), ice_create(), media_info_alloc(), media_variant_alloc(), message_subscription_alloc(), moh_file_vector_alloc(), monitored_transport_state_callback(), native_rtp_bridge_framehook_attach(), notify_ami_channel_data_create(), persistent_endpoint_find_or_create(), pjsip_history_entry_alloc(), pjsip_logger_session_alloc(), publisher_start(), rb_ao2_new_node(), refer_attended_alloc(), registration_transport_monitor_setup(), remb_collector_alloc(), rtp_payload_type_alloc(), save_dialstatus(), send_request_data_alloc(), serializer_create(), sip_contact_status_alloc(), sip_options_aor_alloc(), sip_options_contact_callback_data_alloc(), sip_options_update_endpoint_state_compositor_aor(), sip_resolve(), sorcery_config_open(), sorcery_memory_cache_open(), sorcery_memory_cache_thrash_create(), sorcery_observer_invocation_alloc(), stale_cache_update_task_data_alloc(), stale_update_task_data_alloc(), stasis_app_bridge_playback_channel_add(), stasis_app_control_snoop(), stasis_cache_create_full(), stasis_caching_topic_create(), stasis_forward_all(), stasis_state_add_publisher(), stasis_state_add_subscriber(), stasis_state_manager_create(), stasis_topic_pool_create(), subscription_change_alloc(), test_media_add(), topic_pool_entry_alloc(), transport_state_callback(), unbound_config_alloc(), unbound_config_preapply(), unbound_resolver_alloc(), unbound_resolver_resolve(), update_create(), user_alloc(), and wait_bridge_wrapper_alloc().

◆ ao2_alloc_with_lockobj

#define ao2_alloc_with_lockobj (   data_size,
  destructor_fn,
  lockobj,
  tag 
)    __ao2_alloc_with_lockobj((data_size), (destructor_fn), (lockobj), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

Allocate and initialize an object with separate locking.

Since
14.1.0
Parameters
data_sizeThe sizeof() of the user-defined structure.
destructor_fnThe destructor function (can be NULL)
lockobjA separate ao2 object that will provide locking.
debug_msgAn ao2 object debug tracing message.
Returns
A pointer to user-data.
See also
ao2_alloc for additional details.
Note
lockobj must be a valid AO2 object.

Definition at line 433 of file astobj2.h.

Referenced by ast_sorcery_lockable_alloc().

◆ ao2_bump

#define ao2_bump (   obj)    ao2_t_bump((obj), NULL)
Examples:
/usr/src/asterisk-18.5.0/main/app.c.

Definition at line 491 of file astobj2.h.

Referenced by __ast_frdup(), __ast_frisolate(), __ast_smoother_feed(), __ast_sorcery_object_type_insert_wizard(), _ast_odbc_request_obj2(), _moh_class_malloc(), adsi_transmit_message_full(), alloc_notify_task_data(), allocate_subscription(), allocate_subscription_tree(), aoc_publish_blob(), app_create(), app_send(), append_mailbox_mapping(), application_tuple_alloc(), apply_menu_to_user(), ast_ari_bridges_set_video_source(), ast_ari_channels_create(), ast_bridge_blob_create_from_snapshots(), ast_bridge_channel_get_chan(), ast_bridge_get_snapshot(), ast_bridge_get_snapshot_by_uniqueid(), ast_bridges(), ast_cdr_get_config(), ast_cdr_message_router(), ast_cel_set_config(), ast_channel_blob_create(), ast_channel_cache_all(), ast_channel_cache_by_name(), ast_channel_snapshot_create(), ast_channel_snapshot_set(), ast_channel_start_silence_generator(), ast_channel_yank(), ast_dns_query_set_resolve_async(), ast_dns_resolve_recurring(), ast_dns_resolver_set_data(), ast_format_attribute_set(), ast_format_create_named(), ast_format_get_codec(), ast_format_joint(), ast_format_parse_sdp_fmtp(), ast_local_lock_all(), ast_moh_files_next(), ast_openvstream(), ast_rtp_bundle(), ast_rtp_codecs_get_payload(), ast_rtp_codecs_get_payload_format(), ast_rtp_codecs_payloads_set_m_type(), ast_rtp_new(), ast_rtp_on_turn_rx_rtcp_data(), ast_rtp_on_turn_rx_rtp_data(), ast_sip_create_response(), ast_sip_dialog_get_endpoint(), ast_sip_for_each_contact(), ast_sip_get_distributor_serializer(), ast_sip_get_transport_state(), ast_sip_location_create_contact(), ast_sip_schedule_task(), ast_sip_session_alloc(), ast_sip_session_create_outgoing(), ast_sip_session_media_state_clone(), ast_sip_subscription_get_endpoint(), ast_sip_transport_monitor_register_replace(), ast_slinfactory_init(), ast_slinfactory_init_with_format(), ast_sorcery_get_wizard_mapping(), ast_speech_new(), ast_stream_set_formats(), AST_TEST_DEFINE(), ast_unreal_indicate(), asterisk_start_devicestate_publishing(), asterisk_start_mwi_publishing(), audiosocket_exec(), auth_observer(), background_detect_exec(), begin_dial_prerun(), bridge_channel_internal_join(), bridge_publish_state_from_blob(), bridge_snapshot_update_create(), bucket_copy_handler(), bucket_file_copy_handler(), cache_entry_create(), cache_put(), cache_test_aggregate_calc_fn(), cache_udpate(), cancel_and_unpublish(), chan_pjsip_answer(), chan_pjsip_indicate(), channel_do_masquerade(), channel_snapshot_update_create(), chanspy_exec(), check_request_status(), cli_gather_contact(), command_prestart_get_container(), conf_set_menu_to_user(), control_create(), control_set_app(), create_jb(), create_out_of_dialog_request(), create_subscription_tree(), dahdi_translate(), dahdiscan_exec(), device_state_aggregate_calc(), dictate_exec(), dispatch_message(), distributor(), dns_query_alloc(), dns_query_recurring_resolution_callback(), dns_system_resolver_resolve(), do_waiting(), eagi_exec(), exten_state_pub_data_alloc(), exten_state_subscription_alloc(), extenspy_exec(), filter_history(), find_state_by_transport(), generic_fax_exec(), get_dial_bridge(), get_filestream(), get_log_mappings(), get_subscription(), handle_cli_moh_show_files(), handle_recordfile(), handle_stasis_state(), hangup(), ices_exec(), internal_state_alloc(), isAnsweringMachine(), linear_alloc(), link_topic_proxy(), make_silence(), measurenoise(), memory_cache_stale_check(), moh_alloc(), moh_files_write_format_change(), moh_parse_options(), mp3_exec(), mwi_contact_changed(), mwi_contact_deleted(), mwi_stasis_cb(), naptr_resolve(), native_rtp_bridge_framehook_attach(), NBScat_exec(), newpvt(), nominal_test(), off_nominal_test(), opus_clone(), opus_get(), opus_set(), payload_mapping_rx_clear_primary(), pjsip_acf_channel_read(), pjsip_show_history(), play_uri(), playtones_alloc(), prometheus_general_config_get(), publisher_client_send(), publisher_start(), pubsub_on_client_refresh(), pubsub_on_rx_refresh(), pubsub_on_rx_subscribe_request(), pubsub_on_server_timeout(), query_set_resolve(), record_exec(), recurring_resolve(), resamp_new(), ring_entry(), route_table_add(), rtp_direct_media_data_create(), rtp_payload_type_alloc(), schedule_cache_expiration(), schedule_notification(), schedule_publish_refresh(), send_contact_notify(), send_notify(), send_request_data_alloc(), send_start_msg_snapshots(), send_waveform_to_channel(), serializer_create(), set_next_mime_type(), set_read_to_slin(), sip_options_contact_callback_data_alloc(), sip_outbound_publish_callback(), sip_outbound_publish_state_alloc(), sip_outbound_publish_synchronize(), sip_outbound_publisher_alloc(), sip_outbound_publisher_init(), sip_outbound_registration_apply(), sip_outbound_registration_perform(), sip_outbound_registration_regc_alloc(), sip_outbound_registration_state_alloc(), sip_publisher_service_queue(), sip_resolve(), sip_session_refresh(), siren14_parse_sdp_fmtp(), siren7_parse_sdp_fmtp(), smdi_msg_retrieve_read(), softmix_bridge_stream_topology_changed(), softmix_translate_helper_entry_alloc(), sorcery_memory_cache_open(), sorcery_memory_cache_retrieve_fields(), sorcery_memory_cache_retrieve_id(), sorcery_memory_cached_object_alloc(), speech_background(), srv_resolve(), stale_cache_update_task_data_alloc(), stale_update_task_data_alloc(), stasis_app_control_play_uri(), stasis_app_control_record(), stasis_app_exec(), stasis_cache_get_by_eid(), stasis_forward_all(), stasis_message_router_publish_sync(), stasis_state_subscriber_data(), stasis_unsubscribe(), state_alloc(), stir_shaken_general_get(), sub_persistence_recreate(), subscribe_device_state(), test_resolve(), tonepair_alloc(), topology_change_refresh_data_alloc(), transmit_audio(), unbound_resolver_resolve(), unbound_resolver_start(), wait_for_answer(), and wrap_hook().

◆ ao2_callback

#define ao2_callback (   c,
  flags,
  cb_fn,
  arg 
)    __ao2_callback((c), (flags), (cb_fn), (arg), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 1716 of file astobj2.h.

Referenced by _ast_odbc_request_obj2(), _mohclass_unref(), _sip_show_peers(), acl_on_rx_msg(), aco_option_find(), actual_load_config(), admin_exec(), agents_mark(), agents_sweep(), ami_registrations_endpoints(), ami_show_aors(), ami_show_auths(), ami_show_contacts(), ami_show_endpoints(), ami_show_outbound_registrations(), ami_show_resource_lists(), anonymous_identify(), ao2_container_dup(), ao2_container_dup_weakproxy_objs(), ao2_container_unregister(), aor_apply_handler(), aor_deleted_observer(), ari_show_users(), ast_ari_applications_list(), ast_ari_websocket_events_event_websocket_dtor(), ast_bridge_features_merge(), ast_bucket_file_metadata_callback(), ast_calendar_clear_events(), ast_calendar_merge_events(), ast_calendar_unregister(), ast_cdr_setvar(), ast_channel_dialed_causes_channels(), ast_channel_dialed_causes_clear(), ast_codec_get_by_id(), ast_extension_state_del(), ast_get_chan_applicationmap(), ast_media_get_media(), ast_media_get_variants(), ast_merge_contexts_and_delete(), ast_multi_channel_blob_get_channels(), ast_namedgroups_intersect(), ast_odbc_get_max_connections(), ast_phoneprov_provider_unregister(), ast_sip_cli_traverse_objects(), ast_sip_get_transport_states(), ast_sip_location_prune_boot_contacts(), ast_sip_location_retrieve_aor_contacts_nolock_filtered(), ast_sip_location_retrieve_first_aor_contact_filtered(), ast_sip_persistent_endpoint_add_to_regcontext(), ast_sip_session_remove_datastore(), ast_sip_transport_monitor_unregister_all(), ast_softhangup_all(), ast_sorcery_force_reload(), ast_sorcery_global_observer_remove(), ast_sorcery_instance_observer_remove(), ast_sorcery_is_object_field_registered(), ast_sorcery_load(), ast_sorcery_observer_remove(), ast_sorcery_reload(), ast_sorcery_wizard_observer_remove(), AST_TEST_DEFINE(), ast_unregister_indication_country(), asterisk_publication_devicestate_refresh(), asterisk_publication_mwi_refresh(), asterisk_publication_send_refresh(), asterisk_start_devicestate_publishing(), asterisk_start_mwi_publishing(), cache_cleanup(), caldav_destructor(), calendar_is_busy(), calltoken_required(), cc_handle_publish_error(), cdr_engine_shutdown(), cdr_object_get_by_name(), cel_report_event(), channel_admin_exec(), channel_replaced_cb(), channel_stolen_cb(), check_expiration_thread(), cleanup(), cleanup_module(), cli_contact_get_container(), cli_display_parking_lot(), cli_display_parking_lot_list(), cli_endpoint_iterate(), cli_iterator(), cli_unid_iterate(), common_identify(), complete_bridge_live(), conf_run(), context_table_create_autohints(), cpg_confchg_cb(), create_mwi_subscriptions(), create_sound_blob(), delete_users(), do_timing(), ewscal_destructor(), exchangecal_destructor(), find_endpoint(), gather_contacts_for_aor(), get_buddy_status(), get_container(), handle_bridge_show_specific(), handle_cc_notify(), handle_cli_sounds_show(), handle_feature_show(), handle_manager_show_events(), handle_registrations(), handle_response_subscribe(), hash_test_count(), hooks_remove_container(), icalendar_destructor(), line_identify(), load_config(), load_indications(), load_module(), mark_all_as_stale_in_cache(), mark_all_databases_dirty(), media_cache_handle_show_all(), meetme_menu_admin(), meetme_menu_admin_extended(), metermaidstate(), mwi_contact_changed(), mwi_get_notify_data(), mwi_subscription_shutdown(), notify_endpoint(), object_type_loaded_observer(), one_protocol(), parking_lot_inspect_parked_user(), parking_lot_retrieve_parked_user(), parking_lot_search_context_extension_inuse(), pjsip_contact_function_read(), print_featuregroups(), process_config(), process_nat(), prune_task(), queue_delme_members_decrement_followers(), queue_member_follower_removal(), queued_set_size(), queued_task_pushed(), register_aor_core(), registration_loaded_observer(), reload(), reload_config(), reload_queues(), reload_single_queue(), remove_all_from_cache(), remove_excess_contacts(), send_initial_notify_all(), send_mwi_notify(), send_unsolicited_mwi_notify(), session_media_dtor(), set_config_destroy(), set_peercnt_limit(), show_codec(), shrink(), sip_options_aor_dtor(), sip_options_aor_observer_modified_task(), sip_options_apply_aor_configuration(), sip_options_qualify_aor(), sip_options_synchronize_task(), sip_outbound_publish_state_destroy(), sip_outbound_publish_synchronize(), sip_outbound_publisher_reinit_all(), sip_tcp_locate(), sla_destroy(), sla_load_config(), smdi_msg_find(), sorcery_config_retrieve_fields(), sorcery_config_retrieve_multiple(), sorcery_config_retrieve_prefix(), sorcery_config_retrieve_regex(), sorcery_memory_cache_dump(), sorcery_memory_cache_retrieve_fields(), sorcery_memory_cache_retrieve_multiple(), sorcery_memory_cache_retrieve_prefix(), sorcery_memory_cache_retrieve_regex(), sorcery_memory_retrieve_fields(), sorcery_memory_retrieve_multiple(), sorcery_memory_retrieve_prefix(), sorcery_memory_retrieve_regex(), sorcery_observers_notify_create(), sorcery_observers_notify_delete(), sorcery_observers_notify_loaded(), sorcery_observers_notify_update(), stasis_app_get_all(), stasis_app_to_cli(), stasis_cache_dump_all(), stasis_cache_dump_by_eid(), stir_shaken_certificate_show_all(), subscription_persistence_load(), test_ao2_callback_traversal(), unlink_dirty_databases(), unlink_from_msg_q(), unload_module(), unregister_all(), unsubscribe(), xmpp_client_config_post_apply(), xmpp_client_service_discovery_result_hook(), xmpp_config_post_apply(), xmpp_init_event_distribution(), xmpp_pak_presence(), and xmpp_roster_hook().

◆ ao2_callback_data

#define ao2_callback_data (   container,
  flags,
  cb_fn,
  arg,
  data 
)    __ao2_callback_data((container), (flags), (cb_fn), (arg), (data), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

◆ ao2_cleanup

#define ao2_cleanup (   obj)    __ao2_cleanup_debug((obj), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)
Examples:
/usr/src/asterisk-18.5.0/main/app.c.

Definition at line 1958 of file astobj2.h.

Referenced by __analog_ss_thread(), __ast_bucket_scheme_register(), __ast_manager_event_multichan(), __ast_named_lock_get(), __ast_play_and_record(), __ast_register_translator(), __ast_sorcery_apply_default(), __ast_sorcery_object_field_register(), __ast_sorcery_object_register(), __ast_sorcery_object_type_insert_wizard(), __ast_sorcery_object_type_remove_wizard(), __ast_sorcery_open(), __ast_sorcery_remove_wizard_mapping(), __ast_sorcery_wizard_register(), __ast_test_suite_event_notify(), __ast_udptl_reload(), __ast_vm_greeter_register(), __ast_vm_register(), __features_config_alloc(), __frame_free(), __sip_alloc(), __stasis_app_register(), __test_cel_generate_peer_str(), __unload_module(), _skinny_show_lines(), acf_jabberreceive_read(), acf_jabberstatus_read(), acl_on_rx_msg(), aco_deinit(), aco_process_ast_config(), aco_process_config(), aco_process_var(), action_agents(), action_bridge(), action_destroy(), action_devicestatelist(), action_originate(), action_presencestatelist(), active_channels_to_str(), add_datastore(), add_format_information_cb(), add_header(), add_item(), add_sdp(), add_sdp_streams(), add_static_payload(), admin_exec(), adsi_transmit_message_full(), after_bridge_move_channel(), after_bridge_move_channel_fail(), agent_cfg_alloc(), agent_login_exec(), agent_logoff_request(), agent_pvt_destructor(), agent_request_exec(), agents_cfg_destructor(), agents_post_apply_config(), all_dtor(), alloc_new_parking_lot(), alloc_str(), ami_registrations_endpoints(), ami_show_endpoint(), ami_show_endpoints(), ami_sip_qualify(), analog_ss_thread(), announce_pvt_destructor(), announce_request(), announce_to_dial(), anonymous_identify(), aoc_event_blob_dtor(), aor_destroy(), app_cleanup(), app_create(), app_deactivate(), app_dtor(), app_exec(), app_is_subscribed_bridge_id(), app_is_subscribed_channel_id(), app_is_subscribed_endpoint_id(), app_send(), app_send_end_msg(), app_subscribe(), append_event(), append_expected_event(), applicationmap_handler(), ari_bridges_handle_play(), ari_bridges_play_found(), ari_bridges_play_helper(), ari_bridges_play_new(), ari_channels_handle_originate_with_id(), ari_channels_handle_play(), ari_channels_handle_snoop_channel(), ari_show(), ari_show_user(), ari_show_users(), assign_uuid(), ast_ari_add_handler(), ast_ari_applications_list(), ast_ari_asterisk_delete_object(), ast_ari_asterisk_get_object(), ast_ari_asterisk_update_object(), ast_ari_bridges_add_channel(), ast_ari_bridges_create(), ast_ari_bridges_create_with_id(), ast_ari_bridges_destroy(), ast_ari_bridges_get(), ast_ari_bridges_list(), ast_ari_bridges_record(), ast_ari_bridges_remove_channel(), ast_ari_bridges_start_moh(), ast_ari_bridges_stop_moh(), ast_ari_callback(), ast_ari_channels_answer(), ast_ari_channels_continue_in_dialplan(), ast_ari_channels_create(), ast_ari_channels_dial(), ast_ari_channels_get_channel_var(), ast_ari_channels_hangup(), ast_ari_channels_hold(), ast_ari_channels_list(), ast_ari_channels_move(), ast_ari_channels_mute(), ast_ari_channels_record(), ast_ari_channels_redirect(), ast_ari_channels_ring(), ast_ari_channels_ring_stop(), ast_ari_channels_rtpstatistics(), ast_ari_channels_send_dtmf(), ast_ari_channels_set_channel_var(), ast_ari_channels_start_moh(), ast_ari_channels_start_silence(), ast_ari_channels_stop_moh(), ast_ari_channels_stop_silence(), ast_ari_channels_unhold(), ast_ari_channels_unmute(), ast_ari_config_validate_user(), ast_ari_endpoints_get(), ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), ast_ari_events_event_websocket_ws_established_cb(), ast_ari_invoke(), ast_ari_json_format(), ast_ari_playbacks_control(), ast_ari_playbacks_get(), ast_ari_playbacks_stop(), ast_ari_recordings_copy_stored(), ast_ari_recordings_delete_stored(), ast_ari_recordings_get_live(), ast_ari_recordings_get_stored(), ast_ari_recordings_get_stored_file(), ast_ari_recordings_list_stored(), ast_ari_remove_handler(), ast_ari_response_created(), ast_ari_sounds_get(), ast_ari_sounds_list(), ast_ari_websocket_events_event_websocket_dtor(), ast_ari_websocket_session_create(), ast_attended_transfer_message_create(), ast_audiohook_destroy(), ast_audiohook_detach_list(), ast_blind_transfer_message_create(), ast_bridge_add_channel(), ast_bridge_features_cleanup(), ast_bridge_publish_blind_transfer(), ast_bridge_publish_state(), ast_bridge_transfer_attended(), ast_bridge_transfer_blind(), ast_bucket_alloc(), ast_bucket_file_alloc(), ast_bucket_file_copy(), ast_bucket_file_metadata_set(), ast_bucket_file_metadata_unset(), ast_cdr_clear_property(), ast_cdr_engine_term(), ast_cdr_fork(), ast_cdr_get_config(), ast_cdr_getvar(), ast_cdr_reset(), ast_cdr_serialize_variables(), ast_cdr_set_config(), ast_cdr_set_property(), ast_cdr_setuserfield(), ast_cdr_setvar(), ast_cel_backend_register(), ast_cel_check_enabled(), ast_cel_fabricate_channel_from_event(), ast_cel_general_config_alloc(), ast_cel_get_config(), ast_cel_publish_event(), ast_cel_set_config(), ast_cel_track_event(), ast_channel_blob_create(), ast_channel_blob_create_from_cache(), ast_channel_get_vars(), ast_channel_internal_cleanup(), ast_channel_make_compatible_helper(), ast_channel_snapshot_set(), ast_channel_stop_silence_generator(), ast_channel_yank(), ast_delete_mwi_state_full(), ast_device_state_clear_cache(), ast_dns_query_set_resolve_async(), ast_dns_resolve_ipv6_and_ipv4(), ast_do_pickup(), ast_endpoint_shutdown(), ast_endpoint_snapshot_create(), ast_format_cache_get_by_codec(), ast_format_cache_set(), ast_format_cap_append_by_type(), ast_format_cap_get_compatible_format(), ast_format_cap_update_by_allow_disallow(), ast_get_builtin_feature(), ast_get_chan_applicationmap(), ast_get_chan_featuremap_config(), ast_get_chan_features_general_config(), ast_get_chan_features_pickup_config(), ast_get_chan_features_xfer_config(), ast_get_feature(), ast_iax2_new(), ast_jb_destroy(), ast_manager_publish_event(), ast_media_get_description(), ast_media_get_format_cap(), ast_media_get_media(), ast_media_get_variants(), ast_monitor_start(), ast_monitor_stop(), ast_msg_var_unref_current(), ast_multi_object_blob_add(), ast_named_acl_find(), ast_namedgroups_intersect(), ast_openvstream(), ast_parked_call_payload_create(), ast_parking_blind_transfer_park(), ast_parking_is_exten_park(), ast_parking_park_bridge_channel(), ast_parking_park_call(), ast_parking_provider_registered(), ast_parking_register_bridge_features(), ast_parking_unregister_bridge_features(), ast_pickup_call(), ast_publish_device_state_full(), ast_res_pjsip_cleanup_options_handling(), ast_res_pjsip_destroy_configuration(), ast_rtcp_interpret(), ast_rtcp_write(), ast_rtp_codecs_payload_replace_format(), ast_rtp_codecs_payloads_unset(), ast_rtp_destroy(), ast_rtp_ice_start(), ast_rtp_ice_turn_request(), ast_rtp_instance_destroy(), ast_rtp_instance_early_bridge(), ast_rtp_instance_early_bridge_make_compatible(), ast_rtp_interpret(), ast_rtp_publish_rtcp_message(), ast_rtp_read(), ast_set_read_format(), ast_set_write_format(), ast_set_write_format_interleaved_stereo(), ast_sip_cleanup_auths(), ast_sip_cli_traverse_objects(), ast_sip_create_joint_call_cap(), ast_sip_create_subscription(), ast_sip_destroy_distributor(), ast_sip_destroy_scheduler(), ast_sip_endpoint_alloc(), ast_sip_for_each_auth(), ast_sip_for_each_channel(), ast_sip_for_each_channel_snapshot(), ast_sip_for_each_contact(), ast_sip_format_contact_ami(), ast_sip_initialize_sorcery_transport(), ast_sip_initialize_system(), ast_sip_location_add_contact_nolock(), ast_sip_location_retrieve_contact_from_aor_list(), ast_sip_location_retrieve_first_aor_contact_filtered(), ast_sip_publish_client_alloc_datastore(), ast_sip_send_out_of_dialog_request(), ast_sip_send_stateful_response(), ast_sip_session_alloc(), ast_sip_session_alloc_datastore(), ast_sip_session_create_joint_call_stream(), ast_sip_session_create_outgoing(), ast_sip_session_media_state_add(), ast_sip_session_media_state_clone(), ast_sip_session_media_state_reset(), ast_sip_session_register_sdp_handler(), ast_sip_set_tpselector_from_transport_name(), ast_sip_subscription_destroy(), ast_sip_transport_monitor_register_replace(), ast_sip_unregister_publish_handler(), ast_slinfactory_destroy(), ast_smoother_free(), ast_smoother_reset(), ast_sorcery_alloc(), ast_sorcery_copy(), ast_sorcery_create(), ast_sorcery_delete(), ast_sorcery_diff(), ast_sorcery_force_reload_object(), ast_sorcery_get_wizard_mapping(), ast_sorcery_get_wizard_mapping_count(), ast_sorcery_is_object_field_registered(), ast_sorcery_is_stale(), ast_sorcery_load_object(), ast_sorcery_object_fields_register(), ast_sorcery_object_set_copy_handler(), ast_sorcery_object_set_diff_handler(), ast_sorcery_object_unregister(), ast_sorcery_objectset_apply(), ast_sorcery_objectset_create2(), ast_sorcery_objectset_json_create(), ast_sorcery_observer_add(), ast_sorcery_observer_remove(), ast_sorcery_reload_object(), ast_sorcery_retrieve_by_fields(), ast_sorcery_retrieve_by_prefix(), ast_sorcery_retrieve_by_regex(), ast_sorcery_update(), ast_sorcery_wizard_observer_add(), ast_sorcery_wizard_observer_remove(), ast_speech_new(), ast_statsd_log_string(), ast_stir_shaken_sign(), ast_stream_create_resolved(), ast_stream_free(), ast_stream_set_formats(), ast_stream_topology_create_from_format_cap(), ast_stream_topology_create_resolved(), ast_stream_topology_free(), ast_tcptls_client_create(), AST_TEST_DEFINE(), ast_threadpool_create(), ast_translator_best_choice(), ast_udptl_new_with_bindaddr(), ast_unreal_channel_push_to_bridge(), ast_unreal_destructor(), ast_unreal_new_channels(), ast_unref_namedgroups(), AST_VECTOR(), ast_vm_greeter_is_registered(), ast_vm_greeter_unregister(), ast_vm_is_registered(), ast_vm_test_swap_table_in(), ast_vm_test_swap_table_out(), ast_vm_unregister(), ast_websocket_unref(), ast_xmpp_client_config_destructor(), ast_xmpp_client_find(), asterisk_devicestate_publisher_state_destroy(), asterisk_mwi_publisher_state_destroy(), asterisk_publication_config_alloc(), asterisk_publication_devicestate_state_change(), asterisk_publication_mwi_state_change(), asterisk_publication_new(), asterisk_start_devicestate_publishing(), asterisk_start_mwi_publishing(), asterisk_stop_devicestate_publishing(), asterisk_stop_mwi_publishing(), attended_transfer_bridge(), attended_transfer_dtor(), attended_transfer_properties_destructor(), attended_transfer_properties_shutdown(), audiosocket_request(), auth_alloc(), auth_observer(), auth_store_cleanup(), auth_username_identify(), authenticate(), authenticate_user(), background_detect_exec(), begin_dial_prerun(), blind_transfer_dtor(), bridge_agent_hold_deferred_create(), bridge_agent_hold_push(), bridge_alloc(), bridge_basic_change_personality(), bridge_basic_destroy(), bridge_blob_dtor(), bridge_builtin_set_limits(), bridge_channel_attended_transfer(), bridge_channel_control_thread(), bridge_channel_destroy(), bridge_channel_internal_queue_attended_transfer(), bridge_channel_internal_queue_blind_transfer(), bridge_channel_snapshot_pair_cleanup(), bridge_cleanup(), bridge_exec(), bridge_handle_dtmf(), bridge_merge_message_dtor(), bridge_move(), bridge_p2p_rtp_write(), bridge_parking_pull(), bridge_parking_push(), bridge_profile_destructor(), bridge_publish_state_from_blob(), bridge_snapshot_dtor(), bridge_snapshot_update(), bridge_snapshot_update_dtor(), bridge_stasis_push(), bridge_stasis_push_peek(), bridge_subscription_change_handler(), bridge_timeout(), bridgeadd_exec(), bucket_alloc(), bucket_cleanup(), bucket_destroy(), bucket_file_alloc(), bucket_file_always_revalidate(), bucket_file_destroy(), bucket_file_expired(), bucket_file_wizard_retrieve(), bucket_wizard_retrieve(), build_cli_notify(), build_conf(), build_node_children(), build_nonce(), build_resource_tree(), build_topology(), cache_cleanup(), cache_dtor(), cache_dump_all_cb(), cache_dump_by_eid_cb(), cache_entry_create(), cache_entry_dtor(), cache_put(), cache_test_message_create_full(), caching_topic_exec(), cb_events(), cdr_detach(), cdr_engine_shutdown(), cdr_object_alloc(), cdr_object_dtor(), cdr_prop_write(), cdr_read(), cdr_submit_batch(), cdr_toggle_runtime_options(), cel_channel_state_change(), cel_config_alloc(), cel_config_dtor(), cel_general_config_dtor(), cel_generate_peer_str(), cel_linkedid_ref(), cel_report_event(), cel_track_app(), cel_verify_and_cleanup_cb(), chan_pjsip_add_hold(), chan_pjsip_call(), chan_pjsip_devicestate(), chan_pjsip_digit_end(), chan_pjsip_get_hold(), chan_pjsip_hangup(), chan_pjsip_incoming_request(), chan_pjsip_indicate(), chan_pjsip_new(), chan_pjsip_request_with_stream_topology(), chan_pjsip_session_begin(), chan_pjsip_transfer(), change_outgoing_sdp_stream_media_address(), channel_blob_dtor(), channel_do_masquerade(), channel_get_external_vars(), channel_id_sanitizer(), channel_read_pjsip(), channel_replaced_cb(), channel_role_snapshot_dtor(), channel_snapshot_bridge_create(), channel_snapshot_dtor(), channel_snapshot_update(), channel_snapshot_update_dtor(), channel_stolen_cb(), chanspy_exec(), check_cache_aggregate(), check_cache_content(), check_events(), check_retire_linkedid(), check_translation_path(), cleanup_module(), cleanup_resource_list(), clear_node_cache(), cli_channelstats_print_body(), cli_complete_endpoint(), cli_complete_notify(), cli_contact_get_container(), cli_contact_print_body(), cli_display_named_acl(), cli_display_named_acl_list(), cli_display_parking_lot(), cli_endpoint_get_container(), cli_endpoint_print_body(), cli_endpoint_print_child_body(), cli_endpoint_print_child_header(), cli_gather_contact(), cli_get_container(), cli_iterator(), cli_notify(), cli_print_body(), cli_qualify(), cli_reload_qualify_endpoint(), cli_show_channel(), cli_show_channels(), cli_show_module_options(), cli_show_module_type(), cli_show_module_types(), cli_show_qualify_endpoint(), cli_unid_print_header(), codec_choose_from_prefs(), codec_shutdown(), command_prestart_queue_command(), command_queue_prestart_destroy(), common_identify(), complete_ari_app(), complete_ari_user(), complete_bridge_profile_name(), complete_confbridge_participant(), complete_menu_name(), complete_user_profile_name(), conf_announce_channel_push(), conf_destructor(), conf_find_bridge_profile(), conf_find_user_profile(), conf_handle_talker_cb(), conf_run(), conf_set_menu_to_user(), confbridge_cfg_destructor(), confbridge_publish_manager_event(), config_shutdown(), configure_parking_extensions(), consumer_create(), consumer_dtor(), consumer_exec(), consumer_exec_sync(), consumer_finalize(), contact_alloc(), contact_apply_handler(), contact_destroy(), contact_observer_updated(), contact_wrapper_destroy(), container_to_json_array(), control_dtor(), control_list_create(), control_list_dtor(), control_prestart_dispatch_all(), control_recording(), control_set_app(), control_unlink(), create_channel_blob_message(), create_cts(), create_dynamic_lot_full(), create_endpoint_snapshot_message(), create_message_types(), create_mwi_subscriptions(), create_out_of_dialog_request(), create_outgoing_sdp_stream(), create_resource_list(), create_sound_blob(), create_unsolicited_mwi_subscriptions(), create_virtual_subscriptions(), current_state_reusable(), dahdiscan_exec(), defer_bridge_add_dtor(), delete_old_messages(), delete_users(), destroy(), destroy_bridge(), destroy_cts(), destroy_dahdi_pvt(), destroy_fast_originate_helper(), destroy_faxdetect(), destroy_gateway(), destroy_hint(), destroy_message_types(), destroy_parked_user(), destroy_subscription(), destroy_subscriptions(), device_state_aggregate_calc(), device_state_info_dt(), device_state_notify_callbacks(), devstate_cached(), devstate_cleanup(), dial_state_process_bridge_enter(), dial_trunk(), dialog_info_generate_body_content(), dictate_exec(), digest_create_request_with_auth(), digest_requires_authentication(), direct_media_mitigate_glare(), dispatch_exec_async(), dispatch_exec_sync(), dispatch_message(), dispose_test_lot(), distribute(), distributor(), dns_query_active_destroy(), dns_query_destroy(), dns_query_recurring_destroy(), dns_query_set_callback(), dns_query_set_destroy(), do_waiting(), domain_alias_alloc(), eagi_exec(), endpoint_blob_dtor(), endpoint_cleanup(), endpoint_destructor(), endpoint_dtor(), endpoint_internal_create(), endpoint_publish_snapshot(), endpoint_subscription_change(), endpoints_stasis_cleanup(), event_session_alloc(), event_session_shutdown(), exten_state_data_alloc(), exten_state_data_destructor(), exten_state_pub_data_destroy(), exten_state_publisher_destroy(), extensionstate_update(), extenspy_exec(), fake_ami(), fax_detect_framehook(), fax_gateway_framehook(), feature_automixmonitor(), feature_automonitor(), feature_ds_destroy(), featuregroup_alloc(), featuregroup_destructor(), featuregroup_handler(), featuregroup_item_destructor(), features_config_destructor(), filestream_destructor(), filter_history(), find_aor(), find_aor_name(), find_bridge(), find_channel_control(), find_control(), find_endpoint(), find_user(), find_variant(), fixup_callback(), forkcdr_exec(), format_ami_contactlist_handler(), format_ami_endpoint_transport(), format_cache_shutdown(), format_cap_framed_destroy(), format_destroy(), format_shutdown(), forward_dtor(), free_outgoing(), func_confbridge_data_destructor(), func_confbridge_helper(), func_get_parkingslot_channel(), generate_initial_notify(), generate_or_link_lots_to_configs(), generate_status(), generate_test_parking_lot(), generic_fax_exec(), generic_monitor_devstate_cb(), generic_monitor_devstate_tp_cb(), generic_mute_unmute_helper(), get_account_id(), get_buddy_status(), get_cached_mwi(), get_container(), get_curl_instance(), get_destination(), get_exten_state_sub(), get_feature_chan_ds(), get_feature_ds(), get_languages(), get_monitored_transport_by_name(), get_publishes_and_update_state(), get_sip_pvt_from_replaces(), get_transfer_parties(), get_transferee(), get_write_timeout(), global_alloc(), global_config_alloc(), global_config_destructor(), global_loaded(), handle_atsign(), handle_attended_transfer(), handle_blind_transfer(), handle_bridge_enter_message(), handle_bridge_leave_message(), handle_call_outgoing(), handle_channel_snapshot_update_message(), handle_cli_confbridge_show_bridge_profiles(), handle_cli_confbridge_show_menu(), handle_cli_confbridge_show_menus(), handle_cli_confbridge_show_user_profiles(), handle_cli_debug(), handle_cli_show_config(), handle_cli_sound_show(), handle_cli_sounds_show(), handle_cli_status(), handle_cli_submit(), handle_client_registration(), handle_dial_message(), handle_export_primitives(), handle_feature_show(), handle_hangup(), handle_incoming_sdp(), handle_manager_show_event(), handle_negotiated_sdp_session_media(), handle_new_invite_request(), handle_parked_call_message(), handle_recordfile(), handle_registrations(), handle_request_invite(), handle_request_subscribe(), handle_security_event(), handle_show_translation_table(), handle_showchan(), handle_single_token(), handle_skel_show_config(), handle_skel_show_levels(), handle_slash(), handle_soft_key_event_message(), handle_stasis_state(), handle_stasis_state_subscribed(), handle_stimulus_message(), handle_validate(), hangup(), has_voicemail(), hep_queue_cb(), hepv3_config_post_apply(), hepv3_get_uuid_type(), hepv3_is_loaded(), hepv3_send_packet(), http_callback(), httpd_helper_thread(), iax2_codec_pref_string(), iax2_parse_allow_disallow(), ice_create(), ices_exec(), incoming_request(), insert_user_in_contact_uri(), internal_feature_read(), internal_feature_write(), internal_featuremap_write(), internal_state_alloc(), internal_state_destroy(), internal_type_destroy(), interval_wrapper_pvt_dtor(), ip_identify_alloc(), ip_identify_destroy(), is_cdr_flag_set(), is_enabled(), isAnsweringMachine(), jb_framedata_destroy(), jingle_config_destructor(), jingle_endpoint_destructor(), jingle_endpoint_state_find_or_create(), jingle_request(), jingle_session_destructor(), key_main_page(), line_identify(), linear_alloc(), linear_release(), link_topic_proxy(), load_all_endpoints(), load_config(), load_endpoint(), load_module(), local_ast_moh_cleanup(), local_attended_transfer(), local_call(), local_channel_optimization_blob(), local_optimization_finished_cb(), local_optimization_started_cb(), local_pvt_destructor(), local_shutdown(), localnet_to_str(), localnet_to_vl(), make_channel(), manager_bridge_info(), manager_bridge_kick(), manager_default_msg_cb(), manager_generic_msg_cb(), manager_jabber_send(), manager_mute_mixmonitor(), manager_park(), manager_park_bridged(), manager_park_unbridged(), manager_parking_status_all_lots(), manager_parking_status_single_lot(), manager_shutdown(), measurenoise(), media_cache_shutdown(), media_index_dtor(), media_info_destroy(), media_request_helper(), media_variant_destroy(), meetme_stasis_generate_msg(), memory_cache_stale_update_full(), memory_cache_stale_update_object(), menu_hook_destroy(), menu_template_handler(), message_subscription_dtor(), messaging_app_subscribe_endpoint(), messaging_app_unsubscribe_endpoint(), metermaidstate(), mgcp_ss(), mixmonitor_exec(), mkif(), module_config_post_apply(), module_destroy(), moh_alloc(), moh_class_destructor(), moh_files_alloc(), moh_files_release(), moh_parse_options(), moh_post_start(), moh_post_stop(), moh_release(), mp3_exec(), msg_destructor(), msg_send(), multi_channel_blob_dtor(), multi_object_blob_dtor(), multicast_rtp_request(), mwi_blob_dtor(), mwi_cleanup(), mwi_contact_changed(), mwi_contact_deleted(), mwi_get_notify_data(), mwi_new_subscribe(), mwi_state_create_message(), mwi_state_dtor(), mwi_subscription_alloc(), mwi_subscription_destructor(), mwi_subscription_established(), mwi_subscription_shutdown(), named_acl_config_destructor(), named_locks_shutdown(), namedgroup_match(), nat_on_rx_message(), native_rtp_bridge_channel_data_free(), native_rtp_bridge_compatible_check(), native_rtp_bridge_framehook_detach(), native_rtp_bridge_start(), NBScat_exec(), negotiate_incoming_sdp_stream(), nocdr_exec(), nominal_async_run(), nominal_test(), notify_ami_channel_data_destroy(), notify_ami_data_destroy(), notify_cfg_alloc(), notify_cfg_destroy(), notify_channel(), notify_cli_data_destroy(), notify_cli_uri_data_destroy(), notify_endpoint(), notify_new_message(), notify_option_alloc(), notify_option_destroy(), notify_option_handler(), notify_task(), notify_task_data_destructor(), notify_uri(), object_type_loaded_observer(), off_nominal_async_run(), off_nominal_test(), on_rx_process_symmetric_transport(), one_dtor(), ooh323_delete_peer(), ooh323_destroy(), ooh323_new(), options_on_rx_request(), opus_destroy(), opus_set(), origin_allowed(), originate_exec(), outgoing_request(), pack_channel_into_message(), park_and_announce_app_exec(), park_app_exec(), park_common_setup(), parked_call_app_exec(), parked_call_payload_destructor(), parked_call_payload_from_failure(), parked_call_payload_from_parked_user(), parker_parked_call_message_response(), parker_update_cb(), parking_blind_transfer_park(), parking_config_alloc(), parking_config_destructor(), parking_dynamic_lots_enabled(), parking_lot_build_or_update(), parking_lot_cfg_alloc(), parking_lot_destructor(), parking_lot_retrieve_parked_user(), parking_lot_search_context_extension_inuse(), parking_park_bridge_channel(), parking_park_call(), parking_stasis_cleanup(), path_outgoing_request(), path_outgoing_response(), pbx_outgoing_attempt(), pbx_outgoing_exec(), persistent_endpoint_find_or_create(), personality_destructor(), phase_e_handler(), phone_check_exception(), phone_digit_end(), phone_hangup(), phone_indicate(), phone_new(), phoneprov_alloc(), pjsip_acf_dial_contacts_read(), pjsip_aor_function_read(), pjsip_contact_function_read(), pjsip_endpoint_function_read(), pjsip_outbound_registration_metrics_init(), pjsip_show_history(), play_on_channel(), play_on_channel_in_bridge(), play_uri(), playback_create(), playback_dtor(), playback_publish(), playtones_release(), post_cdr(), prepare_bridge_media_channel(), presence_state_alloc(), presence_state_cached(), presence_state_engine_cleanup(), presence_state_event(), presence_state_notify_callbacks(), process_category(), process_config(), process_nat(), process_sdp(), prometheus_config_post_apply(), prometheus_general_config_get(), prometheus_general_config_set(), proxy_dtor(), publication_destroy_fn(), publish_acl_change(), publish_app_cdr_message(), publish_chanspy_message(), publish_expire(), publish_expire_callback(), publish_format_update(), publish_load_message_type(), publish_local_bridge_message(), publish_parked_call(), publish_parked_call_failure(), publish_request_initial(), publish_transfer_fail(), publish_transfer_success(), publish_transfer_threeway(), publishers_destroy(), pubsub_on_client_refresh(), pubsub_on_evsub_state(), pubsub_on_rx_mwi_notify_request(), pubsub_on_rx_publish_request(), pubsub_on_rx_refresh(), pubsub_on_rx_subscribe_request(), pubsub_on_server_timeout(), push_notify(), push_notify_uri(), query_set_test(), queue_bridge_cb(), queue_channel_cb(), queue_publish_member_blob(), queue_publish_multi_channel_blob(), queue_publish_multi_channel_snapshot_blob(), queue_stasis_data_alloc(), queue_stasis_data_destructor(), read_header(), rec_request(), recalling_enter(), receivefax_exec(), record_exec(), recording_alloc(), recording_dtor(), recording_publish(), refer_attended_destroy(), refer_attended_task(), refer_blind_callback(), refer_incoming_attended_request(), refer_incoming_invite_request(), refer_incoming_refer_request(), refer_progress_alloc(), refer_progress_bridge(), refer_progress_destroy(), refer_progress_framehook(), refer_progress_framehook_destroy(), refer_progress_notification_destroy(), refer_progress_notify(), refer_progress_on_evsub_state(), register_aor(), register_aor_core(), registrar_on_rx_request(), registration_loaded_observer(), registration_response_destroy(), reload_module(), remove_all_configured_parking_lot_extensions(), remove_device_states_cb(), remove_header(), remove_temporary_state(), replace_channel_destroy(), report_fax_status(), report_receive_fax_status(), report_send_fax_status(), request_channel(), require_client_cert_to_str(), resetcdr_exec(), resolve_refresh_media_states(), resource_list_alloc(), retransfer_enter(), retrieve_resource_list(), ring_entry(), root_handler_create(), router_dispatch(), rtcp_message_payload_dtor(), rtp_direct_media_data_destroy(), rtp_engine_mime_type_cleanup(), rtp_engine_shutdown(), rtp_glue_data_destroy(), rtp_payload_type_dtor(), rtp_write_rtcp_fir(), rtp_write_rtcp_psfb(), run_station(), run_task(), rx_data_to_ast_msg(), save_dialstatus(), sched_cb(), schedule_notification(), scheduler(), sdp_requires_deferral(), security_stasis_cleanup(), send_bridge_info_item_cb(), send_bridge_list_item_cb(), send_call_pickup_stasis_message(), send_conf_stasis(), send_conf_stasis_snapshots(), send_message(), send_mwi_notify(), send_options_response(), send_request_data_destroy(), send_response(), send_start_msg(), send_subscription_subscribe(), send_subscription_unsubscribe(), send_unsolicited_mwi_notify(), send_waveform_to_channel(), sendfax_exec(), sendtext(), sendtext_data_create(), sendtext_data_destroy(), serialize_showchan(), serialized_cleanup(), serialized_pubsub_on_client_refresh(), serialized_pubsub_on_refresh_timeout(), serialized_send_notify(), serializer_dtor(), serializer_shutdown(), session_destroy_fn(), session_destructor(), session_end_completion(), session_instance_destructor(), session_outgoing_nat_hook(), session_refresh_state_get_or_alloc(), session_reinvite_on_rx_request(), session_termination_cb(), set_caps(), set_config_flags(), set_format(), set_incoming_call_offer_cap(), set_transfer_variables_all(), shutdown_data_create(), single_state_process_bridge_enter(), sip_channel_destroy(), sip_destroy_peer(), sip_options_aor_dtor(), sip_options_cleanup_aor_task(), sip_options_contact_add_task(), sip_options_contact_callback_data_dtor(), sip_options_endpoint_state_compositor_dtor(), sip_options_notify_endpoint_state_compositors(), sip_options_qualify_contact(), sip_options_synchronize_aor_task(), sip_outbound_publish_alloc(), sip_outbound_publish_apply(), sip_outbound_publish_callback(), sip_outbound_publish_client_destroy(), sip_outbound_publish_state_destroy(), sip_outbound_publish_synchronize(), sip_outbound_publisher_destroy(), sip_outbound_publisher_init(), sip_outbound_registration_alloc(), sip_outbound_registration_apply(), sip_outbound_registration_regc_alloc(), sip_outbound_registration_response_cb(), sip_outbound_registration_state_alloc(), sip_outbound_registration_state_destroy(), sip_publisher_service_queue(), sip_pvt_dtor(), sip_resolve_destroy(), sip_session_refresh(), sip_transport_alloc(), skel_config_destructor(), skel_find_or_create_state(), skel_game_destructor(), skel_level_destructor(), skinny_device_alloc(), skinny_line_alloc(), sla_add_trunk_to_station(), sla_build_station(), sla_build_trunk(), sla_check_station_delay(), sla_handle_dial_state_event(), sla_state(), sla_station_exec(), sla_trunk_exec(), smdi_interface_destroy(), smdi_load(), smdi_msg_datastore_destroy(), smdi_msg_retrieve_read(), snoop_hangup(), snoop_stasis_thread(), socket_process_helper(), softmix_bridge_data_destroy(), softmix_bridge_leave(), softmix_bridge_stream_topology_changed(), softmix_translate_helper_free_entry(), sorcery_astdb_filter_objectset(), sorcery_astdb_retrieve_fields_common(), sorcery_astdb_retrieve_id(), sorcery_astdb_retrieve_prefix(), sorcery_astdb_retrieve_regex(), sorcery_cleanup(), sorcery_config_internal_load(), sorcery_config_retrieve_fields(), sorcery_config_retrieve_id(), sorcery_config_retrieve_multiple(), sorcery_config_retrieve_prefix(), sorcery_config_retrieve_regex(), sorcery_destructor(), sorcery_function_read(), sorcery_internal_wizard_destructor(), sorcery_memory_cache_destructor(), sorcery_memory_cache_open(), sorcery_memory_cached_object_destructor(), sorcery_memory_delete(), sorcery_memory_update(), sorcery_object_load(), sorcery_object_type_destructor(), sorcery_object_wizard_destructor(), sorcery_observer_invocation_destroy(), sorcery_observers_notify_create(), sorcery_observers_notify_delete(), sorcery_observers_notify_loaded(), sorcery_observers_notify_update(), sorcery_realtime_filter_objectset(), sorcery_realtime_retrieve_fields(), sorcery_realtime_retrieve_multiple(), sorcery_reloadable(), spandsp_fax_gateway_start(), speech_background(), stale_cache_update_task_data_destructor(), stale_update_task_data_destructor(), start_message_blob_dtor(), stasis_app_bridge_moh_stop(), stasis_app_bridge_playback_channel_add(), stasis_app_control_record(), stasis_app_control_snoop(), stasis_app_exec(), stasis_app_recording_options_create(), stasis_app_set_debug_by_name(), stasis_app_set_global_debug(), stasis_app_stored_recording_find_by_name(), stasis_app_to_json(), stasis_app_user_event(), stasis_bridging_cleanup(), stasis_cache_create_full(), stasis_cache_get_all(), stasis_cache_get_by_eid(), stasis_cache_update_dtor(), stasis_caching_topic_dtor(), stasis_caching_unsubscribe(), stasis_caching_unsubscribe_and_join(), stasis_channels_cleanup(), stasis_cleanup(), stasis_config_destructor(), stasis_cp_single_unsubscribe(), stasis_declined_config_destructor(), stasis_forward_cancel(), stasis_init(), stasis_message_dtor(), stasis_message_router_publish_sync(), stasis_message_sink_create(), stasis_message_sink_dtor(), stasis_message_type_create(), stasis_message_type_declined(), stasis_show_topics(), stasis_subscription_statistics_create(), stasis_system_cleanup(), stasis_test_message_create(), stasis_topic_pool_create(), stasis_topic_pool_get_topic(), stasis_topic_statistics_create(), stasis_unsubscribe(), stasis_unsubscribe_and_join(), state_alloc(), state_changed(), state_changed_destroy(), state_dtor(), state_manager_dtor(), state_proxy_dtor(), statsd_init(), stir_shaken_certificate_show(), stir_shaken_certificate_show_all(), stir_shaken_general_get(), stir_shaken_general_show(), stir_shaken_store_show(), stop_mixmonitor_full(), stun_monitor_request(), sub_cleanup(), sub_subscription_change_handler(), submit_scheduled_batch(), subscription_change_dtor(), subscription_dtor(), subscription_established(), subscription_shutdown(), subscription_statistics_destroy(), subscription_tree_destructor(), supplement_on_rx_request(), supplement_outgoing_response(), suppress_datastore_destroy_cb(), suppress_framehook_destroy_cb(), t38_automatic_reject(), t38_interpret_parameters(), t38_parameters_task_data_destroy(), t38_state_get_or_alloc(), temp_state_store_cleanup(), test_cb_data_destroy(), test_cdr_cleanup_cb(), test_cel_generate_peer_str(), test_cel_generate_peer_str_snapshot(), test_cel_peer_strings_match(), test_cleanup(), test_cleanup_cb(), test_config_alloc(), test_config_destructor(), test_create_joint(), test_item_destructor(), test_performance(), test_stir_shaken_cleanup_cert(), test_sub(), testsuite_notify_feature_success(), threadpool_alloc(), threadpool_destructor(), threadpool_tps_shutdown(), tls_method_to_str(), tonepair_release(), topic_pool_dtor(), topic_pool_entry_dtor(), topic_statistics_destroy(), topology_change_refresh_data_free(), tps_report_taskprocessor_list(), tps_taskprocessor_dtor(), transfer(), transfer_data_destroy(), transfer_target_framehook_destroy_cb(), transmit_info_dtmf(), transmit_info_with_vidupdate(), transport_apply(), transport_bind_handler(), transport_bind_to_str(), transport_create(), transport_localnet_handler(), transport_monitor_dtor(), transport_monitor_unregister_cb(), transport_protocol_handler(), transport_state_init(), transport_tls_bool_handler(), transport_tls_file_handler(), transport_tls_method_handler(), try_parking(), two_bridge_attended_transfer(), udptl_config_destructor(), unbound_config_destructor(), unbound_global_config_destructor(), unbound_resolver_data_dtor(), unicast_rtp_request(), unistim_send_mwi_to_peer(), unload_module(), unregister_channel_tech(), unsubscribe_device_state(), update_create(), update_header(), update_registry(), user_alloc(), username_identify(), validate_stream(), verify_client_to_str(), verify_default_parking_lot(), verify_default_profiles(), verify_server_to_str(), wait_bridge_wrapper_alloc(), wait_for_cache_update(), wait_wrapper_removal(), websocket_client_destroy(), websocket_server_create_impl(), websocket_server_dtor(), xmldoc_build_list_responses(), xmldoc_update_config_option(), xmldoc_update_config_type(), xmpp_action_hook(), xmpp_cli_create_collection(), xmpp_cli_create_leafnode(), xmpp_cli_delete_pubsub_node(), xmpp_cli_list_pubsub_nodes(), xmpp_cli_purge_pubsub_nodes(), xmpp_client_config_post_apply(), xmpp_client_destructor(), xmpp_client_find_or_create(), xmpp_client_reconnect(), xmpp_client_send_message(), xmpp_client_set_group_presence(), xmpp_client_set_presence(), xmpp_client_thread(), xmpp_component_register_get_hook(), xmpp_component_service_discovery_get_hook(), xmpp_component_service_discovery_items_hook(), xmpp_config_destructor(), xmpp_config_post_apply(), xmpp_config_prelink(), xmpp_connect_hook(), xmpp_init_event_distribution(), xmpp_join_exec(), xmpp_leave_exec(), xmpp_log_hook(), xmpp_pak_message(), xmpp_pubsub_build_publish_skeleton(), xmpp_pubsub_handle_error(), xmpp_pubsub_iq_create(), xmpp_pubsub_publish_device_state(), xmpp_pubsub_subscribe(), xmpp_roster_hook(), xmpp_send_cb(), xmpp_send_exec(), xmpp_sendgroup_exec(), xmpp_show_buddies(), and xmpp_show_clients().

◆ ao2_container_alloc_hash

#define ao2_container_alloc_hash (   ao2_options,
  container_options,
  n_buckets,
  hash_fn,
  sort_fn,
  cmp_fn 
)    __ao2_container_alloc_hash((ao2_options), (container_options), (n_buckets), (hash_fn), (sort_fn), (cmp_fn), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 1310 of file astobj2.h.

Referenced by __ast_channel_internal_alloc(), __ast_sorcery_open(), __features_config_alloc(), aco_option_container_alloc(), ast_ari_websocket_events_event_websocket_init(), ast_bridge_peers_nolock(), ast_bucket_init(), ast_calendar_event_container_alloc(), ast_channels_init(), ast_codec_init(), ast_config_hook_register(), ast_config_text_file_save2(), ast_datastores_alloc(), ast_endpoint_init(), ast_format_cache_init(), ast_format_init(), ast_get_namedgroups(), ast_media_cache_init(), ast_media_index_create(), ast_multi_channel_blob_create(), ast_multi_channel_blob_get_channels(), ast_named_locks_init(), ast_pbx_init(), ast_res_pjsip_init_options_handling(), ast_res_pjsip_initialize_configuration(), ast_sip_get_transport_states(), ast_sip_initialize_cli(), ast_sip_initialize_distributor(), ast_sip_initialize_scheduler(), ast_sip_initialize_sorcery_transport(), ast_sip_initialize_transport_events(), ast_sip_initialize_transport_management(), ast_sip_register_publish_handler(), ast_sip_session_alloc(), ast_sorcery_init(), ast_stasis_channels_init(), ast_str_container_alloc_options(), AST_TEST_DEFINE(), ast_tps_init(), ast_xmldoc_build_documentation(), ast_xmpp_client_config_alloc(), bucket_file_alloc(), build_calendar(), confbridge_cfg_alloc(), dialgroup_write(), init_queue(), initialize_escs(), jingle_config_alloc(), jingle_endpoint_state_create(), load_module(), load_objects(), media_info_alloc(), mwi_subscription_alloc(), named_acl_config_alloc(), notify_cfg_alloc(), parking_config_alloc(), realtime_sqlite3_require(), reload(), sip_options_aor_alloc(), sip_options_contact_statuses_alloc(), sip_options_endpoint_state_compositor_find_or_alloc(), sip_outbound_publish_apply(), sip_outbound_publish_state_alloc(), skel_config_alloc(), sorcery_config_internal_load(), sorcery_memory_cache_open(), sorcery_memory_open(), sorcery_object_type_alloc(), stasis_cache_create_full(), stasis_init(), stasis_state_manager_create(), stasis_topic_pool_create(), test_make_nonsorted(), test_performance(), threadpool_alloc(), ustmtext(), websocket_server_create_impl(), xml_translate(), xmpp_client_alloc(), and xmpp_client_create_buddy().

◆ ao2_container_alloc_list

#define ao2_container_alloc_list (   ao2_options,
  container_options,
  sort_fn,
  cmp_fn 
)    __ao2_container_alloc_list((ao2_options), (container_options), (sort_fn), (cmp_fn), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

◆ ao2_container_alloc_rbtree

#define ao2_container_alloc_rbtree (   ao2_options,
  container_options,
  sort_fn,
  cmp_fn 
)    __ao2_container_alloc_rbtree((ao2_options), (container_options), (sort_fn), (cmp_fn), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

◆ ao2_container_clone

#define ao2_container_clone (   orig,
  flags 
)    __ao2_container_clone(orig, flags, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

◆ AO2_FIELD_CMP_FN

#define AO2_FIELD_CMP_FN (   stype,
  fn_suffix,
  field,
  key_cmp,
  partial_key_cmp,
  transform,
  argconst 
)

Definition at line 2022 of file astobj2.h.

◆ AO2_FIELD_HASH_FN

#define AO2_FIELD_HASH_FN (   stype,
  field,
  hash_fn 
)

Creates a hash function for a structure field.

Parameters
stypeThe structure type
fieldThe string field in the structure to hash
hash_fnFunction which hashes the field

AO2_FIELD_HASH_FN(mystruct, myfield, ast_str_hash) will produce a function named mystruct_hash_fn which hashes mystruct->myfield with ast_str_hash.

Definition at line 1981 of file astobj2.h.

◆ AO2_FIELD_TRANSFORM_CMP_FN

#define AO2_FIELD_TRANSFORM_CMP_FN (   cmp)    ((cmp) ? 0 : CMP_MATCH)

Definition at line 2001 of file astobj2.h.

◆ AO2_FIELD_TRANSFORM_SORT_FN

#define AO2_FIELD_TRANSFORM_SORT_FN (   cmp)    (cmp)

Definition at line 2002 of file astobj2.h.

◆ ao2_find

#define ao2_find (   container,
  arg,
  flags 
)    __ao2_find((container), (arg), (flags), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 1756 of file astobj2.h.

Referenced by __ao2_weakproxy_find(), __ast_bucket_scheme_register(), __ast_codec_register_with_format(), __ast_format_interface_register(), __ast_sorcery_apply_default(), __ast_sorcery_object_field_register(), __ast_sorcery_object_register(), __ast_sorcery_object_type_insert_wizard(), __ast_sorcery_object_type_remove_wizard(), __ast_sorcery_remove_wizard_mapping(), __ast_sorcery_wizard_register(), __find_callno(), __has_voicemail(), __stasis_app_register(), action_confbridgekick(), action_confbridgelist(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_confbridgestoprecord(), add_calltoken_ignore(), add_sdp_streams(), add_to_cache(), admin_exec(), agent_after_bridge_cb(), agent_after_bridge_cb_failed(), agent_alert(), agent_cfg_find(), agent_function_read(), agent_handle_show_specific(), agent_login_exec(), agent_logoff_request(), agent_pvt_devstate_get(), agent_request_exec(), agent_run(), agents_post_apply_config(), alloc_variant(), ami_sip_qualify(), announce_request(), app_exec(), app_is_subscribed_bridge_id(), app_is_subscribed_channel_id(), app_is_subscribed_endpoint_id(), app_subscribe_bridge(), app_subscribe_channel(), app_subscribe_endpoint(), ari_show_user(), ast_add_hint(), ast_ari_config_validate_user(), ast_ari_websocket_events_event_websocket_established(), ast_bridge_channel_feature_digit(), ast_bridge_find_by_id(), ast_bucket_alloc(), ast_bucket_file_alloc(), ast_bucket_file_metadata_get(), ast_bucket_file_metadata_set(), ast_bucket_file_metadata_unset(), ast_cel_backend_unregister(), ast_change_hint(), ast_channel_dialed_causes_add(), ast_channel_dialed_causes_find(), ast_channel_snapshot_get_latest(), ast_channel_snapshot_get_latest_by_name(), ast_codec_get(), ast_config_hook_unregister(), ast_datastores_find(), ast_datastores_remove(), ast_endpoint_find_by_id(), ast_extension_state_del(), ast_format_attribute_get(), ast_format_attribute_set(), ast_format_cache_set(), ast_format_create_named(), ast_format_generate_sdp_fmtp(), ast_format_parse_sdp_fmtp(), ast_get_chan_applicationmap(), ast_get_feature(), ast_get_indication_zone(), ast_get_namedgroups(), ast_local_get_peer(), ast_local_setup_bridge(), ast_local_setup_masquerade(), ast_media_cache_create_or_update(), ast_media_cache_delete(), ast_media_cache_exists(), ast_media_cache_retrieve(), ast_media_cache_retrieve_metadata(), ast_media_get_variants(), ast_merge_contexts_and_delete(), ast_module_register(), ast_multi_channel_blob_get_channel(), ast_remove_hint(), ast_res_pjsip_find_or_create_contact_status(), ast_rtp_ice_add_cand(), ast_sip_dialog_get_endpoint(), ast_sip_dialog_set_endpoint(), ast_sip_dialog_set_serializer(), ast_sip_get_contact_status(), ast_sip_get_transport_state(), ast_sip_lookup_cli_formatter(), ast_sip_persistent_endpoint_publish_contact_state(), ast_sip_persistent_endpoint_update_state(), ast_sip_publish_client_get_datastore(), ast_sip_publish_client_remove(), ast_sip_publish_client_remove_datastore(), ast_sip_sched_is_task_running_by_name(), ast_sip_sched_task_cancel_by_name(), ast_sip_sched_task_get_next_run_by_name(), ast_sip_sched_task_get_times_by_name2(), ast_sip_session_get_datastore(), ast_sip_session_register_sdp_handler(), ast_sip_transport_monitor_register_replace(), ast_sip_transport_monitor_unregister(), ast_smdi_interface_find(), ast_sorcery_alloc(), ast_sorcery_copy(), ast_sorcery_create(), ast_sorcery_delete(), ast_sorcery_diff(), ast_sorcery_force_reload_object(), ast_sorcery_get_object_type(), ast_sorcery_get_wizard_mapping(), ast_sorcery_get_wizard_mapping_count(), ast_sorcery_is_object_field_registered(), ast_sorcery_is_stale(), ast_sorcery_load_object(), ast_sorcery_object_fields_register(), ast_sorcery_object_set_congestion_levels(), ast_sorcery_object_set_copy_handler(), ast_sorcery_object_set_diff_handler(), ast_sorcery_object_unregister(), ast_sorcery_objectset_apply(), ast_sorcery_objectset_create2(), ast_sorcery_objectset_json_create(), ast_sorcery_observer_add(), ast_sorcery_observer_remove(), ast_sorcery_reload_object(), ast_sorcery_retrieve_by_fields(), ast_sorcery_retrieve_by_id(), ast_sorcery_retrieve_by_prefix(), ast_sorcery_retrieve_by_regex(), ast_sorcery_update(), ast_sorcery_wizard_observer_add(), ast_sorcery_wizard_observer_remove(), ast_sorcery_wizard_unregister(), ast_str_container_remove(), ast_taskprocessor_create_with_listener(), ast_taskprocessor_get(), AST_TEST_DEFINE(), ast_unregister_indication_country(), ast_websocket_server_add_protocol2(), ast_websocket_server_remove_protocol(), ast_websocket_uri_cb(), authenticate(), authenticate_request(), authenticate_verify(), bridge_agent_hold_push(), bridge_app_subscribed(), bridge_handle_dtmf(), bridge_profile_find(), bucket_file_wizard_retrieve(), bucket_wizard_retrieve(), build_callno_limits(), build_peer(), build_user(), cache_find(), can_ring_entry(), cel_linkedid_ref(), cel_track_app(), chan_pjsip_add_hold(), chan_pjsip_get_hold(), chan_pjsip_remove_hold(), check_featuregroup_item(), check_manager_session_inuse(), check_retire_linkedid(), cli_alias_passthrough(), cli_contact_retrieve_by_id(), cli_fax_show_session(), cli_qualify(), cli_retrieve_by_id(), cli_show_module_options(), cli_show_module_type(), cli_show_module_types(), cli_show_qualify_aor(), cli_show_qualify_endpoint(), cli_unid_retrieve_by_id(), client_buddy_handler(), compare_weight(), complete_confbridge_participant(), complete_config_option(), complete_config_type(), complete_indications(), conf_find_bridge(), conf_find_bridge_profile(), conf_find_user_profile(), conf_handle_talker_cb(), conf_set_menu_to_user(), confbridge_handle_atxfer(), confkick_exec(), contact_observer_updated(), contact_status_publish_update_task(), cpg_confchg_cb(), create_unsolicited_mwi_subscriptions(), dial_state_process_bridge_enter(), dialgroup_read(), dialgroup_write(), distributor(), endpoint_deleted_observer(), endpoint_internal_create(), endpoint_lookup(), extension_state_add_destroy(), featuregroup_find(), find_app_by_name(), find_calendar(), find_database(), find_device_state_subscription(), find_event(), find_hint_by_cb_id(), find_internal_state_by_transport(), find_member_by_queuename_and_interface(), find_peer(), find_pvt(), find_user(), find_variant(), func_confbridge_info(), generic_lock_unlock_helper(), generic_mute_unmute_helper(), get_buddy_status(), get_dialstatus(), get_dsn(), get_esc_entry(), get_monitored_transport_by_name(), get_name_from_resource(), get_state(), get_subscription(), get_system_cfg(), handle_bridge_enter_message(), handle_bridge_leave_message(), handle_bridge_pairings(), handle_channel_snapshot_update_message(), handle_cli_confbridge_kick(), handle_cli_confbridge_list(), handle_cli_confbridge_start_record(), handle_cli_confbridge_stop_record(), handle_cli_iax2_unregister(), handle_cli_indication_show(), handle_dial_message(), handle_incoming_sdp(), handle_manager_show_event(), handle_msg_cb(), handle_negotiated_sdp_session_media(), handle_parked_call_message(), has_destination_cb(), has_mwi_subscription(), hash_test_lookup(), hash_test_shrink(), iax2_destroy_helper(), ice_candidates_compare(), inprocess_count(), insert_test_duplicates(), jingle_action_hook(), jingle_endpoint_find(), jingle_request(), join_conference_bridge(), manager_fax_session(), manager_optimize_away(), manager_sipnotify(), mark_object_as_stale_in_cache(), media_cache_handle_show_item(), meetme_menu_admin(), meetmemute(), menu_find(), menu_template_handler(), monitored_transport_state_callback(), msg_data_find(), mwi_contact_deleted(), named_acl_find(), named_item_find(), namedgroup_match(), notify_option_find(), parse_tone_zone(), peercnt_add(), peercnt_modify(), peercnt_remove_by_addr(), pending_members_remove(), persistent_endpoint_find_or_create(), profile_destructor(), publish_cluster_discovery_to_stasis(), publisher_stop(), pubsub_on_rx_publish_request(), queue_mwi_event(), realtime_common(), realtime_sqlite3_require(), registration_deleted_observer(), reload_single_member(), remove_bridge_playback(), remove_from_cache(), remove_from_queue(), remove_oldest_from_cache(), routes_delete_cb(), save_dialstatus(), sched_delay_remove(), sdp_requires_deferral(), session_outgoing_nat_hook(), set_fn(), single_state_process_bridge_enter(), sip_options_aor_observer_deleted_task(), sip_options_aor_observer_modified_task(), sip_options_apply_aor_configuration(), sip_options_contact_add_management_task(), sip_options_contact_delete_management_task(), sip_options_contact_delete_task(), sip_options_contact_status_notify_task(), sip_options_endpoint_observer_deleted_task(), sip_options_endpoint_observer_modified_task(), sip_options_endpoint_state_compositor_find_or_alloc(), sip_options_endpoint_unlink_aor_feeders(), sip_options_remove_contact_status(), sip_options_synchronize_aor(), sip_options_synchronize_endpoint(), sip_options_update_endpoint_state_compositor_aor(), sip_outbound_publish_client_get_publisher(), sip_outbound_registration_apply(), sip_poke_peer_s(), sip_publish_state_get(), skel_find_or_create_state(), skel_level_find(), sla_find_station(), sla_find_trunk(), smdi_load(), smdi_msg_find(), sorcery_config_internal_load(), sorcery_config_retrieve_id(), sorcery_memory_cache_ami_expire(), sorcery_memory_cache_ami_expire_object(), sorcery_memory_cache_ami_populate(), sorcery_memory_cache_ami_stale(), sorcery_memory_cache_ami_stale_object(), sorcery_memory_cache_complete_object_name(), sorcery_memory_cache_dump(), sorcery_memory_cache_expire(), sorcery_memory_cache_populate(), sorcery_memory_cache_retrieve_id(), sorcery_memory_cache_show(), sorcery_memory_cache_stale(), sorcery_memory_create(), sorcery_memory_delete(), sorcery_memory_retrieve_id(), sorcery_memory_update(), sorcery_reloadable(), stasis_app_bridge_find_by_id(), stasis_app_bridge_moh_channel(), stasis_app_bridge_moh_stop(), stasis_app_bridge_playback_channel_find(), stasis_app_bridge_playback_channel_remove(), stasis_app_control_find_by_channel_id(), stasis_app_control_record(), stasis_app_exec(), stasis_app_message_handler(), stasis_app_playback_find_by_id(), stasis_app_recording_find_by_name(), stasis_app_send(), stasis_app_unregister(), stasis_message_type_declined(), stasis_topic_pool_delete_topic(), stasis_topic_pool_get_topic(), stasis_topic_pool_topic_exists(), statistics_show_subscription(), statistics_show_topic(), stir_shaken_general_get(), test_ao2_find_w_no_flags(), test_ao2_find_w_OBJ_KEY(), test_ao2_find_w_OBJ_PARTIAL_KEY(), test_ao2_find_w_OBJ_POINTER(), test_cel_peer_strings_match(), test_expected_duplicates(), test_item_find(), test_performance(), transport_state_do_reg_callbacks(), unsubscribe(), update_queue(), user_find(), user_profile_find(), ustmtext(), verify_default_parking_lot(), verify_default_profiles(), wait_bridge_wrapper_find_by_name(), xml_translate(), xmldoc_update_config_option(), xmldoc_update_config_type(), xmpp_client_config_merge_buddies(), xmpp_client_service_discovery_result_hook(), xmpp_component_register_get_hook(), xmpp_config_find(), xmpp_pak_message(), xmpp_pak_presence(), xmpp_pak_s10n(), and xmpp_roster_hook().

◆ ao2_get_weakproxy

#define ao2_get_weakproxy (   obj)    __ao2_get_weakproxy(obj, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 692 of file astobj2.h.

◆ ao2_global_obj_ref

#define ao2_global_obj_ref (   holder)    __ao2_global_obj_ref(&holder, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)
Examples:
/usr/src/asterisk-18.5.0/main/app.c.

Definition at line 925 of file astobj2.h.

Referenced by __ast_manager_event_multichan(), __ast_vm_greeter_register(), __ast_vm_register(), acf_jabberreceive_read(), acf_jabberstatus_read(), agent_run(), agents_post_apply_config(), app_exec(), ast_ari_config_get(), ast_cdr_engine_term(), ast_cdr_get_config(), ast_cdr_set_config(), ast_cel_backend_register(), ast_cel_backend_unregister(), ast_cel_check_enabled(), ast_cel_fabricate_channel_from_event(), ast_cel_get_config(), ast_cel_set_config(), ast_cel_track_event(), ast_get_builtin_feature(), ast_get_chan_applicationmap(), ast_get_chan_featuremap_config(), ast_get_chan_features_general_config(), ast_get_chan_features_pickup_config(), ast_get_chan_features_xfer_config(), ast_named_acl_find(), ast_parking_blind_transfer_park(), ast_parking_is_exten_park(), ast_parking_park_bridge_channel(), ast_parking_park_call(), ast_parking_provider_registered(), ast_parking_register_bridge_features(), ast_parking_unregister_bridge_features(), ast_sip_get_artificial_auth(), ast_sip_transport_monitor_register_replace(), ast_sip_transport_monitor_unregister(), ast_sip_transport_monitor_unregister_all(), ast_smdi_interface_find(), ast_statsd_log_string(), AST_TEST_DEFINE(), ast_udptl_new_with_bindaddr(), ast_vm_greeter_is_registered(), ast_vm_greeter_unregister(), ast_vm_is_registered(), ast_vm_test_swap_table_in(), ast_vm_test_swap_table_out(), ast_vm_unregister(), ast_xmpp_client_find(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), bridge_agent_hold_deferred_create(), build_mansession(), build_nonce(), cdr_detach(), cdr_submit_batch(), cdr_toggle_runtime_options(), cel_linkedid_ref(), cel_report_event(), cel_track_app(), check_manager_session_inuse(), check_retire_linkedid(), cli_complete_notify(), cli_display_named_acl(), cli_display_named_acl_list(), cli_notify(), cli_retrieve_by_id(), complete_bridge_profile_name(), complete_menu_name(), complete_user_profile_name(), conf_find_bridge_profile(), conf_find_user_profile(), conf_set_menu_to_user(), create_mwi_subscriptions(), delete_old_messages(), find_session(), find_session_by_nonce(), function_amiclient(), generate_or_link_lots_to_configs(), get_dialstatus(), get_feature_ds(), get_global_cfg(), get_monitored_transport_by_name(), get_state(), handle_cli_confbridge_show_bridge_profiles(), handle_cli_confbridge_show_menu(), handle_cli_confbridge_show_menus(), handle_cli_confbridge_show_user_profiles(), handle_cli_debug(), handle_cli_show_config(), handle_cli_status(), handle_cli_submit(), handle_feature_show(), handle_manager_show_event(), handle_manager_show_events(), handle_show_named_acl_cmd(), handle_showmanconn(), handle_skel_show_config(), handle_skel_show_levels(), hep_queue_cb(), hepv3_config_post_apply(), hepv3_get_uuid_type(), hepv3_is_loaded(), hepv3_send_packet(), http_callback(), is_cdr_flag_set(), is_enabled(), jingle_endpoint_state_find_or_create(), jingle_request(), keepalive_transport_thread(), line_identify(), manager_default_msg_cb(), manager_generic_msg_cb(), manager_jabber_send(), menu_template_handler(), module_config_post_apply(), monitored_transport_state_callback(), mwi_contact_changed(), mwi_contact_deleted(), mwi_subscription_established(), mwi_subscription_shutdown(), mwi_validate_for_aor(), nominal_test(), off_nominal_test(), parking_dynamic_lots_enabled(), post_cdr(), prometheus_config_post_apply(), prometheus_general_config_get(), prometheus_general_config_set(), purge_sessions(), registration_deleted_observer(), registration_loaded_observer(), reload_module(), remove_all_configured_parking_lot_extensions(), save_dialstatus(), send_initial_notify_all(), session_destroy(), sip_outbound_publish_synchronize(), sip_outbound_registration_apply(), sip_publish_state_get(), skel_find_or_create_state(), smdi_load(), sorcery_config_retrieve_fields(), sorcery_config_retrieve_id(), sorcery_config_retrieve_multiple(), sorcery_config_retrieve_prefix(), sorcery_config_retrieve_regex(), stasis_init(), stasis_message_type_declined(), stasis_subscription_statistics_create(), stasis_topic_statistics_create(), statistics_show_subscription(), statistics_show_subscriptions(), statistics_show_topic(), statistics_show_topics(), statsd_init(), submit_scheduled_batch(), subscription_dtor(), subscription_statistics_complete_name(), topic_dtor(), topic_statistics_complete_name(), transport_state_callback(), unbound_resolver_resolve(), unregister_all(), xmpp_action_hook(), xmpp_cli_create_collection(), xmpp_cli_create_leafnode(), xmpp_cli_delete_pubsub_node(), xmpp_cli_list_pubsub_nodes(), xmpp_cli_purge_pubsub_nodes(), xmpp_client_config_post_apply(), xmpp_client_find_or_create(), xmpp_client_reconnect(), xmpp_client_send_message(), xmpp_client_set_group_presence(), xmpp_client_set_presence(), xmpp_client_thread(), xmpp_component_register_get_hook(), xmpp_component_service_discovery_get_hook(), xmpp_component_service_discovery_items_hook(), xmpp_config_post_apply(), xmpp_config_prelink(), xmpp_connect_hook(), xmpp_init_event_distribution(), xmpp_join_exec(), xmpp_leave_exec(), xmpp_log_hook(), xmpp_pubsub_build_publish_skeleton(), xmpp_pubsub_handle_error(), xmpp_pubsub_iq_create(), xmpp_pubsub_publish_device_state(), xmpp_pubsub_subscribe(), xmpp_roster_hook(), xmpp_send_cb(), xmpp_send_exec(), xmpp_sendgroup_exec(), xmpp_show_buddies(), and xmpp_show_clients().

◆ ao2_global_obj_release

#define ao2_global_obj_release (   holder)    __ao2_global_obj_replace_unref(&holder, NULL, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)

◆ ao2_global_obj_replace

#define ao2_global_obj_replace (   holder,
  obj 
)    __ao2_global_obj_replace(&holder, (obj), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)

Definition at line 885 of file astobj2.h.

Referenced by unload_module().

◆ ao2_global_obj_replace_unref

#define ao2_global_obj_replace_unref (   holder,
  obj 
)    __ao2_global_obj_replace_unref(&holder, (obj), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)

◆ AO2_GLOBAL_OBJ_STATIC

#define AO2_GLOBAL_OBJ_STATIC (   name)
Value:
struct ao2_global_obj name = { \
}
#define AST_RWLOCK_INIT_VALUE
Definition: lock.h:98
static const char name[]
Definition: cdr_mysql.c:74

Define a global object holder to be used to hold an ao2 object, statically initialized.

Since
11.0
Parameters
nameThis will be the name of the object holder.

This macro creates a global object holder that can be used to hold an ao2 object accessible using the API. The structure is allocated and initialized to be empty.

Example usage:

static AO2_GLOBAL_OBJ_STATIC(global_cfg);

This defines global_cfg, intended to hold an ao2 object accessible using an API.

Examples:
/usr/src/asterisk-18.5.0/main/app.c.

Definition at line 848 of file astobj2.h.

◆ ao2_iterator_next

#define ao2_iterator_next (   iter)    __ao2_iterator_next((iter), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 1933 of file astobj2.h.

Referenced by __find_call(), __iax2_show_peers(), __manager_event_sessions_va(), __test_cel_generate_peer_str(), aco_set_defaults(), action_agents(), action_confbridgelistrooms(), action_coreshowchannels(), action_devicestatelist(), action_extensionstatelist(), action_meetmelist(), action_presencestatelist(), add_ice_to_sdp(), add_ice_to_stream(), agent_show_requested(), agents_post_apply_config(), agents_sweep(), alias_show(), ami_show_registration_contact_statuses(), app_to_json(), ari_show_apps(), ast_add_hint(), ast_ari_bridges_list(), ast_ari_channels_list(), ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), ast_ari_recordings_list_stored(), ast_bridge_channel_kick(), ast_bucket_file_json(), ast_bucket_json(), ast_cdr_setvar(), ast_channel_iterator_next(), ast_complete_channels(), ast_endpoint_snapshot_create(), ast_format_cache_get_by_codec(), ast_merge_contexts_and_delete(), ast_msg_var_iterator_get_next(), ast_multi_channel_blob_get_channels(), ast_pickup_find_by_group(), ast_print_namedgroups(), ast_rtp_ice_start(), ast_sip_destroy_scheduler(), ast_sip_for_each_contact(), ast_sorcery_objectset_create2(), ast_sorcery_objectset_json_create(), ast_srtp_unprotect(), AST_TEST_DEFINE(), ast_var_indications(), ast_var_indications_table(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), auth_observer(), authenticate(), authenticate_reply(), bridge_app_subscribed_involved(), bridge_channel_event_join_leave(), bridge_channel_moving(), bridge_channel_talking(), bridges_scrape_cb(), build_cli_notify(), calendar_query_exec(), cel_generate_peer_str(), channels_scrape_cb(), check_access(), check_events(), clear_queue(), cli_complete_endpoint(), cli_complete_notify(), cli_complete_registration(), cli_complete_show(), cli_complete_uri(), cli_console_active(), cli_display_named_acl_list(), cli_fax_show_sessions(), cli_list_devices(), cli_show_channels(), cli_show_modules(), cli_show_tasks(), cli_tps_reset_stats_all(), complete_bridge_profile_name(), complete_confbridge_name(), complete_config_module(), complete_core_show_hint(), complete_country(), complete_iax2_peers(), complete_iax2_unregister(), complete_menu_name(), complete_queue_remove_member(), complete_user_profile_name(), complete_userno(), conf_queue_dtmf(), config_hook_exec(), configure_parking_extensions(), container_to_json_array(), control_dispatch_all(), control_flush_queue(), control_prestart_dispatch_all(), destroy_pvts(), device_state_cb(), device_state_notify_callbacks(), dial_state_process_bridge_enter(), dialgroup_read(), disable_marked_lots(), dump_queue_members(), endpoints_scrape_cb(), event_session_shutdown(), exten_state_publisher_state_cb(), extension_state_cb(), fax_session_tab_complete(), find_queue_by_name_rt(), find_ringing_channel(), find_session(), find_session_by_nonce(), free_members(), generate_or_link_lots_to_configs(), get_device_state_causing_channels(), get_member_status(), get_transferee(), get_udp_transport(), get_write_timeout(), handle_bridge_pairings(), handle_bridge_show_all(), handle_chanlist(), handle_cli_confbridge_list(), handle_cli_confbridge_show_bridge_profiles(), handle_cli_confbridge_show_menus(), handle_cli_confbridge_show_user_profiles(), handle_cli_iax2_show_callno_limits(), handle_cli_iax2_show_users(), handle_cli_indication_show(), handle_cli_odbc_show(), handle_cli_sound_show(), handle_cli_status(), handle_export_primitives(), handle_manager_show_event(), handle_manager_show_events(), handle_show_calendar(), handle_show_calendars(), handle_show_hint(), handle_show_hints(), handle_show_named_acl_cmd(), handle_showmanconn(), handle_skel_show_games(), handle_skel_show_levels(), handle_voicemail_show_aliases(), has_mwi_subscription(), iax2_getpeername(), iax2_getpeertrunk(), ice_candidates_compare(), interface_exists(), ip_identify_apply(), jingle_add_google_candidates_to_transport(), jingle_add_ice_udp_candidates_to_transport(), jingle_request(), keepalive_transport_thread(), load_users(), local_devicestate(), locals_show(), manager_fax_sessions(), manager_iax2_show_peer_list(), manager_parking_status_all_lots(), manager_parking_status_single_lot(), manager_queues_status(), manager_queues_summary(), mark_lots_as_disabled(), media_cache_handle_show_item(), meetme_menu_admin_extended(), meetme_show_cmd(), moh_rescan_files(), msg_func_write(), mwi_contact_deleted(), mwi_initial_events(), mwi_mailbox_delete_all(), mwi_mailbox_get(), mwi_subscription_mailboxes_str(), num_available_members(), parking_lot_get_space(), pjsip_acf_dial_contacts_read(), pjsip_aor_function_read(), poke_all_peers(), presence_state_cb(), presence_state_notify_callbacks(), print_queue(), prune_peers(), prune_users(), purge_sessions(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuememberlist(), queue_mwi_event(), qupd_exec(), reload(), reload_single_queue(), remove_all_configured_parking_lot_extensions(), remove_pending_parking_lot_extensions(), rt_handle_member_record(), rtp_add_candidates_to_ice(), set_transfer_variables_all(), show_codecs(), single_state_process_bridge_enter(), sip_options_apply_aor_configuration(), sip_options_cleanup_task(), sip_options_endpoint_unlink_aor_feeders(), sip_options_get_endpoint_state_compositor_state(), sip_outbound_publish_synchronize(), sip_show_channels(), sip_show_channelstats(), sla_calc_station_delays(), sla_change_trunk_state(), sla_queue_event_conf(), sla_show_stations(), sla_show_trunks(), sorcery_memory_cache_complete_name(), sorcery_memory_cache_complete_object_name(), stasis_app_mailboxes_to_json(), stasis_app_set_global_debug(), stasis_app_to_cli(), stasis_show_topics(), statistics_show_subscription(), statistics_show_subscriptions(), statistics_show_topic(), statistics_show_topics(), stir_shaken_tab_complete_name(), stop_streams(), subscription_statistics_complete_name(), system_create_resolver_and_set_nameservers(), test_ao2_callback_traversal(), test_ao2_iteration(), test_expected_duplicates(), test_iterator_next(), topic_complete_name(), topic_statistics_complete_name(), tps_report_taskprocessor_list(), tps_taskprocessor_tab_complete(), try_calling(), unbound_config_preapply(), update_realtime_members(), xmpp_pubsub_create_affiliations(), xmpp_show_buddies(), and xmpp_show_clients().

◆ ao2_link

#define ao2_link (   container,
  obj 
)    __ao2_link((container), (obj), 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 1549 of file astobj2.h.

Referenced by __ast_sorcery_object_field_register(), __ast_sorcery_object_type_insert_wizard(), activate_thread(), add_calltoken_ignore(), add_column_name(), add_item(), add_new_event_cb(), agents_post_apply_config(), alloc_str(), alloc_variant(), ao2_weakproxy_unsubscribe(), app_exec(), append_event(), applicationmap_handler(), ast_add_hint(), ast_bridge_dtmf_hook(), ast_bridge_peers_nolock(), ast_bucket_file_metadata_set(), ast_cel_backend_register(), ast_change_hint(), ast_change_name(), ast_channel_dialed_causes_add(), ast_config_hook_register(), ast_datastores_add(), ast_extension_state3(), ast_get_chan_applicationmap(), ast_get_namedgroups(), ast_merge_contexts_and_delete(), ast_module_register(), ast_multi_channel_blob_add_channel(), ast_multi_channel_blob_get_channels(), ast_phoneprov_provider_register(), ast_register_indication_country(), ast_rtp_ice_add_cand(), ast_rtp_ice_add_remote_candidate(), ast_sip_publish_client_add_datastore(), ast_sip_register_cli_formatter(), ast_sip_schedule_task(), ast_sip_session_add_datastore(), ast_sip_session_register_sdp_handler(), ast_smdi_md_message_push(), ast_smdi_mwi_message_push(), ast_sorcery_global_observer_add(), ast_sorcery_instance_observer_add(), ast_sorcery_object_fields_register(), ast_sorcery_observer_add(), ast_sorcery_wizard_observer_add(), ast_str_container_add(), AST_TEST_DEFINE(), ast_xmldoc_build_documentation(), astobj2_test_1_helper(), bridge_create_common(), bridge_other_hook(), bridge_register(), build_calendar(), build_callno_limits(), build_device(), build_mansession(), build_route(), cache_dump_by_eid_cb(), cache_entry_dump(), caldav_add_event(), can_ring_entry(), cel_linkedid_ref(), chan_pjsip_add_hold(), channel_do_masquerade(), channel_replaced_cb(), cli_contact_populate_container(), cli_gather_contact(), cli_message_to_snapshot(), command_prestart_queue_command(), conf_run(), contact_link_static(), context_table_create_autohints(), create_new_sip_etag(), create_unsolicited_mwi_subscriptions(), dialgroup_write(), endelm(), endpoint_internal_create(), event_session_alloc(), extension_state_add_destroy(), fax_session_new(), featuregroup_handler(), find_channel_by_group(), generate_parked_user(), get_or_create_subscription(), grow(), handle_channel_snapshot_update_message(), handle_scan_file(), hash_test_grow(), icalendar_add_event(), inprocess_count(), insert_test_duplicates(), insert_test_vector(), jingle_action_session_initiate(), jingle_request(), join_conference_bridge(), link_option_to_types(), load_aliases(), load_config(), local_request_with_stream_topology(), media_cache_item_populate_from_astdb(), member_add_to_queue(), merge_container_cb(), mock_retrieve_multiple(), monitored_transport_state_callback(), msg_set_var_full(), mwi_mailbox_get(), mwi_on_aor(), mwi_subscription_established(), notify_option_handler(), odbc_register_class(), on_dns_update_peer(), parking_lot_build_or_update(), parse_config(), parse_tag(), peercnt_add(), permanent_uri_handler(), populate_transport_states(), process_category(), pubsub_on_rx_publish_request(), queued_active_thread_idle(), realtime_common(), realtime_peer(), realtime_user(), register_aor_core(), registrar_add_non_permanent(), reload_single_member(), save_dialstatus(), set_config(), set_fn(), sip_monitor_instance_init(), sip_options_aor_observer_modified_task(), sip_options_apply_aor_configuration(), sip_options_contact_add_task(), sip_options_contact_status_notify_task(), sip_options_set_contact_status(), sip_options_synchronize_aor(), sip_options_update_endpoint_state_compositor_aor(), sip_outbound_publish_client_add_publisher(), sip_outbound_registration_apply(), sla_build_station(), sla_build_trunk(), smdi_load(), sorcery_astdb_retrieve_fields_common(), sorcery_astdb_retrieve_prefix(), sorcery_astdb_retrieve_regex(), sorcery_config_fields_cmp(), sorcery_config_internal_load(), sorcery_memory_cache_fields_cmp(), sorcery_memory_cache_load(), sorcery_memory_fields_cmp(), sorcery_memory_update(), sorcery_realtime_retrieve_multiple(), stasis_app_bridge_playback_channel_add(), stasis_app_control_play_uri(), stasis_app_control_record(), stasis_app_exec(), stasis_subscription_statistics_create(), stasis_topic_statistics_create(), store_by_peercallno(), store_by_transfercallno(), test_performance(), test_sub(), transport_state_callback(), ustmtext(), verify_default_parking_lot(), verify_default_profiles(), wait_bridge_wrapper_alloc(), xml_translate(), xmpp_client_config_merge_buddies(), xmpp_client_create_buddy(), and zombify_threads().

◆ ao2_link_flags

#define ao2_link_flags (   container,
  obj,
  flags 
)    __ao2_link((container), (obj), (flags), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

◆ ao2_lock

#define ao2_lock (   a)    __ao2_lock(a, AO2_LOCK_REQ_MUTEX, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)

Definition at line 718 of file astobj2.h.

Referenced by __ao2_ref(), __ao2_weakproxy_get_object(), __ao2_weakproxy_ref_object(), __ao2_weakproxy_set_object(), __ast_channel_alloc_ap(), __ast_named_lock_get(), __ast_sorcery_wizard_register(), __cleanup_registration(), __queues_show(), __rtp_recvfrom(), __rtp_sendto(), __stasis_app_register(), __state_find_or_add(), _moh_register(), _sip_show_peer(), _sip_show_peers(), _sip_show_peers_one(), _sip_tcp_helper_thread(), action_confbridgelist(), action_confbridgelistrooms(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_confbridgestoprecord(), action_extensionstatelist(), action_kick_last(), action_toggle_mute_participants(), action_waitevent(), add_calltoken_ignore(), add_sdp(), add_to_queue(), ao2_weakproxy_subscribe(), ao2_weakproxy_unsubscribe(), app_control_register_rule(), app_control_unregister_rule(), app_deactivate(), app_event_filter_set(), app_exec(), app_is_active(), app_is_finished(), app_send(), app_shutdown(), app_subscribe_bridge(), app_subscribe_channel(), app_subscribe_endpoint(), app_update(), ari_bridges_play_found(), ari_bridges_play_new(), ast_add_hint(), ast_ari_applications_list(), ast_bridge_channel_get_chan(), ast_bridge_join(), ast_cdr_clear_property(), ast_cdr_getvar(), ast_cdr_reset(), ast_cdr_serialize_variables(), ast_cdr_set_property(), ast_cdr_setuserfield(), ast_cdr_setvar(), ast_change_hint(), ast_change_name(), ast_dns_resolve_recurring_cancel(), ast_endpoint_add_channel(), ast_endpoint_set_max_channels(), ast_endpoint_set_state(), ast_extension_state_del(), ast_get_indication_tone(), ast_get_indication_zone(), ast_hint_presence_state(), ast_hook_send_action(), ast_local_get_peer(), ast_local_setup_bridge(), ast_local_setup_masquerade(), ast_manager_unregister(), ast_merge_contexts_and_delete(), ast_moh_files_next(), ast_register_indication_country(), ast_remove_hint(), ast_res_pjsip_find_or_create_contact_status(), ast_rtcp_interpret(), ast_rtcp_write(), ast_rtp_bundle(), ast_rtp_codecs_payloads_clear(), ast_rtp_codecs_payloads_set_m_type(), ast_rtp_codecs_payloads_set_rtpmap_type_rate(), ast_rtp_codecs_payloads_unset(), ast_rtp_codecs_payloads_xover(), ast_rtp_destroy(), ast_rtp_ice_add_cand(), ast_rtp_ice_start(), ast_rtp_ice_start_media(), ast_rtp_ice_stop(), ast_rtp_ice_turn_request(), ast_rtp_instance_activate(), ast_rtp_instance_add_srtp_policy(), ast_rtp_instance_available_formats(), ast_rtp_instance_bundle(), ast_rtp_instance_change_source(), ast_rtp_instance_dtmf_begin(), ast_rtp_instance_dtmf_end(), ast_rtp_instance_dtmf_end_with_duration(), ast_rtp_instance_dtmf_mode_get(), ast_rtp_instance_dtmf_mode_set(), ast_rtp_instance_extmap_clear(), ast_rtp_instance_extmap_count(), ast_rtp_instance_extmap_enable(), ast_rtp_instance_extmap_get_direction(), ast_rtp_instance_extmap_get_extension(), ast_rtp_instance_extmap_get_id(), ast_rtp_instance_extmap_negotiate(), ast_rtp_instance_fd(), ast_rtp_instance_get_and_cmp_local_address(), ast_rtp_instance_get_and_cmp_requested_target_address(), ast_rtp_instance_get_bridged(), ast_rtp_instance_get_cname(), ast_rtp_instance_get_extended_prop(), ast_rtp_instance_get_incoming_source_address(), ast_rtp_instance_get_local_address(), ast_rtp_instance_get_prop(), ast_rtp_instance_get_recv_buffer_count(), ast_rtp_instance_get_recv_buffer_max(), ast_rtp_instance_get_requested_target_address(), ast_rtp_instance_get_send_buffer_count(), ast_rtp_instance_get_ssrc(), ast_rtp_instance_get_stats(), ast_rtp_instance_new(), ast_rtp_instance_read(), ast_rtp_instance_sendcng(), ast_rtp_instance_set_bridged(), ast_rtp_instance_set_extended_prop(), ast_rtp_instance_set_incoming_source_address(), ast_rtp_instance_set_local_address(), ast_rtp_instance_set_prop(), ast_rtp_instance_set_qos(), ast_rtp_instance_set_read_format(), ast_rtp_instance_set_remote_ssrc(), ast_rtp_instance_set_requested_target_address(), ast_rtp_instance_set_schedid(), ast_rtp_instance_set_stream_num(), ast_rtp_instance_set_write_format(), ast_rtp_instance_stop(), ast_rtp_instance_update_source(), ast_rtp_instance_write(), ast_rtp_local_bridge(), ast_rtp_on_turn_rtcp_state(), ast_rtp_on_turn_rtp_state(), ast_rtp_on_turn_rx_rtcp_data(), ast_rtp_on_turn_rx_rtp_data(), ast_rtp_prop_set(), ast_rtp_read(), ast_rtp_red_buffer(), ast_rtp_red_init(), ast_rtp_set_remote_ssrc(), ast_rtp_stop(), ast_serializer_shutdown_group_join(), ast_set_indication_country(), ast_sip_dialog_get_endpoint(), ast_sip_dialog_set_endpoint(), ast_sip_dialog_set_serializer(), ast_sip_get_transport_state(), ast_sip_location_add_contact(), ast_sip_location_retrieve_aor_contacts_filtered(), ast_sip_message_apply_transport(), ast_sip_sched_task_cancel(), ast_sip_sched_task_get_name(), ast_sip_sched_task_get_times2(), ast_sip_schedule_task(), ast_sip_session_suspend(), ast_sip_session_unsuspend(), ast_sip_set_tpselector_from_transport(), ast_sip_transport_monitor_register_replace(), ast_sip_transport_monitor_unregister(), ast_sip_transport_state_set_preferred_identity(), ast_sip_transport_state_set_service_routes(), ast_sip_transport_state_set_transport(), ast_taskprocessor_alert_set_levels(), ast_taskprocessor_create_with_listener(), ast_taskprocessor_execute(), ast_taskprocessor_get(), ast_taskprocessor_is_task(), ast_taskprocessor_suspend(), ast_taskprocessor_unreference(), ast_taskprocessor_unsuspend(), AST_TEST_DEFINE(), ast_threadpool_shutdown(), ast_unreal_answer(), ast_unreal_channel_push_to_bridge(), ast_unreal_digit_begin(), ast_unreal_digit_end(), ast_unreal_fixup(), ast_unreal_lock_all(), ast_unreal_queryoption(), ast_unreal_sendhtml(), ast_unreal_sendtext(), ast_unreal_setoption(), ast_unreal_write_stream(), ast_unregister_indication_country(), ast_websocket_close(), ast_websocket_server_add_protocol2(), ast_websocket_write(), ast_xmpp_client_lock(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), auth_http_callback(), bridge_candidate_process(), bridge_channel_ind_thread(), bridge_impart_internal(), bridge_manager_destroy(), bridge_manager_service_req(), bridge_manager_thread(), bridge_move(), bridge_p2p_rtp_write(), bridge_parking_pull(), build_callno_limits(), build_peer(), build_reply_digest(), calendar_destructor(), can_ring_entry(), cdr_all_relink(), cdr_all_unlink(), cdr_object_dispatch_all_cb(), cel_linkedid_ref(), change_callid_pvt(), change_priority_caller_on_queue(), channel_do_masquerade(), check_retire_linkedid(), clear_stats(), cli_fax_show_sessions(), cli_show_channel(), cli_show_tasks(), compare_weight(), complete_core_show_hint(), complete_queue_remove_member(), complete_sip_user(), conf_announce_channel_push(), conf_ended(), conf_find_bridge_profile(), conf_find_menu_entry_by_sequence(), conf_find_user_profile(), conf_handle_talker_cb(), conf_moh_suspend(), conf_moh_unsuspend(), conf_run(), conf_send_event_to_participants(), confbridge_handle_atxfer(), control_mark_done(), control_swap_channel_in_bridge(), control_wait(), create_addr_from_peer(), create_dynamic_lot_full(), create_mwi_subscriptions(), create_unsolicited_mwi_subscriptions(), db_destructor(), db_open(), db_sync_thread(), device_state_cb(), device_state_notify_callbacks(), dial_masquerade_breakdown(), dial_masquerade_datastore_remove_chan(), dial_masquerade_fixup(), dial_state_process_bridge_enter(), distributor(), dns_query_recurring_resolution_callback(), dns_query_recurring_scheduled_callback(), endpoint_cache_clear(), endpt_send_request(), endpt_send_request_cb(), event_session_update_websocket(), exec_command_on_condition(), execute_menu_entry(), execute_state_callback(), expire_contact(), extension_state_add_destroy(), extension_state_cb(), find_member_by_queuename_and_interface(), find_queue_by_name_rt(), find_session(), find_session_by_nonce(), func_confbridge_info(), generate_parked_user(), generic_http_callback(), generic_lock_unlock_helper(), get_chan_by_ast_name(), get_dsn(), get_input(), get_member_penalty(), get_member_status(), handle_attended_transfer(), handle_blind_transfer(), handle_bridge_leave_message(), handle_channel_snapshot_update_message(), handle_cli_confbridge_list(), handle_cli_confbridge_show_bridge_profiles(), handle_cli_confbridge_show_menu(), handle_cli_confbridge_show_menus(), handle_cli_confbridge_show_user_profiles(), handle_cli_confbridge_start_record(), handle_cli_confbridge_stop_record(), handle_cli_misdn_send_facility(), handle_cli_moh_show_files(), handle_dial_message(), handle_hangup(), handle_manager_show_events(), handle_masquerade(), handle_parked_call_message(), handle_parking_bridge_enter_message(), handle_request_subscribe(), handle_show_hint(), handle_show_hints(), handle_showmanconn(), handle_standard_bridge_enter_message(), handle_stasis_state(), handle_video_on_exit(), handle_video_on_join(), ice_create(), ice_reset_session(), inprocess_count(), instance_destructor(), internal_bridge_after_cb(), internal_extension_state_extended(), is_our_turn(), is_subscribed_device_state_lock(), jingle_fixup(), jingle_hangup(), jingle_new(), jingle_request(), jingle_session_lock_full(), join_conference_bridge(), join_queue(), kqueue_timer_ack(), kqueue_timer_disable_continuous(), kqueue_timer_enable_continuous(), kqueue_timer_set_rate(), leave_conference(), leave_queue(), load_indications(), local_ast_moh_start(), local_call(), local_devicestate(), local_hangup(), locals_show(), lock_thread(), manager_fax_sessions_entry(), manager_optimize_away(), manager_queues_status(), manager_queues_summary(), manager_show_registry(), manager_sip_peer_status(), member_add_to_queue(), member_remove_from_queue(), memory_cache_stale_update_object(), messaging_app_subscribe_endpoint(), messaging_app_unsubscribe_endpoint(), moh_class_destructor(), moh_files_alloc(), moh_release(), moh_scan_files(), mohalloc(), monmp3thread(), msg_data_func_read(), msg_data_func_write(), msg_func_read(), msg_func_write(), msg_send_exec(), mwi_contact_changed(), mwi_contact_deleted(), mwi_subscription_shutdown(), mwi_validate_for_aor(), on_dns_update_peer(), park_common_setup(), parking_duration_callback(), parking_lot_retrieve_parked_user(), parking_lot_search_context_extension_inuse(), parking_park_bridge_channel(), pbx_outgoing_attempt(), pbx_outgoing_exec(), peercnt_add(), peercnt_remove(), presence_state_notify_callbacks(), process_events(), process_message(), pthread_timer_ack(), pthread_timer_disable_continuous(), pthread_timer_enable_continuous(), pthread_timer_get_event(), pthread_timer_open(), pthread_timer_set_rate(), publish_cluster_discovery_to_stasis(), publish_msg(), publisher_start(), purge_sessions(), push_to_serializer(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuegetchannel(), queue_function_queuememberlist(), queue_function_queuewaitingcount(), queue_function_var(), qupd_exec(), realtime_sqlite3_exec_query_with_handle(), realtime_sqlite3_exec_update_with_handle(), recalc_holdtime(), record_abandoned(), red_write(), register_aor(), register_contact_transport_remove_cb(), register_contact_transport_shutdown_cb(), register_verify(), reload_queues(), reload_single_member(), reload_single_queue(), remove_attended_transfer_stimulus(), remove_from_queue(), ring_entry(), rna(), rtcp_debug_test_addr(), rtp_add_candidates_to_ice(), rtp_codecs_payloads_copy_rx(), rtp_codecs_payloads_copy_tx(), rtp_deallocate_transport(), rtp_dtls_wrap_active(), rtp_dtls_wrap_get_connection(), rtp_dtls_wrap_get_fingerprint(), rtp_dtls_wrap_get_fingerprint_hash(), rtp_dtls_wrap_get_setup(), rtp_dtls_wrap_reset(), rtp_dtls_wrap_set_configuration(), rtp_dtls_wrap_set_fingerprint(), rtp_dtls_wrap_set_setup(), rtp_dtls_wrap_stop(), rtp_ice_wrap_add_remote_candidate(), rtp_ice_wrap_change_components(), rtp_ice_wrap_get_local_candidates(), rtp_ice_wrap_get_password(), rtp_ice_wrap_get_ufrag(), rtp_ice_wrap_ice_lite(), rtp_ice_wrap_set_authentication(), rtp_ice_wrap_set_role(), rtp_ice_wrap_start(), rtp_ice_wrap_stop(), rtp_ice_wrap_turn_request(), rtp_transport_wide_cc_feedback_produce(), rtp_write_rtcp_fir(), rtp_write_rtcp_psfb(), run_task(), run_timer(), schedule_calendar_event(), send_request_timer_callback(), serializer_shutdown_group_dec(), serializer_shutdown_group_inc(), session_do(), set_dial_masquerade(), set_eventmask(), set_member_paused(), set_member_penalty_help_members(), set_member_ringinuse_help_members(), set_queue_variables(), single_state_process_bridge_enter(), sip_keepalive_all_peers(), sip_options_endpoint_compositor_add_task(), sip_options_endpoint_state_compositor_find_or_alloc(), sip_options_endpoint_unlink_aor_feeders(), sip_options_notify_endpoint_state_compositors(), sip_options_synchronize_aor_task(), sip_options_synchronize_endpoint(), sip_outbound_publish_timer_cb(), sip_outbound_registration_apply(), sip_poke_all_peers(), sip_prune_realtime(), sip_send_all_registers(), sip_send_mwi_to_peer(), sip_session_suspend_task(), sip_show_inuse(), sip_show_mwi(), sip_show_objects(), sip_show_registry(), sip_show_user(), sip_show_users(), sip_tcptls_write(), sla_add_trunk_to_station(), sla_build_station(), sla_build_trunk(), sla_change_trunk_state(), sla_queue_event_conf(), sla_show_stations(), sla_show_trunks(), sla_state(), sla_station_exec(), sla_station_is_marked(), sla_station_mark(), sla_trunk_is_marked(), sla_trunk_mark(), sorcery_memory_create(), sorcery_memory_update(), spandsp_fax_cli_show_session(), spandsp_manager_fax_session(), stasis_app_bridge_moh_channel(), stasis_app_control_execute_until_exhausted(), stasis_app_event_allowed(), stasis_app_get_bridge(), stasis_app_message_handler(), stasis_message_router_add(), stasis_message_router_add_cache_update(), stasis_message_router_remove(), stasis_message_router_remove_cache_update(), stasis_message_router_set_formatters_default(), stasis_message_router_unsubscribe(), stasis_show_topic(), stasis_state_add_subscriber(), stasis_state_publish(), stasis_state_publish_by_id(), stasis_state_remove_publish_by_id(), stasis_state_subscriber_data(), stasis_subscription_accept_formatters(), stasis_subscription_accept_message_type(), stasis_subscription_decline_message_type(), stasis_subscription_is_done(), stasis_subscription_is_subscribed(), stasis_subscription_join(), stasis_subscription_set_filter(), statistics_show_subscription(), stimulate_attended_transfer(), subscribe_device_state(), subscriber_dtor(), subscription_invoke(), taskprocessor_push(), test_lock(), threadpool_execute(), timerfd_timer_ack(), timerfd_timer_disable_continuous(), timerfd_timer_enable_continuous(), timerfd_timer_get_event(), timerfd_timer_set_rate(), topic_add_subscription(), topic_remove_subscription(), tps_reset_stats(), try_calling(), unreal_queue_frame(), unreal_queue_indicate(), unsubscribe(), unsubscribe_device_state(), update_call_counter(), update_peer_lastmsgssent(), update_queue(), update_realtime_members(), wait_wrapper_removal(), ws_safe_read(), xmpp_client_service_discovery_result_hook(), xmpp_pak_presence(), and xmpp_pak_s10n().

◆ ao2_rdlock

#define ao2_rdlock (   a)    __ao2_lock(a, AO2_LOCK_REQ_RDLOCK, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)

◆ ao2_ref

#define ao2_ref (   o,
  delta 
)    __ao2_ref((o), (delta), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 464 of file astobj2.h.

Referenced by __aco_option_register(), __allocate_taskprocessor(), __analog_ss_thread(), __ao2_cleanup(), __ao2_iterator_next(), __ao2_link(), __ao2_ref(), __ao2_weakproxy_find(), __ast_channel_alloc_ap(), __ast_codec_register_with_format(), __ast_format_cap_alloc(), __ast_format_interface_register(), __ast_module_user_add(), __ast_module_user_hangup_all(), __ast_module_user_remove(), __ast_read(), __ast_sorcery_open(), __container_unlink_node_debug(), __features_config_alloc(), __find_callno(), __has_voicemail(), __init_manager(), __queues_show(), __rtp_recvfrom(), __rtp_sendto(), __unload_module(), _ast_odbc_request_obj2(), _moh_class_malloc(), _mohclass_unref(), _sip_tcp_helper_thread(), acf_faxopt_read(), acf_faxopt_write(), aco_option_register_deprecated(), aco_process_var(), aco_set_defaults(), action_agents(), action_confbridgekick(), action_confbridgelist(), action_confbridgelist_item(), action_confbridgelistrooms(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_confbridgestoprecord(), action_coreshowchannels(), action_devicestatelist(), action_extensionstatelist(), action_meetmelist(), action_messagesend(), action_presencestatelist(), add_calltoken_ignore(), add_cc_call_info_to_response(), add_column_name(), add_datastore(), add_event_to_list(), add_format_information_cb(), add_hintdevice(), add_ice_to_sdp(), add_ice_to_stream(), add_item(), add_mwi_datastore(), add_sdp(), add_to_dial_bridge(), add_to_queue(), add_transferer_role(), admin_exec(), agent_after_bridge_cb(), agent_after_bridge_cb_failed(), agent_alert(), agent_bridge_channel_get_lock(), agent_function_read(), agent_handle_show_specific(), agent_pvt_devstate_get(), agent_pvt_new(), agent_request_exec(), agent_run(), agent_show_requested(), agents_cfg_alloc(), agents_post_apply_config(), agents_sweep(), alias_show(), alloc_notify_task_data(), alloc_playback_chan(), alloc_str(), alloc_variant(), allocate_subscription_tree(), allow_and_or_replace_unsolicited(), ami_outbound_registration_task(), ami_register(), ami_show_aors(), ami_show_auths(), ami_show_contacts(), ami_show_outbound_registrations(), ami_show_registration_contact_statuses(), ami_sip_qualify(), ami_unregister(), analog_ss_thread(), announce_hangup(), announce_request(), announce_thread(), anonymous_identify(), ao2_iterator_restart(), ao2_ref_and_lock(), aoc_publish_blob(), aor_alloc(), aor_deleted_observer(), app_create(), app_exec(), app_handle_subscriptions(), app_send_command_on_condition(), app_subscribe_bridge(), app_subscribe_channel(), app_subscribe_endpoint(), app_to_json(), append_channel_vars(), apply_cap_to_bundled(), ari_channels_handle_originate_with_id(), ari_set_debug(), ari_show_app(), ari_show_apps(), ast_add_hint(), ast_ari_add_handler(), ast_ari_applications_filter(), ast_ari_asterisk_update_object(), ast_ari_bridges_clear_video_source(), ast_ari_bridges_list(), ast_ari_bridges_set_video_source(), ast_ari_channels_create(), ast_ari_channels_get(), ast_ari_channels_list(), ast_ari_config_validate_user(), ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), ast_ari_endpoints_send_message_to_endpoint(), ast_ari_websocket_events_event_websocket_established(), ast_ari_websocket_session_create(), ast_bridge_blob_create(), ast_bridge_blob_create_from_snapshots(), ast_bridge_channel_feature_digit(), ast_bridge_channel_kick(), ast_bridge_channel_lock_bridge(), ast_bridge_channel_merge_inhibit(), ast_bridge_channel_write_unhold(), ast_bridge_depart(), ast_bridge_destroy(), ast_bridge_dtmf_hook(), ast_bridge_features_cleanup(), ast_bridge_get_snapshot_by_uniqueid(), ast_bridge_interval_hook(), ast_bridge_join(), ast_bridge_notify_masquerade(), ast_bridge_parking_init(), ast_bridge_publish_attended_transfer(), ast_bridge_publish_enter(), ast_bridge_publish_leave(), ast_bridge_publish_merge(), ast_bridge_publish_state(), ast_bridge_snapshot_create(), ast_bridge_transfer_acquire_bridge(), ast_bucket_alloc(), ast_bucket_file_alloc(), ast_bucket_file_copy(), ast_bucket_file_json(), ast_bucket_json(), ast_calendar_unref_event(), ast_cdr_fork(), ast_cel_backend_register(), ast_cel_backend_unregister(), ast_cel_general_config_alloc(), ast_cel_get_config(), ast_cel_set_config(), ast_change_hint(), ast_channel_bridge_peer(), ast_channel_dialed_causes_add(), ast_channel_get_bridge(), ast_channel_get_bridge_channel(), ast_channel_get_vars(), ast_channel_internal_setup_topics(), ast_channel_publish_blob(), ast_channel_publish_cached_blob(), ast_channel_publish_dial_internal(), ast_channel_publish_final_snapshot(), ast_channel_publish_snapshot(), ast_channel_snapshot_create(), ast_channel_suppress(), ast_closestream(), ast_codec_samples_count(), ast_complete_channels(), ast_config_hook_register(), ast_config_text_file_save2(), ast_datastores_alloc_datastore(), ast_dns_query_set_add(), ast_dns_query_set_create(), ast_dns_query_set_resolve_async(), ast_dns_resolve(), ast_dns_resolve_async(), ast_dns_resolve_recurring(), ast_dns_resolve_recurring_cancel(), ast_endpoint_blob_create(), ast_endpoint_blob_publish(), ast_endpoint_latest_snapshot(), ast_endpoint_shutdown(), ast_extension_state3(), ast_extension_state_del(), ast_extension_state_extended(), ast_format_attribute_get(), ast_format_attribute_set(), ast_format_cache_get_by_codec(), ast_format_cap_append_by_type(), ast_format_cap_get_best_by_type(), ast_format_cap_get_compatible(), ast_format_cap_get_format(), ast_format_cap_remove_by_type(), ast_format_clone(), ast_format_create_named(), ast_format_generate_sdp_fmtp(), ast_format_parse_sdp_fmtp(), ast_get_chan_applicationmap(), ast_get_chan_featuremap_config(), ast_get_chan_features_atxferabort(), ast_get_chan_features_general_config(), ast_get_chan_features_pickup_config(), ast_get_chan_features_xfer_config(), ast_get_chan_features_xferfailsound(), ast_get_namedgroups(), ast_hangup(), ast_iax2_new(), ast_local_get_peer(), ast_local_setup_bridge(), ast_local_setup_masquerade(), ast_local_unlock_all(), ast_manager_event_blob_create(), ast_media_cache_create_or_update(), ast_media_cache_delete(), ast_media_cache_exists(), ast_media_cache_retrieve(), ast_media_cache_retrieve_metadata(), ast_media_get_media(), ast_media_get_variants(), ast_media_index_create(), ast_merge_contexts_and_delete(), ast_module_register(), ast_moh_destroy(), ast_moh_files_next(), ast_msg_alloc(), ast_msg_destroy(), ast_msg_get_var(), ast_msg_queue(), ast_msg_ref(), ast_msg_send(), ast_msg_var_iterator_get_next(), ast_multi_channel_blob_add_channel(), ast_multi_channel_blob_create(), ast_multi_channel_blob_get_channel(), ast_multi_channel_blob_get_channels(), ast_multi_object_blob_create(), ast_multi_object_blob_single_channel_publish(), ast_mwi_blob_create(), ast_mwi_mailbox_delete_all(), ast_mwi_mailbox_delete_by_regex(), ast_mwi_publish(), ast_mwi_publish_by_mailbox(), ast_odbc_get_max_connections(), ast_odbc_release_obj(), ast_openstream_full(), ast_openvstream(), ast_parked_call_payload_create(), ast_phoneprov_provider_register(), ast_pickup_find_by_group(), ast_pjsip_rdata_get_endpoint(), ast_print_namedgroups(), ast_query_set_resolve(), ast_ref_namedgroups(), ast_remove_hint(), ast_res_pjsip_find_or_create_contact_status(), ast_rtcp_write(), ast_rtp_bundle(), ast_rtp_codecs_payload_replace_format(), ast_rtp_codecs_payloads_set_m_type(), ast_rtp_codecs_payloads_set_rtpmap_type_rate(), ast_rtp_destroy(), ast_rtp_engine_unload_format(), ast_rtp_ice_add_cand(), ast_rtp_ice_add_remote_candidate(), ast_rtp_ice_get_local_candidates(), ast_rtp_ice_start(), ast_rtp_ice_stop(), ast_rtp_ice_turn_request(), ast_rtp_instance_make_compatible(), ast_rtp_instance_new(), ast_rtp_interpret(), ast_rtp_lookup_mime_multiple2(), ast_rtp_on_turn_rx_rtcp_data(), ast_rtp_on_turn_rx_rtp_data(), ast_rtp_prop_set(), ast_rtp_publish_rtcp_message(), ast_rtp_stop(), ast_serializer_pool_destroy(), ast_settimeout_full(), ast_sip_channel_pvt_alloc(), ast_sip_create_joint_call_cap(), ast_sip_create_subscription(), ast_sip_destroy_cli(), ast_sip_destroy_scheduler(), ast_sip_destroy_sorcery_transport(), ast_sip_dialog_get_endpoint(), ast_sip_dialog_get_session(), ast_sip_dialog_set_endpoint(), ast_sip_dialog_set_serializer(), ast_sip_for_each_aor(), ast_sip_for_each_contact(), ast_sip_get_artificial_endpoint(), ast_sip_get_contact_expiration_check_interval(), ast_sip_get_debug(), ast_sip_get_default_from_user(), ast_sip_get_default_realm(), ast_sip_get_default_voicemail_extension(), ast_sip_get_disable_multi_domain(), ast_sip_get_endpoint_identifier_order(), ast_sip_get_ignore_uri_user_options(), ast_sip_get_keep_alive_interval(), ast_sip_get_max_initial_qualify_time(), ast_sip_get_mwi_disable_initial_unsolicited(), ast_sip_get_mwi_tps_queue_high(), ast_sip_get_mwi_tps_queue_low(), ast_sip_get_norefersub(), ast_sip_get_regcontext(), ast_sip_get_send_contact_status_on_update_registration(), ast_sip_get_taskprocessor_overload_trigger(), ast_sip_get_transport_state(), ast_sip_get_unidentified_request_thresholds(), ast_sip_get_use_callerid_contact(), ast_sip_global_default_outbound_endpoint(), ast_sip_initialize_transport_events(), ast_sip_initialize_transport_management(), ast_sip_location_create_contact(), ast_sip_location_prune_boot_contacts(), ast_sip_location_retrieve_contact_and_aor_from_list_filtered(), ast_sip_message_apply_transport(), ast_sip_persistent_endpoint_publish_contact_state(), ast_sip_persistent_endpoint_update_state(), ast_sip_publish_client_alloc_datastore(), ast_sip_publish_client_get(), ast_sip_publish_client_get_user_from_uri(), ast_sip_publish_client_get_user_to_uri(), ast_sip_publish_client_user_send(), ast_sip_sched_is_task_running_by_name(), ast_sip_sched_task_cancel_by_name(), ast_sip_sched_task_get_next_run_by_name(), ast_sip_sched_task_get_times_by_name2(), ast_sip_schedule_task(), ast_sip_session_alloc(), ast_sip_session_alloc_datastore(), ast_sip_session_create_outgoing(), ast_sip_session_defer_termination(), ast_sip_session_media_state_add(), ast_sip_session_suspend(), ast_sip_session_unsuspend(), ast_sip_set_tpselector_from_transport(), ast_sip_subscription_notify(), ast_sip_transport_monitor_register_replace(), ast_sip_transport_monitor_unregister(), ast_sip_transport_monitor_unregister_all(), ast_sip_transport_state_set_preferred_identity(), ast_sip_transport_state_set_service_routes(), ast_sip_transport_state_set_transport(), ast_sip_unregister_cli_formatter(), ast_smdi_interface_find(), ast_sorcery_alloc(), ast_sorcery_global_observer_add(), ast_sorcery_instance_observer_add(), ast_sorcery_object_set_congestion_levels(), ast_sorcery_objectset_create2(), ast_sorcery_objectset_json_create(), ast_sorcery_observer_add(), ast_sorcery_ref(), ast_sorcery_retrieve_by_id(), ast_sorcery_wizard_observer_add(), ast_sorcery_wizard_unregister(), ast_sounds_get_index_for_file(), ast_speech_destroy(), ast_speech_new(), ast_str_container_add(), ast_stream_create_resolved(), ast_stream_topology_alloc(), ast_stream_topology_create_from_format_cap(), ast_system_publish_registry(), ast_taskprocessor_get(), ast_taskprocessor_listener_get_tps(), ast_taskprocessor_unreference(), ast_tcptls_client_start(), ast_tcptls_server_root(), AST_TEST_DEFINE(), ast_threadpool_create(), ast_threadpool_serializer_group(), ast_tone_zone_ref(), ast_tone_zone_sound_ref(), ast_tone_zone_sound_unref(), ast_tone_zone_unref(), ast_tps_init(), ast_translate_available_formats(), ast_translator_best_choice(), ast_unreal_alloc_stream_topology(), ast_unreal_answer(), ast_unreal_channel_push_to_bridge(), ast_unreal_digit_begin(), ast_unreal_digit_end(), ast_unreal_hangup(), ast_unreal_indicate(), ast_unreal_new_channels(), ast_unreal_sendhtml(), ast_unreal_sendtext(), ast_unreal_setoption(), ast_unreal_write_stream(), ast_websocket_client_create(), ast_websocket_ref(), ast_websocket_server_add_protocol(), ast_websocket_server_add_protocol2(), ast_websocket_server_remove_protocol(), ast_websocket_sub_protocol_alloc(), ast_websocket_uri_cb(), ast_xml_doc_item_alloc(), ast_xml_doc_item_destructor(), ast_xmpp_client_config_alloc(), ast_xmpp_client_find(), ast_xmpp_client_unref(), asterisk_publication_devicestate_refresh(), asterisk_publication_mwi_refresh(), asterisk_publication_send_refresh(), asterisk_start_devicestate_publishing(), asterisk_start_mwi_publishing(), asterisk_stop_devicestate_publishing(), asterisk_stop_mwi_publishing(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), attach_framehook(), attended_transfer_bridge(), attended_transfer_properties_alloc(), audiosocket_exec(), audiosocket_request(), auth_observer(), authenticate(), bridge_action_bridge(), bridge_agent_hold_push(), bridge_app_subscribed(), bridge_app_subscribed_involved(), bridge_base_init(), bridge_basic_change_personality(), bridge_basic_personality_alloc(), bridge_builtin_set_limits(), bridge_channel_attended_transfer(), bridge_channel_change_bridge(), bridge_channel_destroy(), bridge_channel_event_join_leave(), bridge_channel_feature_digit_timeout(), bridge_channel_handle_interval(), bridge_channel_ind_thread(), bridge_channel_internal_alloc(), bridge_channel_moving(), bridge_channel_talking(), bridge_do_move(), bridge_impart_internal(), bridge_manager_create(), bridge_manager_destroy(), bridge_manager_service_req(), bridge_manager_thread(), bridge_merge_message_create(), bridge_moh_create(), bridge_other_hook(), bridge_profile_alloc(), bridge_profile_sounds_alloc(), bridge_publish_state_from_blob(), bridge_show_specific_print_channel(), bridge_stasis_moving(), bridge_stasis_push_peek(), bridge_stasis_queue_join_action(), bridge_template_handler(), bridge_topics_destroy(), bridges_scrape_cb(), bucket_alloc(), bucket_file_alloc(), bucket_file_cleanup(), bucket_file_set_expiration(), bucket_file_update_path(), bucket_http_wizard_is_stale(), bucket_http_wizard_retrieve_id(), build_callno_limits(), build_conf(), build_entity_id(), build_mansession(), caching_topic_exec(), caldav_destructor(), calendar_destructor(), calendar_devstate_change(), calendar_event_notify(), calendar_query_exec(), call(), call_pickup_incoming_request(), callattempt_free(), caller_joined_bridge(), calltoken_required(), can_ring_entry(), cancel_and_unpublish(), cancel_publish_refresh(), cancel_refresh_timer_task(), cancel_registration(), cb_events(), cc_esc_publish_handler(), cc_handle_publish_error(), cc_publish(), cdr_all_unlink(), cdr_write(), cel_config_alloc(), cel_linkedid_ref(), celt_set(), chan_cleanup(), chan_list_destructor(), chan_pjsip_answer(), chan_pjsip_call(), chan_pjsip_devicestate(), chan_pjsip_get_rtp_peer(), chan_pjsip_get_vrtp_peer(), chan_pjsip_indicate(), chan_pjsip_new(), chan_pjsip_read_stream(), chan_pjsip_sendtext_data(), chan_pjsip_set_rtp_peer(), channel_admin_exec(), channel_do_masquerade(), channel_get_external_vars(), channel_snapshot_base_create(), channel_snapshot_caller_create(), channel_snapshot_dialplan_create(), channel_snapshot_update_create(), channel_state_invalid(), channels_scrape_cb(), channels_shutdown(), check_cache_content(), check_delayed_requests(), check_expiration_thread(), check_manager_session_inuse(), check_peer_ok(), check_request_status(), check_retire_linkedid(), check_state(), cleanup_capabilities(), clear_history_entry_cb(), clear_queue(), cli_alias_passthrough(), cli_aor_get_container(), cli_aor_print_body(), cli_aor_print_header(), cli_complete_endpoint(), cli_complete_registration(), cli_complete_show(), cli_complete_uri(), cli_contact_get_container(), cli_contact_retrieve_by_id(), cli_display_named_acl_list(), cli_endpoint_get_container(), cli_fax_show_session(), cli_fax_show_sessions(), cli_get_container(), cli_qualify(), cli_register(), cli_reload_qualify_aor(), cli_reload_qualify_endpoint(), cli_retrieve_by_id(), cli_show_modules(), cli_show_qualify_aor(), cli_show_qualify_endpoint(), cli_show_tasks(), cli_unid_get_container(), cli_unregister(), client_buddy_handler(), common_identify(), compare_weight(), compatible_formats_exist(), complete_agent(), complete_agent_logoff(), complete_bridge_participant(), complete_bridge_profile_name(), complete_confbridge_name(), complete_config_module(), complete_config_option(), complete_config_type(), complete_core_show_hint(), complete_menu_name(), complete_parking_lot(), complete_queue_remove_member(), complete_trans_path_choice(), complete_user_profile_name(), complete_userno(), conf_alloc(), conf_announce_channel_push(), conf_bridge_profile_copy(), conf_bridge_profile_destroy(), conf_find_bridge_profile(), conf_find_user_profile(), conf_free(), conf_queue_dtmf(), conf_run(), conf_send_event_to_participants(), conf_start_record(), confbridge_cfg_alloc(), confbridge_unlock_and_unref(), config_hook_exec(), configure_local_rtp(), configure_parking_extensions(), confkick_exec(), console_new(), consulting_exit(), consumer_exec(), consumer_exec_sync(), contact_observer_updated(), contact_remove_unreachable(), contact_status_publish_update_task(), context_table_create_autohints(), control_create(), control_dispatch_all(), control_flush_queue(), control_list_create(), copy_socket_data(), cpg_confchg_cb(), create_addr(), create_artificial_auth(), create_channel_blob_message(), create_cts(), create_dsn(), create_dynamic_lot_full(), create_esc_entry(), create_foo_type_message(), create_mwi_subscriptions(), create_object(), create_outgoing_sdp_stream(), create_parked_subscription_full(), create_rtp(), create_subscription_tree(), create_trunk_ref(), create_unsolicited_mwi_subscriptions(), current_state_reusable(), dahdi_new(), db_start_batch(), defer_termination_cancel_task(), destroy(), destroy_callback(), destroy_endpoint(), destroy_gateway(), destroy_mailbox_mapping(), destroy_queue(), destroy_session(), destroy_v21_sessions(), device_state_cb(), device_state_notify_callbacks(), device_state_subscription_create(), dial_masquerade_caller_datastore_destroy(), dial_masquerade_datastore_destroy(), dial_state_process_bridge_enter(), dialgroup_read(), dialgroup_write(), dialog_info_generate_body_content(), dialplan_handle_msg_cb(), dictate_exec(), digest_check_auth(), disable_marked_lots(), dns_query_alloc(), dns_query_recurring_resolution_callback(), dns_query_recurring_scheduled_callback(), dns_query_set_callback(), dns_query_set_destroy(), dns_system_resolver_process_query(), dns_system_resolver_resolve(), do_notify(), dump_queue_members(), dup_weakproxy_cb(), end_bridge_callback(), end_bridge_callback_data_fixup(), endpoint_internal_create(), endpoint_lookup(), endpoint_snapshot_dtor(), endpoints_scrape_cb(), endpt_send_request(), endpt_send_request_cb(), event_notification_duplicate(), eventlist_destroy(), eventlist_destructor(), eventlist_duplicate(), ewscal_destructor(), exchangecal_destructor(), exec_command_on_condition(), expire_objects_from_cache(), expire_register(), explicit_publish_cb(), explicit_publish_destroy(), exten_state_pub_data_destroy(), exten_state_publisher_state_cb(), extension_state_add_destroy(), extension_state_cb(), extensionstate_update(), fake_ami(), fax_detect_attach(), fax_detect_framehook(), fax_detect_framehook_destroy(), fax_detect_new(), fax_gateway_attach(), fax_gateway_detect_t38(), fax_gateway_detect_v21(), fax_gateway_framehook(), fax_gateway_framehook_destroy(), fax_gateway_new(), fax_gateway_request_t38(), fax_gateway_start(), fax_session_new(), fax_session_reserve(), fax_session_tab_complete(), fax_v21_session_new(), feature_attended_transfer(), find_aor_for_resource(), find_bridge(), find_channel_control(), find_control(), find_details(), find_endpoint(), find_hint_by_cb_id(), find_or_create_details(), find_or_create_temporary_state(), find_queue_by_name_rt(), find_ringing_channel(), find_session(), find_session_by_nonce(), find_state_by_transport(), find_temporary_state(), find_user(), format_ami_aor_handler(), format_ami_endpoint_identify(), format_cap_destroy(), format_cap_framed_init(), forwards_create_bridge(), forwards_create_channel(), forwards_create_endpoint(), free_members(), func_channel_read(), func_confbridge_info(), function_amiclient(), function_sippeer(), gather_contacts_for_aor(), generate_or_link_lots_to_configs(), generate_parked_user(), generic_fax_exec(), generic_lock_unlock_helper(), generic_recall(), get_chan_by_ast_name(), get_codecs(), get_container(), get_destination(), get_device_state_causing_channels(), get_dialstatus(), get_dsn(), get_feature_ds(), get_languages(), get_log_level(), get_member_penalty(), get_member_status(), get_message_count(), get_name_from_resource(), get_or_create_subscription(), get_root_handler(), get_state(), get_system_cfg(), get_udp_transport(), global_config_alloc(), global_loaded_observer(), grab_transfer(), group_destroy(), grow(), handle_aor(), handle_auth(), handle_bridge_kick_channel(), handle_bridge_pairings(), handle_bridge_show_all(), handle_bridge_show_specific(), handle_capabilities_res_message(), handle_cc_notify(), handle_cc_subscribe(), handle_chanlist(), handle_channelstatus(), handle_cli_confbridge_kick(), handle_cli_confbridge_list(), handle_cli_confbridge_show_bridge_profiles(), handle_cli_confbridge_show_menus(), handle_cli_confbridge_show_user_profiles(), handle_cli_confbridge_start_record(), handle_cli_confbridge_stop_record(), handle_cli_iax2_set_debug(), handle_cli_iax2_show_callno_limits(), handle_cli_moh_show_files(), handle_cli_odbc_show(), handle_cli_sound_show(), handle_cli_sounds_show(), handle_cli_status(), handle_client_state_destruction(), handle_endpoint(), handle_export_primitives(), handle_identify(), handle_incoming_request(), handle_invite_replaces(), handle_manager_show_event(), handle_manager_show_events(), handle_msg_cb(), handle_mwi_state(), handle_new_invite_request(), handle_open_receive_channel_ack_message(), handle_outgoing_response(), handle_phoneprov(), handle_pjproject_show_log_mappings(), handle_queue_remove_member(), handle_registration_response(), handle_registrations(), handle_request_bye(), handle_request_subscribe(), handle_response_subscribe(), handle_scan_file(), handle_show_hint(), handle_show_hints(), handle_show_named_acl_cmd(), handle_show_translation_path(), handle_show_translation_table(), handle_showmanconn(), handle_sip_publish_initial(), handle_sip_publish_modify(), handle_sip_publish_refresh(), handle_sip_publish_remove(), handle_skel_show_games(), handle_skel_show_levels(), handle_speechcreate(), handle_stasis_state_proxy(), handle_tcptls_connection(), handle_voicemail_show_aliases(), hangupcause_read(), has_destination_cb(), has_mwi_subscription(), hash_ao2_find_first(), hash_ao2_find_next(), hash_ao2_insert_node(), hash_test_grow(), hash_test_lookup(), hash_test_shrink(), hepv3_config_post_apply(), hepv3_create_capture_info(), hepv3_data_alloc(), hepv3_send_packet(), hintdevice_destroy(), history_on_rx_msg(), history_on_tx_msg(), hold(), hooks_remove_heap(), http_callback(), httpd_helper_thread(), iax2_codec_choose(), iax2_codec_pref_string(), iax2_destroy(), iax2_format_compatibility_cap2bitfield(), iax2_getformatname_multiple(), iax2_parse_allow_disallow(), iax2_request(), iax_template_parse(), icalendar_destructor(), ice_candidates_compare(), ice_create(), idle_monitor_on_rx_request(), idle_sched_cb(), idle_sched_cleanup(), implicit_publish_cb(), indicate(), indicate_data_alloc(), indicate_data_destroy(), info_dtmf_data_alloc(), info_dtmf_data_destroy(), initial_notify_task(), inprocess_count(), interface_exists(), internal_ao2_traverse(), internal_format_cap_identical(), internal_stasis_subscribe(), invite_collision_timeout(), invite_proceeding(), invite_terminated(), ip_identify_apply(), is_subscribed_device_state(), is_unsolicited_allowed(), jingle_action_hook(), jingle_action_session_initiate(), jingle_add_google_candidates_to_transport(), jingle_add_ice_udp_candidates_to_transport(), jingle_add_payloads_to_description(), jingle_alloc(), jingle_config_alloc(), jingle_endpoint_alloc(), jingle_endpoint_destructor(), jingle_endpoint_state_create(), jingle_endpoint_state_destructor(), jingle_endpoint_state_find_or_create(), jingle_get_rtp_peer(), jingle_hangup(), jingle_interpret_content(), jingle_new(), jingle_read(), jingle_request(), join_conference_bridge(), keepalive_transport_thread(), kqueue_timer_close(), kqueue_timer_open(), leave_conference(), link_option_to_types(), link_topic_proxy(), listener_shutdown(), load_aliases(), load_config(), load_endpoint(), load_module(), load_objects(), load_odbc_config(), load_users(), local_call(), local_devicestate(), local_hangup(), local_request_with_stream_topology(), local_shutdown(), locals_show(), logging_on_rx_msg(), logging_on_tx_msg(), manager_add_filter(), manager_bridges_list(), manager_default_msg_cb(), manager_fax_session(), manager_fax_sessions(), manager_optimize_away(), manager_parking_status_all_lots(), manager_parking_status_single_lot(), manager_queues_status(), manager_queues_summary(), manager_remove_queue_member(), mark_lots_as_disabled(), mark_object_as_stale_in_cache(), matrix_rebuild(), measurenoise(), media_cache_handle_show_item(), media_cache_item_populate_from_astdb(), media_hangup(), media_info_alloc(), media_offer_read_av(), media_offer_write_av(), media_variant_alloc(), meetme_menu_admin(), meetme_menu_admin_extended(), meetme_show_cmd(), meetmemute(), memory_cache_populate(), memory_cache_stale_check(), message_received_handler(), message_sink_cb(), messaging_app_subscribe_endpoint(), messaging_app_unsubscribe_endpoint(), messaging_cleanup(), messaging_init(), mgcp_get_rtp_peer(), mgcp_new(), mgcp_rtp_read(), misdn_new(), mock_retrieve_multiple(), module_config_alloc(), module_config_destructor(), module_config_dtor(), moh_channel_thread(), moh_files_release(), moh_parse_options(), moh_rescan_files(), moh_scan_files(), monitored_transport_state_callback(), msg_data_alloc(), msg_data_create(), msg_data_func_read(), msg_data_func_write(), msg_ds_destroy(), msg_func_read(), msg_func_write(), msg_q_cb(), msg_send_exec(), msg_set_var_full(), multicast_rtp_request(), mwi_contact_changed(), mwi_contact_deleted(), mwi_create_state(), mwi_create_subscription(), mwi_ds_destroy(), mwi_get_notify_data(), mwi_handle_subscribe(), mwi_handle_subscribe2(), mwi_handle_unsubscribe(), mwi_handle_unsubscribe2(), mwi_initial_events(), mwi_mailbox_get(), mwi_on_aor(), mwi_stasis_cb(), mwi_stasis_subscription_alloc(), mwi_subscribe_single(), mwi_subscription_alloc(), mwi_subscription_established(), mwi_subscription_mailboxes_str(), mwi_subscription_shutdown(), mwi_to_ami(), mwi_validate_for_aor(), named_acl_config_alloc(), naptr_thread(), native_rtp_bridge_framehook_attach(), native_rtp_framehook(), new_iax(), newpvt(), nominal_thrash(), notify_ami_data_create(), notify_ami_uri_data_create(), notify_cli_data_create(), notify_cli_uri_data_create(), notify_task_data_destructor(), num_available_members(), object_add_to_cache_callback(), odbc_class_destructor(), ooh323_get_rtp_peer(), ooh323_get_vrtp_peer(), ooh323_new(), ooh323_rtp_read(), ooh323_set_read_format(), ooh323_set_write_format(), ooh323c_set_capability(), ooh323c_set_capability_for_call(), opus_set(), orig_app(), orig_exten(), parking_blind_transfer_park(), parking_config_alloc(), parking_lot_build_or_update(), parking_lot_get_bridge(), parking_lot_get_space(), parking_lot_retrieve_parked_user(), parking_park_bridge_channel(), parking_set_duration(), parse_moved_contact(), payload_mapping_rx_clear_primary(), pbx_outgoing_attempt(), pbx_shutdown(), peer_ref(), peer_unref(), peercnt_add(), peercnt_modify(), peercnt_remove_by_addr(), peercnt_remove_cb(), permanent_uri_handler(), persistent_endpoint_find_or_create(), phone_new(), pjsip_acf_channel_read(), pjsip_acf_dial_contacts_read(), pjsip_aor_function_read(), pjsip_channel_cli_register(), pjsip_history_entry_alloc(), play_sound(), playback_create(), prepare_bridge_moh_channel(), presence_state_alloc(), presence_state_notify_callbacks(), print_queue(), process_description_file(), process_sdp(), process_sdp_a_audio(), process_sdp_a_video(), prometheus_show_status(), proxy_from_config(), pthread_timer_close(), pthread_timer_open(), publish_cluster_discovery_to_stasis(), publish_cluster_discovery_to_stasis_full(), publish_expire(), publish_hint_change(), publish_hint_remove(), publish_msg(), publisher_client_send(), publisher_dtor(), publisher_start(), publishers_create(), pubsub_on_evsub_state(), pubsub_on_rx_publish_request(), pubsub_on_rx_refresh(), pubsub_on_rx_subscribe_request(), purge_old_messages(), purge_sessions(), push_notify_channel(), qualify_contact_cb(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuememberlist(), queue_mwi_event(), queue_register(), queue_ringing_trunk(), queue_stasis_data_alloc(), queue_unregister(), qupd_exec(), rb_ao2_find_first(), rb_ao2_find_next(), rb_ao2_insert_node(), realtime_common(), realtime_sqlite3_exec_query(), realtime_sqlite3_exec_update(), realtime_sqlite3_require(), recall_pull(), recalling_enter(), recalling_exit(), recording_alloc(), recording_cleanup(), ref_proxy(), ref_pvt(), refer_attended_alloc(), refer_attended_task(), refer_blind_callback(), refer_progress_alloc(), refer_progress_bridge(), refer_progress_notification_alloc(), register_aor_core(), register_contact_transport_remove_cb(), register_contact_transport_shutdown_cb(), registrar_on_rx_request(), registration_client_send(), registration_deleted_observer(), registration_loaded_observer(), registration_transport_monitor_setup(), registration_transport_shutdown_cb(), release_obj_or_dsn(), reload(), reload_module(), reload_single_member(), reload_single_queue(), remb_enable_collection(), remote_send_hold_refresh(), remove_all_configured_parking_lot_extensions(), remove_all_from_cache(), remove_bridge_playback(), remove_from_cache(), remove_from_playbacks(), remove_from_queue(), remove_oldest_from_cache(), remove_pending_parking_lot_extensions(), request(), request_channel(), reregister_immediately_cb(), reschedule_reinvite(), resend_reinvite(), resolution_thread(), ringing(), rna(), root_handler_create(), rqm_exec(), rt_handle_member_record(), rtcp_debug_test_addr(), rtcp_message_handler(), rtp_add_candidates_to_ice(), rtp_codecs_assign_payload_code_rx(), rtp_codecs_payload_replace_rx(), rtp_codecs_payloads_copy_tx(), rtp_deallocate_transport(), rtp_instance_parse_transport_wide_cc(), rtp_raw_write(), rtp_transport_wide_cc_feedback_produce(), run_externnotify(), save_dialstatus(), sched_delay_remove(), schedule_cache_expiration(), schedule_publish_refresh(), schedule_registration(), schtd_dtor(), send_contact_notify(), send_direct_media_request(), send_initial_notify_all(), send_msg(), send_notify(), send_refresh_cb(), send_request_cb(), send_request_timer_callback(), send_start_msg(), send_start_msg_snapshots(), send_unpublish_task(), sendtext_data_create(), serialized_notify(), serializer_create(), session_destroy(), session_details_new(), session_do(), session_end_if_deferred_task(), session_termination_task(), set_caps(), set_dial_masquerade(), set_fn(), set_incoming_call_offer_cap(), set_interval_hook(), set_member_paused(), set_member_penalty_help_members(), set_member_ringinuse_help_members(), set_peer_defaults(), set_peercnt_limit(), set_socket_transport(), set_test_formats(), setup_bridge_features_dynamic(), setup_stasis_subs(), show_codec(), show_codecs(), show_sound_info_cb(), shutdown_data_create(), single_state_process_bridge_enter(), sip_cc_monitor_suspend(), sip_cli_print_global(), sip_cli_print_system(), sip_contact_status_alloc(), sip_contact_status_copy(), sip_create_publication(), sip_destroy_peer(), sip_get_rtp_peer(), sip_get_trtp_peer(), sip_get_vrtp_peer(), sip_handle_cc(), sip_hangup(), sip_monitor_instance_init(), sip_msg_send(), sip_new(), sip_options_aor_alloc(), sip_options_aor_dtor(), sip_options_aor_observer_deleted_task(), sip_options_aor_observer_modified_task(), sip_options_aor_remove_task(), sip_options_apply_aor_configuration(), sip_options_cleanup_aor_task(), sip_options_cleanup_task(), sip_options_contact_add_management_task(), sip_options_contact_add_task(), sip_options_contact_delete_management_task(), sip_options_contact_delete_task(), sip_options_contact_status_available_count(), sip_options_contact_status_notify_task(), sip_options_contact_status_update(), sip_options_contact_update_task(), sip_options_endpoint_compositor_add_task(), sip_options_endpoint_compositor_remove_task(), sip_options_endpoint_observer_deleted_task(), sip_options_endpoint_observer_modified_task(), sip_options_endpoint_state_compositor_find_or_alloc(), sip_options_endpoint_unlink_aor_feeders(), sip_options_get_endpoint_state_compositor_state(), sip_options_qualify_contact(), sip_options_remove_contact_status(), sip_options_set_contact_status(), sip_options_set_contact_status_qualified(), sip_options_set_contact_status_unqualified(), sip_options_synchronize_aor(), sip_options_synchronize_endpoint(), sip_options_synchronize_task(), sip_options_update_endpoint_state_compositor_aor(), sip_outbound_publish_apply(), sip_outbound_publish_callback(), sip_outbound_publish_client_add_publisher(), sip_outbound_publish_state_alloc(), sip_outbound_publish_synchronize(), sip_outbound_publish_timer_cb(), sip_outbound_publisher_alloc(), sip_outbound_publisher_init(), sip_outbound_registration_apply(), sip_outbound_registration_perform(), sip_outbound_registration_response_cb(), sip_outbound_registration_state_destroy(), sip_outbound_registration_timer_cb(), sip_prepare_socket(), sip_publish_state_get(), sip_publisher_service_queue(), sip_pvt_dtor(), sip_resolve(), sip_resolve_callback(), sip_resolve_invoke_user_callback(), sip_rtp_read(), sip_session_defer_termination_stop_timer(), sip_session_refresh(), sip_session_response_cb(), sip_session_suspend_task(), sip_show_channels(), sip_show_channelstats(), sip_tcp_locate(), skel_config_alloc(), skel_find_or_create_state(), skel_game_alloc(), skel_level_alloc(), skinny_device_destroy(), skinny_get_rtp_peer(), skinny_get_vrtp_peer(), skinny_line_destroy(), skinny_new(), skinny_rtp_read(), skinny_set_rtp_peer(), sla_add_trunk_to_station(), sla_calc_station_delays(), sla_change_trunk_state(), sla_choose_idle_trunk(), sla_choose_ringing_trunk(), sla_create_failed_station(), sla_create_ringing_station(), sla_create_station_ref(), sla_destroy(), sla_event_destroy(), sla_failed_station_destroy(), sla_find_trunk_ref(), sla_find_trunk_ref_byname(), sla_handle_dial_state_event(), sla_queue_event_conf(), sla_queue_event_full(), sla_ringing_station_destroy(), sla_ringing_trunk_destroy(), sla_show_stations(), sla_show_trunks(), sla_station_exec(), sla_station_is_marked(), sla_station_ref_destructor(), sla_station_release_refs(), sla_stop_ringing_trunk(), sla_trunk_is_marked(), sla_trunk_ref_destructor(), sla_trunk_release_refs(), smdi_read(), socket_process_helper(), sorcery_config_close(), sorcery_config_open(), sorcery_is_explicit_name_met(), sorcery_memory_cache_ami_expire(), sorcery_memory_cache_ami_expire_object(), sorcery_memory_cache_ami_populate(), sorcery_memory_cache_ami_stale(), sorcery_memory_cache_ami_stale_object(), sorcery_memory_cache_cli_thrash(), sorcery_memory_cache_close(), sorcery_memory_cache_complete_name(), sorcery_memory_cache_complete_object_name(), sorcery_memory_cache_create(), sorcery_memory_cache_dump(), sorcery_memory_cache_expire(), sorcery_memory_cache_populate(), sorcery_memory_cache_retrieve_fields(), sorcery_memory_cache_retrieve_id(), sorcery_memory_cache_show(), sorcery_memory_cache_stale(), sorcery_memory_cache_thrash_create(), sorcery_memory_cache_thrash_retrieve(), sorcery_memory_cache_thrash_update(), sorcery_memory_cached_object_alloc(), sorcery_memory_close(), sorcery_memory_create(), sorcery_object_type_alloc(), sorcery_observer_invocation_alloc(), spandsp_fax_gw_gen_alloc(), spandsp_fax_gw_gen_release(), srv_thread(), stale_cache_update(), stale_cache_update_task_data_alloc(), stale_item_update(), start_rtp(), stasis_app_bridge_moh_channel(), stasis_app_bridge_moh_stop(), stasis_app_bridge_playback_channel_find(), stasis_app_bridge_playback_channel_remove(), stasis_app_channel_unreal_set_internal(), stasis_app_control_play_uri(), stasis_app_control_record(), stasis_app_control_snoop(), stasis_app_event_allowed(), stasis_app_exec(), stasis_app_get_debug_by_name(), stasis_app_mailboxes_to_json(), stasis_app_recording_options_create(), stasis_app_send(), stasis_app_send_command_async(), stasis_app_stored_recording_find_all(), stasis_app_subscribe_channel(), stasis_app_to_cli(), stasis_app_unregister(), stasis_app_user_event(), stasis_caching_topic_create(), stasis_caching_unsubscribe(), stasis_caching_unsubscribe_and_join(), stasis_config_alloc(), stasis_cp_all_create(), stasis_cp_single_create(), stasis_cp_sink_create(), stasis_forward_all(), stasis_init(), stasis_message_create_full(), stasis_message_router_create_internal(), stasis_message_sink_create(), stasis_message_type_declined(), stasis_show_topic(), stasis_show_topics(), stasis_state_add_publisher(), stasis_state_add_subscriber(), stasis_state_manager_create(), stasis_state_publish_by_id(), stasis_state_remove_publish_by_id(), stasis_state_subscribe_pool(), stasis_state_topic(), stasis_state_unsubscribe(), stasis_state_unsubscribe_and_join(), stasis_subscription_statistics_create(), stasis_topic_create_with_detail(), stasis_topic_pool_create(), stasis_topic_pool_topic_exists(), stasis_topic_statistics_create(), stasis_unsubscribe_and_join(), state_alloc(), state_find_and_remove_eid(), state_find_or_add_eid(), statistics_show_subscription(), statistics_show_subscriptions(), statistics_show_topic(), statistics_show_topics(), stir_shaken_certificate_alloc(), stir_shaken_certificate_show_all(), stir_shaken_general_alloc(), stir_shaken_general_get(), stir_shaken_general_loaded(), stir_shaken_general_unload(), stir_shaken_store_alloc(), stir_shaken_tab_complete_name(), sub_persistence_recreate(), sub_tree_subscription_terminate_cb(), sub_tree_transport_cb(), subscribe_device_state(), subscriber_dtor(), subscription_change_alloc(), subscription_dtor(), subscription_established(), subscription_persistence_load(), subscription_persistence_remove(), subscription_statistics_complete_name(), subscriptions_create(), system_create_resolver_and_set_nameservers(), t38_automatic_reject_timer_cb(), t38_change_state(), t38_create_media_state(), t38_framehook(), t38_parameters_task_data_alloc(), talk_detect_audiohook_cb(), test_ao2_callback_traversal(), test_ao2_iteration(), test_cb(), test_core_format_parse_sdp_fmtp(), test_expected_duplicates(), test_init_cb(), test_item_alloc(), test_iterator_next(), test_media_add(), test_performance(), test_ref(), test_unref(), thread_worker_pair_alloc(), thread_worker_pair_free(), threadpool_alloc(), timerfd_timer_close(), timerfd_timer_open(), topic_complete_name(), topic_dtor(), topic_statistics_complete_name(), tps_report_taskprocessor_list(), transfer(), transfer_data_alloc(), transfer_pull(), transfer_refer(), transmit_audio(), transmit_connect(), transmit_connect_with_sdp(), transmit_modify_request(), transmit_modify_with_sdp(), transmit_publish(), transport_create(), transport_shutdown(), transport_state_callback(), transport_state_do_reg_callbacks(), try_calling(), try_suggested_sip_codec(), udptl_snapshot_alloc(), unbound_config_alloc(), unbound_config_apply_default(), unbound_config_preapply(), unbound_config_state_destructor(), unbound_resolver_alloc(), unbound_resolver_callback(), unbound_resolver_cancel(), unbound_resolver_resolve(), unbound_resolver_start(), unbound_resolver_thread(), unhold(), unicast_rtp_request(), unistim_get_rtp_peer(), unistim_line_destroy(), unistim_new(), unistim_rtp_read(), unload_module(), unref_caldav(), unref_calendar(), unref_db(), unref_ewscal(), unref_exchangecal(), unref_icalendar(), unref_instance_cond(), unref_mansession(), unref_pvt(), unregister_all(), unregister_task(), unsubscribe(), update_connected_line_information(), update_create(), update_file_format_info(), update_queue(), update_realtime_members(), uri_parse_and_default(), user_alloc(), user_unref(), ustmtext(), wait_wrapper_removal(), websocket_client_args_create(), websocket_client_connect(), websocket_client_create(), websocket_client_parse_uri(), websocket_server_create_impl(), ws_destroy(), xfer_client_on_evsub_state(), xml_translate(), xmpp_buddy_destructor(), xmpp_client_alloc(), xmpp_client_config_merge_buddies(), xmpp_client_create_buddy(), xmpp_client_find_or_create(), xmpp_client_service_discovery_result_hook(), xmpp_component_register_get_hook(), xmpp_config_alloc(), xmpp_pak_presence(), xmpp_pak_s10n(), xmpp_pubsub_create_affiliations(), xmpp_roster_hook(), xmpp_show_buddies(), and xmpp_show_clients().

◆ ao2_replace

#define ao2_replace (   dst,
  src 
)    ao2_t_replace((dst), (src), NULL)

◆ AO2_STRING_FIELD_CASE_CMP_FN

#define AO2_STRING_FIELD_CASE_CMP_FN (   stype,
  field 
)    AO2_FIELD_CMP_FN(stype, _cmp_fn, field, strcasecmp, strncasecmp, AO2_FIELD_TRANSFORM_CMP_FN,)

Definition at line 2073 of file astobj2.h.

◆ AO2_STRING_FIELD_CASE_HASH_FN

#define AO2_STRING_FIELD_CASE_HASH_FN (   stype,
  field 
)    AO2_FIELD_HASH_FN(stype, field, ast_str_case_hash)

Definition at line 2057 of file astobj2.h.

◆ AO2_STRING_FIELD_CASE_SORT_FN

#define AO2_STRING_FIELD_CASE_SORT_FN (   stype,
  field 
)    AO2_FIELD_CMP_FN(stype, _sort_fn, field, strcasecmp, strncasecmp, AO2_FIELD_TRANSFORM_SORT_FN, const)

Definition at line 2089 of file astobj2.h.

◆ AO2_STRING_FIELD_CMP_FN

#define AO2_STRING_FIELD_CMP_FN (   stype,
  field 
)    AO2_FIELD_CMP_FN(stype, _cmp_fn, field, strcmp, strncmp, AO2_FIELD_TRANSFORM_CMP_FN,)

Creates a compare function for a structure string field.

Parameters
stypeThe structure type
fieldThe string field in the structure to compare

AO2_STRING_FIELD_CMP_FN(mystruct, myfield) will produce a function named mystruct_cmp_fn which compares mystruct->myfield.

AO2_STRING_FIELD_CASE_CMP_FN(mystruct, myfield) would do the same except it performs case insensitive comparisons.

Definition at line 2071 of file astobj2.h.

Referenced by ast_bucket_file_temporary_destroy(), ast_bucket_json(), create_routes(), get_name_from_resource(), sorcery_cleanup(), sorcery_destructor(), and sorcery_field_default_handler().

◆ AO2_STRING_FIELD_HASH_FN

#define AO2_STRING_FIELD_HASH_FN (   stype,
  field 
)    AO2_FIELD_HASH_FN(stype, field, ast_str_hash)

Creates a hash function for a structure string field.

Parameters
stypeThe structure type
fieldThe string field in the structure to hash

AO2_STRING_FIELD_HASH_FN(mystruct, myfield) will produce a function named mystruct_hash_fn which hashes mystruct->myfield.

AO2_STRING_FIELD_HASH_FN(mystruct, myfield) would do the same except it uses the hash function which ignores case.

Definition at line 2055 of file astobj2.h.

Referenced by ast_bucket_file_temporary_destroy(), ast_bucket_json(), create_routes(), sorcery_cleanup(), sorcery_destructor(), and sorcery_field_default_handler().

◆ AO2_STRING_FIELD_SORT_FN

#define AO2_STRING_FIELD_SORT_FN (   stype,
  field 
)    AO2_FIELD_CMP_FN(stype, _sort_fn, field, strcmp, strncmp, AO2_FIELD_TRANSFORM_SORT_FN, const)

Creates a sort function for a structure string field.

Parameters
stypeThe structure type
fieldThe string field in the structure to compare

AO2_STRING_FIELD_SORT_FN(mystruct, myfield) will produce a function named mystruct_sort_fn which compares mystruct->myfield.

AO2_STRING_FIELD_CASE_SORT_FN(mystruct, myfield) would do the same except it performs case insensitive comparisons.

Definition at line 2087 of file astobj2.h.

◆ ao2_t_alloc

#define ao2_t_alloc (   data_size,
  destructor_fn,
  debug_msg 
)    __ao2_alloc((data_size), (destructor_fn), AO2_ALLOC_OPT_LOCK_MUTEX, (debug_msg), __FILE__, __LINE__, __PRETTY_FUNCTION__)

◆ ao2_t_alloc_options

#define ao2_t_alloc_options (   data_size,
  destructor_fn,
  options,
  debug_msg 
)    __ao2_alloc((data_size), (destructor_fn), (options), (debug_msg), __FILE__, __LINE__, __PRETTY_FUNCTION__)

Allocate and initialize an object.

Parameters
data_sizeThe sizeof() of the user-defined structure.
destructor_fnThe destructor function (can be NULL)
optionsThe ao2 object options (See enum ao2_alloc_opts)
debug_msgAn ao2 object debug tracing message.
Returns
A pointer to user-data.

Allocates a struct astobj2 with sufficient space for the user-defined structure.

Note
  • storage is zeroed; XXX maybe we want a flag to enable/disable this.
  • the refcount of the object just created is 1
  • the returned pointer cannot be free()'d or realloc()'ed; rather, we just call ao2_ref(o, -1);

Definition at line 404 of file astobj2.h.

Referenced by __ast_codec_register_with_format(), ao2_container_register(), ast_format_create_named(), ast_module_register(), stasis_message_create_full(), stasis_message_type_create(), and transport_create().

◆ ao2_t_bump

#define ao2_t_bump (   obj,
  tag 
)

Bump refcount on an AO2 object by one, returning the object.

Since
12 This is useful for inlining a ref bump, and you don't care about the ref count. Also NULL safe, for even more convenience.
Parameters
objAO2 object to bump the refcount on.
Return values
Thegiven obj pointer.

Definition at line 483 of file astobj2.h.

Referenced by __sip_subscribe_mwi_do(), bridge_impart_internal(), internal_ao2_alloc(), and transmit_register().

◆ ao2_t_callback

#define ao2_t_callback (   c,
  flags,
  cb_fn,
  arg,
  tag 
)    __ao2_callback((c), (flags), (cb_fn), (arg), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

ao2_callback() is a generic function that applies cb_fn() to all objects in a container, as described below.

Parameters
cA pointer to the container to operate on.
flagsA set of flags specifying the operation to perform, partially used by the container code, but also passed to the callback.
  • If OBJ_NODATA is set, ao2_callback will return NULL. No refcounts of any of the traversed objects will be incremented. On the converse, if it is NOT set (the default), the ref count of the first matching object will be incremented and returned.
  • If OBJ_MULTIPLE is set, the ref count of all matching objects will be incremented in an iterator for a temporary container and returned.
  • If OBJ_SEARCH_OBJECT is set, the traversed items will be restricted to the objects in the bucket that the object key hashes to.
  • If OBJ_SEARCH_KEY is set, the traversed items will be restricted to the objects in the bucket that the object key hashes to.
cb_fnA function pointer, that will be called on all objects, to see if they match. This function returns CMP_MATCH if the object is matches the criteria; CMP_STOP if the traversal should immediately stop, or both (via bitwise ORing), if you find a match and want to end the traversal, and 0 if the object is not a match, but the traversal should continue. This is the function that is applied to each object traversed. Its arguments are: (void *obj, void *arg, int flags), where: obj is an object arg is the same as arg passed into ao2_callback flags is the same as flags passed into ao2_callback (flags are also used by ao2_callback).
argpassed to the callback.
tagused for debugging.
Return values
NULLon failure or no matching object found.
objectfound if OBJ_MULTIPLE is not set in the flags parameter.
ao2_iteratorpointer if OBJ_MULTIPLE is set in the flags parameter. The iterator must be destroyed with ao2_iterator_destroy() when the caller no longer needs it.

If the function returns any objects, their refcount is incremented, and the caller is in charge of decrementing them once done.

Typically, ao2_callback() is used for two purposes:

  • to perform some action (including removal from the container) on one or more objects; in this case, cb_fn() can modify the object itself, and to perform deletion should set CMP_MATCH on the matching objects, and have OBJ_UNLINK set in flags.
  • to look for a specific object in a container; in this case, cb_fn() should not modify the object, but just return a combination of CMP_MATCH and CMP_STOP on the desired object. Other usages are also possible, of course.

This function searches through a container and performs operations on objects according on flags passed. XXX describe better The comparison is done calling the compare function set implicitly. The arg pointer can be a pointer to an object or to a key, we can say this looking at flags value. If arg points to an object we will search for the object pointed by this value, otherwise we search for a key value. If the key is not unique we only find the first matching value.

The use of flags argument is the follow:

 OBJ_UNLINK              unlinks the object found
 OBJ_NODATA              on match, do not return an object
                         Callbacks use OBJ_NODATA as a default
                         functions such as find() do
 OBJ_MULTIPLE            return multiple matches
                         Default is no.
 OBJ_SEARCH_OBJECT       the pointer is to an object
 OBJ_SEARCH_KEY          the pointer is to a search key
 OBJ_SEARCH_PARTIAL_KEY  the pointer is to a partial search key
Note
When the returned object is no longer in use, ao2_ref() should be used to free the additional reference possibly created by this function.

Definition at line 1714 of file astobj2.h.

Referenced by __init_manager(), ao2_weakproxy_unsubscribe(), ast_cc_agent_callback(), ast_cc_monitor_count(), ast_moh_destroy(), ast_srtp_destroy(), astobj2_test_1_helper(), cc_cli_output_status(), cleanup_all_regs(), container_destruct(), device_state_cb(), do_monitor(), get_mohbydigit(), handle_cc_kill(), load_moh_classes(), presence_state_cb(), reload_config(), sip_show_objects(), test_container_clone(), unlink_peers_from_tables(), and unload_module().

◆ ao2_t_callback_data

#define ao2_t_callback_data (   container,
  flags,
  cb_fn,
  arg,
  data,
  tag 
)    __ao2_callback_data((container), (flags), (cb_fn), (arg), (data), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

ao2_callback_data() is a generic function that applies cb_fn() to all objects in a container. It is functionally identical to ao2_callback() except that instead of taking an ao2_callback_fn *, it takes an ao2_callback_data_fn *, and allows the caller to pass in arbitrary data.

This call would be used instead of ao2_callback() when the caller needs to pass OBJ_SEARCH_OBJECT, OBJ_SEARCH_KEY, or OBJ_SEARCH_PARTIAL_KEY as part of the flags argument (which in turn requires passing in a known pointer type for 'arg') and also needs access to other non-global data to complete it's comparison or task.

See the documentation for ao2_callback() for argument descriptions.

See also
ao2_callback()

Definition at line 1741 of file astobj2.h.

Referenced by cccancel_exec(), ccreq_exec(), ccss_device_state(), count_agents(), kill_duplicate_offers(), match_filter(), remove_hintdevice(), and sip_find_peer_full().

◆ ao2_t_cleanup

#define ao2_t_cleanup (   obj,
  tag 
)    __ao2_cleanup_debug((obj), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

◆ ao2_t_container_alloc_hash

#define ao2_t_container_alloc_hash (   ao2_options,
  container_options,
  n_buckets,
  hash_fn,
  sort_fn,
  cmp_fn,
  tag 
)    __ao2_container_alloc_hash((ao2_options), (container_options), (n_buckets), (hash_fn), (sort_fn), (cmp_fn), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

Allocate and initialize a hash container with the desired number of buckets.

We allocate space for a struct astobj_container, struct container and the buckets[] array.

Parameters
ao2_optionsContainer ao2 object options (See enum ao2_alloc_opts)
container_optionsContainer behaviour options (See enum ao2_container_opts)
n_bucketsNumber of buckets for hash
hash_fnPointer to a function computing a hash value. (NULL if everyting goes in first bucket.)
sort_fnPointer to a sort function. (NULL to not sort the buckets.)
cmp_fnPointer to a compare function used by ao2_find. (NULL to match everything)
tagused for debugging.
Returns
A pointer to a struct container.
Note
Destructor is set implicitly.

Definition at line 1308 of file astobj2.h.

Referenced by astobj2_test_1_helper(), load_module(), messaging_init(), res_srtp_new(), and test_make_sorted().

◆ ao2_t_container_alloc_list

#define ao2_t_container_alloc_list (   ao2_options,
  container_options,
  sort_fn,
  cmp_fn,
  tag 
)    __ao2_container_alloc_list((ao2_options), (container_options), (sort_fn), (cmp_fn), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

Allocate and initialize a list container.

Parameters
ao2_optionsContainer ao2 object options (See enum ao2_alloc_opts)
container_optionsContainer behaviour options (See enum ao2_container_opts)
sort_fnPointer to a sort function. (NULL if list not sorted.)
cmp_fnPointer to a compare function used by ao2_find. (NULL to match everything)
tagused for debugging.
Returns
A pointer to a struct container.
Note
Destructor is set implicitly.
Implemented as a degenerate hash table.

Definition at line 1333 of file astobj2.h.

Referenced by ao2_weakproxy_unsubscribe(), astobj2_test_1_helper(), container_init(), internal_ao2_traverse(), load_module(), and test_make_sorted().

◆ ao2_t_container_alloc_rbtree

#define ao2_t_container_alloc_rbtree (   ao2_options,
  container_options,
  sort_fn,
  cmp_fn,
  tag 
)    __ao2_container_alloc_rbtree((ao2_options), (container_options), (sort_fn), (cmp_fn), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

Allocate and initialize a red-black tree container.

Parameters
ao2_optionsContainer ao2 object options (See enum ao2_alloc_opts)
container_optionsContainer behaviour options (See enum ao2_container_opts)
sort_fnPointer to a sort function.
cmp_fnPointer to a compare function used by ao2_find. (NULL to match everything)
tagused for debugging.
Returns
A pointer to a struct container.
Note
Destructor is set implicitly.

Definition at line 1356 of file astobj2.h.

Referenced by astobj2_test_1_helper(), and test_make_sorted().

◆ ao2_t_container_clone

#define ao2_t_container_clone (   orig,
  flags,
  tag 
)    __ao2_container_clone(orig, flags, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 1428 of file astobj2.h.

◆ ao2_t_find

#define ao2_t_find (   container,
  arg,
  flags,
  tag 
)    __ao2_find((container), (arg), (flags), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

◆ ao2_t_get_weakproxy

#define ao2_t_get_weakproxy (   obj,
  tag 
)    __ao2_get_weakproxy(obj, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 695 of file astobj2.h.

Referenced by AST_TEST_DEFINE().

◆ ao2_t_global_obj_ref

#define ao2_t_global_obj_ref (   holder,
  tag 
)    __ao2_global_obj_ref(&holder, (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)

Get a reference to the object stored in the global holder.

Since
11.0
Parameters
holderGlobal ao2 object holder.
tagused for debugging
Return values
Referenceto current ao2 object stored in the holder.
NULLif no object available.

Definition at line 923 of file astobj2.h.

Referenced by AST_TEST_DEFINE(), check_peer_ok(), and register_verify().

◆ ao2_t_global_obj_release

#define ao2_t_global_obj_release (   holder,
  tag 
)    __ao2_global_obj_replace_unref(&holder, NULL, (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)

Release the ao2 object held in the global holder.

Since
11.0
Parameters
holderGlobal ao2 object holder.
tagused for debugging
Returns
Nothing

Definition at line 863 of file astobj2.h.

Referenced by ast_sip_destroy_sorcery_global(), AST_TEST_DEFINE(), manager_shutdown(), and unload_module().

◆ ao2_t_global_obj_replace

#define ao2_t_global_obj_replace (   holder,
  obj,
  tag 
)    __ao2_global_obj_replace(&holder, (obj), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)

Replace an ao2 object in the global holder.

Since
11.0
Parameters
holderGlobal ao2 object holder.
objObject to put into the holder. Can be NULL.
tagused for debugging
Note
This function automatically increases the reference count to account for the reference that the global holder now holds to the object.
Return values
Referenceto previous global ao2 object stored.
NULLif no object available.

Definition at line 883 of file astobj2.h.

Referenced by AST_TEST_DEFINE().

◆ ao2_t_global_obj_replace_unref

#define ao2_t_global_obj_replace_unref (   holder,
  obj,
  tag 
)    __ao2_global_obj_replace_unref(&holder, (obj), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder)

Replace an ao2 object in the global holder, throwing away any old object.

Since
11.0
Parameters
holderGlobal ao2 object holder.
objObject to put into the holder. Can be NULL.
tagused for debugging
Note
This function automatically increases the reference count to account for the reference that the global holder now holds to the object. It also decreases the reference count of any object being replaced.
Return values
0The global object was previously empty
1The global object was not previously empty

Definition at line 906 of file astobj2.h.

Referenced by __init_manager(), AST_TEST_DEFINE(), global_apply(), load_module(), and sip_reload().

◆ ao2_t_iterator_next

#define ao2_t_iterator_next (   iter,
  tag 
)    __ao2_iterator_next((iter), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

◆ ao2_t_link

#define ao2_t_link (   container,
  obj,
  tag 
)    __ao2_link((container), (obj), 0, (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

Add an object to a container.

Parameters
containerThe container to operate on.
objThe object to be added.
tagused for debugging.
Return values
0on errors.
1on success.

This function inserts an object in a container according its key.

Note
Remember to set the key before calling this function.
This function automatically increases the reference count to account for the reference that the container now holds to the object.

Definition at line 1547 of file astobj2.h.

Referenced by __sip_alloc(), _moh_register(), add_hintdevice(), add_sdp(), ao2_container_register(), ast_srtp_add_stream(), ast_srtp_create(), astobj2_test_1_helper(), authenticate(), cc_core_init_instance(), change_callid_pvt(), create_new_generic_list(), manager_add_filter(), parse_register_contact(), pvt_set_needdestroy(), realtime_peer(), register_verify(), reload_config(), sip_prune_realtime(), sip_register(), sip_subscribe_mwi(), and sip_threadinfo_create().

◆ ao2_t_link_flags

#define ao2_t_link_flags (   container,
  obj,
  flags,
  tag 
)    __ao2_link((container), (obj), (flags), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

Add an object to a container.

Parameters
containerThe container to operate on.
objThe object to be added.
flagssearch_flags to control linking the object. (OBJ_NOLOCK)
tagused for debugging.
Return values
0on errors.
1on success.

This function inserts an object in a container according its key.

Note
Remember to set the key before calling this function.
This function automatically increases the reference count to account for the reference that the container now holds to the object.

Definition at line 1570 of file astobj2.h.

◆ ao2_t_ref

#define ao2_t_ref (   o,
  delta,
  tag 
)    __ao2_ref((o), (delta), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

Reference/unreference an object and return the old refcount.

Parameters
oA pointer to the object
deltaValue to add to the reference counter.
tagused for debugging
Returns
The value of the reference counter before the operation.

Increase/decrease the reference counter according the value of delta.

If the refcount goes to zero, the object is destroyed.

Note
The object must not be locked by the caller of this function, as it is invalid to try to unlock it after releasing the reference.
if we know the pointer to an object, it is because we have a reference count to it, so the only case when the object can go away is when we release our reference, and it is the last one in existence.

Definition at line 463 of file astobj2.h.

Referenced by __ao2_ref(), __ast_named_lock_get(), __cleanup_registration(), __init_manager(), __shutdown_mwi_subscription(), __sip_ack(), __sip_alloc(), __sip_reliable_xmit(), __sip_subscribe_mwi_do(), __start_mwi_subscription(), __start_register_timeout(), __start_reregister_timeout(), __stop_register_timeout(), __stop_retrans_pkt(), _sip_show_peer(), _sip_tcp_helper_thread(), action_find(), add_hintdevice(), agent_connect_caller(), ao2_container_check(), ao2_container_dup(), ao2_container_dup_weakproxy_objs(), ao2_container_register(), ao2_container_unregister(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_weakproxy_unsubscribe(), ast_channel_internal_cleanup(), ast_hook_send_action(), ast_iostream_close(), ast_manager_register2(), ast_manager_register_struct(), ast_manager_unregister(), ast_srtp_add_stream(), ast_srtp_change_source(), ast_srtp_destroy(), ast_srtp_policy_destroy(), ast_srtp_unprotect(), AST_TEST_DEFINE(), ast_xmldoc_build_documentation(), astobj2_test_1_helper(), authenticate(), build_peer(), build_reply_digest(), cc_ref(), cc_unref(), cdr_object_alloc(), check_peer_ok(), cleanup_module(), cleanup_registration(), complete_show_sorcery_object(), cpg_confchg_cb(), create_addr_from_peer(), default_listener_shutdown(), default_tps_processing_function(), device_state_cb(), dialog_dump_func(), do_dialog_unlink_sched_items(), endpt_send_request(), generic_monitor_devstate_cb(), handle_request_cancel(), handle_request_do(), handle_response_subscribe(), insert_test_duplicates(), insert_test_vector(), internal_ao2_alloc(), internal_ao2_traverse(), load_module(), manager_add_filter(), manager_free_user(), manager_show_registry(), peer_dump_func(), presence_state_cb(), process_message(), publish_corosync_ping_to_stasis(), push_to_serializer(), register_verify(), reload_config(), retrans_pkt(), session_destructor(), shutdown_mwi_subscription(), sip_call(), sip_cc_monitor_cancel_available_timer(), sip_cc_monitor_request_cc(), sip_destroy_peer(), sip_monitor_instance_destructor(), sip_prepare_socket(), sip_pvt_dtor(), sip_reg_timeout(), sip_register(), sip_reload(), sip_reregister(), sip_send_all_mwi_subscriptions(), sip_send_all_registers(), sip_show_channel(), sip_show_history(), sip_show_mwi(), sip_show_objects(), sip_show_registry(), sip_show_settings(), sip_show_tcp(), sip_subscribe_mwi(), sip_subscribe_mwi_do(), sip_tcp_locate(), sip_tcptls_write(), sip_threadinfo_create(), sip_threadinfo_destructor(), start_mwi_subscription(), start_register_timeout(), start_reregister_timeout(), stop_register_timeout(), stop_retrans_pkt(), temp_peer(), test_ao2_find_w_no_flags(), test_ao2_find_w_OBJ_KEY(), test_ao2_find_w_OBJ_PARTIAL_KEY(), test_ao2_find_w_OBJ_POINTER(), test_container_clone(), test_traversal_nonsorted(), test_traversal_sorted(), tps_shutdown(), transmit_register(), and unload_module().

◆ ao2_t_replace

#define ao2_t_replace (   dst,
  src,
  tag 
)

Replace one object reference with another cleaning up the original.

Since
12.4.0
Parameters
dstPointer to the object that will be cleaned up.
srcPointer to the object replacing it.

Definition at line 503 of file astobj2.h.

Referenced by cdr_object_snapshot_copy(), cdr_object_swap_snapshot(), dialog_unlink_all(), format_cap_replace(), handle_response_register(), sip_pvt_dtor(), sip_reg_timeout(), sip_registry_destroy(), and softmix_mixing_loop().

◆ ao2_t_unlink

#define ao2_t_unlink (   container,
  obj,
  tag 
)    __ao2_unlink((container), (obj), 0, (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

Remove an object from a container.

Parameters
containerThe container to operate on.
objThe object to unlink.
tagused for debugging.
Return values
NULL,always
Note
The object requested to be unlinked must be valid. However, if it turns out that it is not in the container, this function is still safe to be called.
If the object gets unlinked from the container, the container's reference to the object will be automatically released. (The refcount will be decremented).

Definition at line 1596 of file astobj2.h.

Referenced by _moh_unregister(), _sip_tcp_helper_thread(), add_sdp(), ao2_weakproxy_unsubscribe(), ast_srtp_add_stream(), astobj2_test_1_helper(), build_peer(), cc_complete(), cc_failed(), cc_generic_monitor_destructor(), dialog_unlink_all(), expire_register(), parse_register_contact(), sip_prepare_socket(), and sip_prune_realtime().

◆ ao2_t_unlink_flags

#define ao2_t_unlink_flags (   container,
  obj,
  flags,
  tag 
)    __ao2_unlink((container), (obj), (flags), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__)

Remove an object from a container.

Parameters
containerThe container to operate on.
objThe object to unlink.
flagssearch_flags to control unlinking the object. (OBJ_NOLOCK)
tagused for debugging.
Return values
NULL,always
Note
The object requested to be unlinked must be valid. However, if it turns out that it is not in the container, this function is still safe to be called.
If the object gets unlinked from the container, the container's reference to the object will be automatically released. (The refcount will be decremented).

Definition at line 1620 of file astobj2.h.

◆ ao2_t_weakproxy_alloc

#define ao2_t_weakproxy_alloc (   data_size,
  destructor_fn,
  tag 
)    __ao2_weakproxy_alloc(data_size, destructor_fn, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)

◆ ao2_t_weakproxy_get_object

#define ao2_t_weakproxy_get_object (   weakproxy,
  flags,
  tag 
)    __ao2_weakproxy_get_object(weakproxy, flags, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 628 of file astobj2.h.

Referenced by AST_TEST_DEFINE().

◆ ao2_t_weakproxy_ref_object

#define ao2_t_weakproxy_ref_object (   weakproxy,
  delta,
  flags,
  tag 
)
Value:
__ao2_weakproxy_ref_object(weakproxy, delta, flags, \
tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)
int __ao2_weakproxy_ref_object(void *weakproxy, int delta, int flags, const char *tag, const char *file, int line, const char *func)
Run ao2_t_ref on the object associated with weakproxy.
Definition: astobj2.c:859

Definition at line 605 of file astobj2.h.

Referenced by AST_TEST_DEFINE().

◆ ao2_t_weakproxy_set_object

#define ao2_t_weakproxy_set_object (   weakproxy,
  obj,
  flags,
  tag 
)    __ao2_weakproxy_set_object(weakproxy, obj, flags, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 586 of file astobj2.h.

Referenced by __ast_sorcery_open(), AST_TEST_DEFINE(), link_topic_proxy(), and state_alloc().

◆ ao2_trylock

#define ao2_trylock (   a)    __ao2_trylock(a, AO2_LOCK_REQ_MUTEX, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)

◆ ao2_tryrdlock

#define ao2_tryrdlock (   a)    __ao2_trylock(a, AO2_LOCK_REQ_RDLOCK, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)

Definition at line 741 of file astobj2.h.

◆ ao2_trywrlock

#define ao2_trywrlock (   a)    __ao2_trylock(a, AO2_LOCK_REQ_WRLOCK, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)

Definition at line 742 of file astobj2.h.

Referenced by expire_objects_from_cache().

◆ ao2_unlink

#define ao2_unlink (   container,
  obj 
)    __ao2_unlink((container), (obj), 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 1598 of file astobj2.h.

Referenced by activate_thread(), allow_and_or_replace_unsolicited(), app_exec(), ast_ari_websocket_events_event_websocket_established(), ast_bridge_channel_feature_digit(), ast_bridge_channel_kick(), ast_change_name(), ast_channel_publish_final_snapshot(), ast_channel_release(), ast_channel_unlink(), ast_endpoint_shutdown(), ast_hangup(), ast_pickup_find_by_group(), ast_sip_sched_task_cancel(), ast_sip_schedule_task(), ast_sorcery_wizard_unregister(), ast_websocket_server_remove_protocol(), authenticate(), bridge_base_dissolving(), bridge_channel_event_join_leave(), bridge_channel_moving(), bridge_channel_talking(), build_calendar(), build_user(), channel_do_masquerade(), check_retire_linkedid(), conf_ended(), conf_run(), control_unlink(), create_new_sip_etag(), destroy_gateway(), destroy_pvts(), destroy_v21_sessions(), dialgroup_write(), endpoint_lookup(), event_session_cleanup(), fax_session_new(), generic_fax_exec(), grow(), handle_channel_snapshot_update_message(), handle_cli_iax2_prune_realtime(), handle_sip_publish_remove(), jingle_hangup(), join_conference_bridge(), link_option_to_types(), local_hangup(), member_remove_from_queue(), merge_events_cb(), messaging_app_unsubscribe_endpoint(), moh_channel_thread(), msg_set_var_full(), mwi_subscription_shutdown(), named_lock_proxy_cb(), on_dns_update_peer(), parking_lot_remove_if_unused(), parking_lot_retrieve_parked_user(), peercnt_remove(), proxy_dtor(), prune_users(), pthread_timer_close(), publish_expire(), push_to_serializer(), queued_active_thread_idle(), queued_idle_thread_dead(), queued_zombie_thread_dead(), register_aor_core(), reload(), reload_single_member(), remove_bridge_playback(), remove_by_peercallno(), remove_by_transfercallno(), remove_excess_contacts(), run_task(), save_dialstatus(), session_destroy(), sip_cc_monitor_destructor(), sip_options_unused_aor(), sip_options_update_endpoint_state_compositor_aor(), sip_outbound_registration_apply(), sorcery_memory_cache_close(), sorcery_proxy_cb(), stasis_app_bridge_destroy(), stasis_app_bridge_playback_channel_remove(), state_proxy_sub_cb(), subscription_dtor(), topic_dtor(), unlink_peer(), unpark_parked_user(), and wait_wrapper_removal().

◆ ao2_unlink_flags

#define ao2_unlink_flags (   container,
  obj,
  flags 
)    __ao2_unlink((container), (obj), (flags), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

◆ ao2_unlock

#define ao2_unlock (   a)    __ao2_unlock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)

Definition at line 730 of file astobj2.h.

Referenced by __adjust_lock(), __ao2_container_clone(), __ao2_iterator_next(), __ao2_link(), __ao2_ref(), __ao2_weakproxy_find(), __ao2_weakproxy_get_object(), __ao2_weakproxy_ref_object(), __ao2_weakproxy_set_object(), __ast_channel_alloc_ap(), __ast_named_lock_get(), __ast_sorcery_open(), __ast_sorcery_wizard_register(), __cleanup_registration(), __queues_show(), __rtp_recvfrom(), __rtp_sendto(), __stasis_app_register(), __state_find_or_add(), _moh_register(), _sip_show_peer(), _sip_show_peers(), _sip_show_peers_one(), _sip_tcp_helper_thread(), action_confbridgelist(), action_confbridgelistrooms(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_confbridgestoprecord(), action_extensionstatelist(), action_kick_last(), action_toggle_mute_participants(), action_waitevent(), add_calltoken_ignore(), add_sdp(), add_to_queue(), ao2_container_check(), ao2_container_dump(), ao2_container_dup(), ao2_container_dup_weakproxy_objs(), ao2_container_stats(), ao2_iterator_restart(), ao2_ref_and_lock(), ao2_weakproxy_subscribe(), ao2_weakproxy_unsubscribe(), app_control_register_rule(), app_control_unregister_rule(), app_deactivate(), app_event_filter_set(), app_exec(), app_is_active(), app_is_finished(), app_send(), app_shutdown(), app_subscribe_bridge(), app_subscribe_channel(), app_subscribe_endpoint(), app_update(), ari_bridges_play_found(), ari_bridges_play_new(), ast_add_hint(), ast_ari_applications_list(), ast_bridge_channel_get_chan(), ast_bridge_join(), ast_cdr_clear_property(), ast_cdr_getvar(), ast_cdr_reset(), ast_cdr_serialize_variables(), ast_cdr_set_property(), ast_cdr_setuserfield(), ast_cdr_setvar(), ast_change_hint(), ast_change_name(), ast_channel_publish_snapshot(), ast_dns_resolve_recurring_cancel(), ast_endpoint_add_channel(), ast_endpoint_set_max_channels(), ast_endpoint_set_state(), ast_extension_state_del(), ast_get_indication_tone(), ast_get_indication_zone(), ast_hint_presence_state(), ast_hook_send_action(), ast_local_get_peer(), ast_local_setup_bridge(), ast_local_setup_masquerade(), ast_local_unlock_all(), ast_manager_unregister(), ast_merge_contexts_and_delete(), ast_moh_files_next(), ast_register_indication_country(), ast_remove_hint(), ast_res_pjsip_find_or_create_contact_status(), ast_rtcp_interpret(), ast_rtcp_write(), ast_rtp_bundle(), ast_rtp_codecs_payloads_clear(), ast_rtp_codecs_payloads_set_m_type(), ast_rtp_codecs_payloads_set_rtpmap_type_rate(), ast_rtp_codecs_payloads_unset(), ast_rtp_codecs_payloads_xover(), ast_rtp_destroy(), ast_rtp_ice_add_cand(), ast_rtp_ice_start(), ast_rtp_ice_start_media(), ast_rtp_ice_stop(), ast_rtp_ice_turn_request(), ast_rtp_instance_activate(), ast_rtp_instance_add_srtp_policy(), ast_rtp_instance_available_formats(), ast_rtp_instance_bundle(), ast_rtp_instance_change_source(), ast_rtp_instance_dtmf_begin(), ast_rtp_instance_dtmf_end(), ast_rtp_instance_dtmf_end_with_duration(), ast_rtp_instance_dtmf_mode_get(), ast_rtp_instance_dtmf_mode_set(), ast_rtp_instance_extmap_clear(), ast_rtp_instance_extmap_count(), ast_rtp_instance_extmap_enable(), ast_rtp_instance_extmap_get_direction(), ast_rtp_instance_extmap_get_extension(), ast_rtp_instance_extmap_get_id(), ast_rtp_instance_extmap_negotiate(), ast_rtp_instance_fd(), ast_rtp_instance_get_and_cmp_local_address(), ast_rtp_instance_get_and_cmp_requested_target_address(), ast_rtp_instance_get_bridged(), ast_rtp_instance_get_cname(), ast_rtp_instance_get_extended_prop(), ast_rtp_instance_get_incoming_source_address(), ast_rtp_instance_get_local_address(), ast_rtp_instance_get_prop(), ast_rtp_instance_get_recv_buffer_count(), ast_rtp_instance_get_recv_buffer_max(), ast_rtp_instance_get_requested_target_address(), ast_rtp_instance_get_send_buffer_count(), ast_rtp_instance_get_ssrc(), ast_rtp_instance_get_stats(), ast_rtp_instance_new(), ast_rtp_instance_read(), ast_rtp_instance_sendcng(), ast_rtp_instance_set_bridged(), ast_rtp_instance_set_extended_prop(), ast_rtp_instance_set_incoming_source_address(), ast_rtp_instance_set_local_address(), ast_rtp_instance_set_prop(), ast_rtp_instance_set_qos(), ast_rtp_instance_set_read_format(), ast_rtp_instance_set_remote_ssrc(), ast_rtp_instance_set_requested_target_address(), ast_rtp_instance_set_schedid(), ast_rtp_instance_set_stream_num(), ast_rtp_instance_set_write_format(), ast_rtp_instance_stop(), ast_rtp_instance_update_source(), ast_rtp_instance_write(), ast_rtp_local_bridge(), ast_rtp_on_turn_rtcp_state(), ast_rtp_on_turn_rtp_state(), ast_rtp_on_turn_rx_rtcp_data(), ast_rtp_on_turn_rx_rtp_data(), ast_rtp_prop_set(), ast_rtp_red_buffer(), ast_rtp_red_init(), ast_rtp_set_remote_ssrc(), ast_rtp_stop(), ast_serializer_shutdown_group_join(), ast_set_indication_country(), ast_sip_dialog_get_endpoint(), ast_sip_dialog_set_endpoint(), ast_sip_dialog_set_serializer(), ast_sip_get_transport_state(), ast_sip_location_add_contact(), ast_sip_location_retrieve_aor_contacts_filtered(), ast_sip_message_apply_transport(), ast_sip_sched_task_cancel(), ast_sip_sched_task_get_name(), ast_sip_sched_task_get_times2(), ast_sip_schedule_task(), ast_sip_session_suspend(), ast_sip_session_unsuspend(), ast_sip_set_tpselector_from_transport(), ast_sip_transport_monitor_register_replace(), ast_sip_transport_monitor_unregister(), ast_sip_transport_state_set_preferred_identity(), ast_sip_transport_state_set_service_routes(), ast_sip_transport_state_set_transport(), ast_sip_unregister_cli_formatter(), ast_sorcery_object_unregister(), ast_taskprocessor_alert_set_levels(), ast_taskprocessor_create_with_listener(), ast_taskprocessor_execute(), ast_taskprocessor_get(), ast_taskprocessor_is_task(), ast_taskprocessor_suspend(), ast_taskprocessor_unreference(), ast_taskprocessor_unsuspend(), AST_TEST_DEFINE(), ast_threadpool_shutdown(), ast_unreal_answer(), ast_unreal_channel_push_to_bridge(), ast_unreal_digit_begin(), ast_unreal_digit_end(), ast_unreal_fixup(), ast_unreal_hangup(), ast_unreal_indicate(), ast_unreal_lock_all(), ast_unreal_queryoption(), ast_unreal_sendhtml(), ast_unreal_sendtext(), ast_unreal_setoption(), ast_unreal_write_stream(), ast_unregister_indication_country(), ast_websocket_close(), ast_websocket_server_add_protocol2(), ast_websocket_write(), ast_xmpp_client_unlock(), astman_is_authed(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), auth_http_callback(), bridge_candidate_process(), bridge_channel_ind_thread(), bridge_impart_internal(), bridge_manager_destroy(), bridge_manager_service_req(), bridge_manager_thread(), bridge_move(), bridge_p2p_rtp_write(), bridge_parking_pull(), build_callno_limits(), build_peer(), build_reply_digest(), cache_put(), caching_topic_exec(), caldav_load_calendar(), calendar_destructor(), can_ring_entry(), cdr_all_relink(), cdr_all_unlink(), cdr_object_dispatch_all_cb(), cel_linkedid_ref(), change_callid_pvt(), change_priority_caller_on_queue(), channel_do_masquerade(), check_endpoint(), check_retire_linkedid(), clear_stats(), cli_fax_show_sessions(), cli_show_channel(), cli_show_tasks(), compare_weight(), complete_core_show_hint(), complete_queue_remove_member(), complete_sip_user(), conf_announce_channel_push(), conf_ended(), conf_find_bridge_profile(), conf_find_menu_entry_by_sequence(), conf_find_user_profile(), conf_handle_talker_cb(), conf_moh_suspend(), conf_moh_unsuspend(), conf_run(), conf_send_event_to_participants(), confbridge_unlock_and_unref(), control_mark_done(), control_swap_channel_in_bridge(), control_wait(), create_addr_from_peer(), create_dynamic_lot_full(), create_mwi_subscriptions(), create_unsolicited_mwi_subscriptions(), db_destructor(), db_open(), db_sync_thread(), device_state_cb(), device_state_notify_callbacks(), dial_masquerade_breakdown(), dial_masquerade_datastore_remove_chan(), dial_masquerade_fixup(), dial_state_process_bridge_enter(), distributor(), dns_query_recurring_resolution_callback(), dns_query_recurring_scheduled_callback(), endpoint_cache_clear(), endpoint_lookup(), endpt_send_request(), endpt_send_request_cb(), event_session_update_websocket(), ewscal_load_calendar(), exchangecal_load_calendar(), exec_command_on_condition(), execute_menu_entry(), execute_state_callback(), expire_contact(), expire_objects_from_cache(), extension_state_add_destroy(), extension_state_cb(), find_member_by_queuename_and_interface(), find_queue_by_name_rt(), find_session(), find_session_by_nonce(), func_confbridge_info(), generate_parked_user(), generic_http_callback(), generic_lock_unlock_helper(), get_chan_by_ast_name(), get_dsn(), get_input(), get_member_penalty(), get_member_status(), handle_attended_transfer(), handle_blind_transfer(), handle_bridge_leave_message(), handle_channel_snapshot_update_message(), handle_cli_confbridge_list(), handle_cli_confbridge_show_bridge_profiles(), handle_cli_confbridge_show_menu(), handle_cli_confbridge_show_menus(), handle_cli_confbridge_show_user_profiles(), handle_cli_confbridge_start_record(), handle_cli_confbridge_stop_record(), handle_cli_misdn_send_facility(), handle_cli_moh_show_files(), handle_dial_message(), handle_hangup(), handle_manager_show_events(), handle_masquerade(), handle_parked_call_message(), handle_parking_bridge_enter_message(), handle_request_subscribe(), handle_show_hint(), handle_show_hints(), handle_showmanconn(), handle_standard_bridge_enter_message(), handle_stasis_state(), handle_video_on_exit(), handle_video_on_join(), ical_load_calendar(), ice_create(), ice_reset_session(), inprocess_count(), instance_destructor(), internal_ao2_traverse(), internal_bridge_after_cb(), internal_extension_state_extended(), is_our_turn(), is_subscribed_device_state_lock(), jingle_action_session_accept(), jingle_action_session_info(), jingle_action_session_terminate(), jingle_fixup(), jingle_hangup(), jingle_interpret_content(), jingle_new(), jingle_outgoing_hook(), jingle_queue_hangup_with_cause(), jingle_request(), jingle_session_lock_full(), join_conference_bridge(), join_queue(), kqueue_timer_ack(), kqueue_timer_disable_continuous(), kqueue_timer_enable_continuous(), kqueue_timer_set_rate(), leave_conference(), leave_queue(), link_topic_proxy(), load_indications(), local_ast_moh_start(), local_call(), local_devicestate(), local_hangup(), locals_show(), lock_thread(), logging_on_rx_msg(), logging_on_tx_msg(), manager_fax_sessions_entry(), manager_optimize_away(), manager_queues_status(), manager_queues_summary(), manager_show_registry(), manager_sip_peer_status(), member_add_to_queue(), member_remove_from_queue(), memory_cache_full_update(), memory_cache_stale_check(), memory_cache_stale_update_full(), memory_cache_stale_update_object(), messaging_app_subscribe_endpoint(), messaging_app_unsubscribe_endpoint(), moh_class_destructor(), moh_files_alloc(), moh_release(), moh_scan_files(), mohalloc(), monmp3thread(), msg_data_func_read(), msg_data_func_write(), msg_func_read(), msg_func_write(), msg_send_exec(), mwi_contact_changed(), mwi_contact_deleted(), mwi_subscription_shutdown(), mwi_validate_for_aor(), on_dns_update_peer(), park_common_setup(), parking_duration_callback(), parking_lot_retrieve_parked_user(), parking_lot_search_context_extension_inuse(), parking_park_bridge_channel(), pbx_outgoing_attempt(), pbx_outgoing_exec(), peercnt_add(), peercnt_remove(), pjsip_disable_logger(), pjsip_enable_logger_all(), pjsip_enable_logger_host(), pjsip_logger_write_to_pcap(), pjsip_set_logger_pcap(), pjsip_set_logger_verbose(), presence_state_notify_callbacks(), process_events(), process_message(), pthread_timer_ack(), pthread_timer_disable_continuous(), pthread_timer_enable_continuous(), pthread_timer_get_event(), pthread_timer_open(), pthread_timer_set_rate(), publish_cluster_discovery_to_stasis(), publish_local_bridge_message(), publish_msg(), publisher_start(), purge_sessions(), push_to_serializer(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuegetchannel(), queue_function_queuememberlist(), queue_function_queuewaitingcount(), queue_function_var(), qupd_exec(), realtime_sqlite3_exec_query_with_handle(), realtime_sqlite3_exec_update_with_handle(), recalc_holdtime(), record_abandoned(), red_write(), register_aor(), register_contact_transport_remove_cb(), register_contact_transport_shutdown_cb(), register_verify(), release_obj_or_dsn(), reload_queues(), reload_single_member(), reload_single_queue(), remove_attended_transfer_stimulus(), remove_from_queue(), ring_entry(), rna(), rtcp_debug_test_addr(), rtp_add_candidates_to_ice(), rtp_codecs_payloads_copy_rx(), rtp_codecs_payloads_copy_tx(), rtp_deallocate_transport(), rtp_dtls_wrap_active(), rtp_dtls_wrap_get_connection(), rtp_dtls_wrap_get_fingerprint(), rtp_dtls_wrap_get_fingerprint_hash(), rtp_dtls_wrap_get_setup(), rtp_dtls_wrap_reset(), rtp_dtls_wrap_set_configuration(), rtp_dtls_wrap_set_fingerprint(), rtp_dtls_wrap_set_setup(), rtp_dtls_wrap_stop(), rtp_ice_wrap_add_remote_candidate(), rtp_ice_wrap_change_components(), rtp_ice_wrap_get_local_candidates(), rtp_ice_wrap_get_password(), rtp_ice_wrap_get_ufrag(), rtp_ice_wrap_ice_lite(), rtp_ice_wrap_set_authentication(), rtp_ice_wrap_set_role(), rtp_ice_wrap_start(), rtp_ice_wrap_stop(), rtp_ice_wrap_turn_request(), rtp_instance_unlock(), rtp_transport_wide_cc_feedback_produce(), rtp_write_rtcp_fir(), rtp_write_rtcp_psfb(), run_task(), run_timer(), schedule_calendar_event(), send_request_timer_callback(), serializer_shutdown_group_dec(), serializer_shutdown_group_inc(), session_do(), set_dial_masquerade(), set_eventmask(), set_member_paused(), set_member_penalty_help_members(), set_member_ringinuse_help_members(), set_queue_variables(), show_codecs(), single_state_process_bridge_enter(), sip_keepalive_all_peers(), sip_options_endpoint_compositor_add_task(), sip_options_endpoint_state_compositor_find_or_alloc(), sip_options_endpoint_unlink_aor_feeders(), sip_options_notify_endpoint_state_compositors(), sip_options_synchronize_aor_task(), sip_options_synchronize_endpoint(), sip_outbound_publish_timer_cb(), sip_outbound_registration_apply(), sip_poke_all_peers(), sip_prune_realtime(), sip_send_all_registers(), sip_send_mwi_to_peer(), sip_session_suspend_task(), sip_show_inuse(), sip_show_mwi(), sip_show_objects(), sip_show_registry(), sip_show_user(), sip_show_users(), sip_tcptls_write(), sla_add_trunk_to_station(), sla_build_station(), sla_build_trunk(), sla_change_trunk_state(), sla_queue_event_conf(), sla_show_stations(), sla_show_trunks(), sla_state(), sla_station_exec(), sla_station_is_marked(), sla_station_mark(), sla_trunk_is_marked(), sla_trunk_mark(), smdi_toggle_mwi(), sorcery_memory_cache_ami_expire(), sorcery_memory_cache_ami_expire_object(), sorcery_memory_cache_ami_populate(), sorcery_memory_cache_ami_stale(), sorcery_memory_cache_ami_stale_object(), sorcery_memory_cache_close(), sorcery_memory_cache_create(), sorcery_memory_cache_delete(), sorcery_memory_cache_expire(), sorcery_memory_cache_populate(), sorcery_memory_cache_reload(), sorcery_memory_cache_stale(), sorcery_memory_create(), sorcery_memory_update(), spandsp_fax_cli_show_session(), spandsp_manager_fax_session(), stale_cache_update(), stasis_app_bridge_moh_channel(), stasis_app_channel_unreal_set_internal(), stasis_app_control_execute_until_exhausted(), stasis_app_event_allowed(), stasis_app_get_bridge(), stasis_app_message_handler(), stasis_cache_get_all(), stasis_cache_get_by_eid(), stasis_forward_all(), stasis_forward_cancel(), stasis_message_router_add(), stasis_message_router_add_cache_update(), stasis_message_router_remove(), stasis_message_router_remove_cache_update(), stasis_message_router_set_formatters_default(), stasis_message_router_unsubscribe(), stasis_show_topic(), stasis_state_add_subscriber(), stasis_state_publish(), stasis_state_publish_by_id(), stasis_state_remove_publish_by_id(), stasis_state_subscriber_data(), stasis_subscription_accept_formatters(), stasis_subscription_accept_message_type(), stasis_subscription_decline_message_type(), stasis_subscription_is_done(), stasis_subscription_is_subscribed(), stasis_subscription_join(), stasis_subscription_set_filter(), states_cleanup(), statistics_show_subscription(), stimulate_attended_transfer(), subscribe_device_state(), subscriber_dtor(), subscription_invoke(), taskprocessor_push(), test_unlock(), threadpool_execute(), timerfd_timer_ack(), timerfd_timer_disable_continuous(), timerfd_timer_enable_continuous(), timerfd_timer_get_event(), timerfd_timer_set_rate(), topic_add_subscription(), topic_remove_subscription(), tps_reset_stats(), try_calling(), unreal_colp_redirect_indicate(), unreal_colp_stream_topology_request_change(), unreal_queue_frame(), unreal_queue_indicate(), unsubscribe(), unsubscribe_device_state(), update_call_counter(), update_peer_lastmsgssent(), update_queue(), update_realtime_members(), wait_wrapper_removal(), ws_safe_read(), xmpp_client_service_discovery_result_hook(), xmpp_pak_presence(), and xmpp_pak_s10n().

◆ AO2_WEAKPROXY

#define AO2_WEAKPROXY ( )    struct ao2_weakproxy __weakproxy##__LINE__

Macro which must be used at the beginning of weakproxy capable objects.

Note
The primary purpose of user defined fields on weakproxy objects is to hold immutable container keys for the real object.

Definition at line 539 of file astobj2.h.

◆ ao2_weakproxy_alloc

#define ao2_weakproxy_alloc (   data_size,
  destructor_fn 
)    __ao2_weakproxy_alloc(data_size, destructor_fn, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 554 of file astobj2.h.

Referenced by alloc_str().

◆ ao2_weakproxy_find

#define ao2_weakproxy_find (   c,
  arg,
  flags,
  tag 
)    __ao2_weakproxy_find(c, arg, flags, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Perform an ao2_find on a container with ao2_weakproxy objects, returning the real object.

Note
Only OBJ_SEARCH_* and OBJ_NOLOCK flags are supported by this function.
See also
ao2_callback for description of arguments.

Definition at line 1768 of file astobj2.h.

Referenced by __state_find_or_add(), ast_sorcery_retrieve_by_module_name(), stasis_state_remove_publish_by_id(), and stasis_topic_get().

◆ ao2_weakproxy_get_object

#define ao2_weakproxy_get_object (   weakproxy,
  flags 
)    __ao2_weakproxy_get_object(weakproxy, flags, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

◆ ao2_weakproxy_ref_object

#define ao2_weakproxy_ref_object (   weakproxy,
  delta,
  flags 
)    ao2_t_weakproxy_ref_object(weakproxy, delta, flags, NULL)

Definition at line 609 of file astobj2.h.

Referenced by AST_TEST_DEFINE().

◆ ao2_weakproxy_set_object

#define ao2_weakproxy_set_object (   weakproxy,
  obj,
  flags 
)    __ao2_weakproxy_set_object(weakproxy, obj, flags, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__)

Definition at line 583 of file astobj2.h.

Referenced by __ast_named_lock_get(), and alloc_str().

◆ ao2_wrlock

#define ao2_wrlock (   a)    __ao2_lock(a, AO2_LOCK_REQ_WRLOCK, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)

◆ OBJ_KEY

#define OBJ_KEY   OBJ_SEARCH_KEY

Deprecated name

Definition at line 1155 of file astobj2.h.

Referenced by __ast_bucket_scheme_register(), __ast_sorcery_apply_default(), __ast_sorcery_object_field_register(), __ast_sorcery_object_register(), __ast_sorcery_object_type_insert_wizard(), __ast_sorcery_remove_wizard_mapping(), __ast_sorcery_wizard_register(), aco_option_find(), action_confbridgekick(), action_confbridgelist(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_confbridgestoprecord(), add_sdp_streams(), agent_alert(), agent_cfg_find(), agent_cfg_sort_cmp(), agent_function_read(), agent_handle_show_specific(), agent_login_exec(), agent_logoff_request(), agent_pvt_cmp(), agent_pvt_devstate_get(), agent_pvt_sort_cmp(), agent_request_exec(), agent_run(), agents_post_apply_config(), alloc_variant(), announce_request(), app_exec(), applicationmap_sort(), ari_show_user(), ast_bucket_alloc(), ast_bucket_file_alloc(), ast_bucket_file_metadata_get(), ast_bucket_file_metadata_set(), ast_bucket_file_metadata_unset(), ast_channel_dialed_causes_add(), ast_channel_dialed_causes_find(), ast_channel_get_by_name_prefix(), ast_channel_hash_cb(), ast_channel_iterator_by_name_new(), ast_endpoint_find_by_id(), ast_get_chan_applicationmap(), ast_get_feature(), ast_media_get_variants(), ast_sip_session_get_datastore(), ast_sip_session_register_sdp_handler(), ast_sip_session_remove_datastore(), ast_sip_session_unregister_sdp_handler(), ast_sorcery_alloc(), ast_sorcery_copy(), ast_sorcery_create(), ast_sorcery_delete(), ast_sorcery_diff(), ast_sorcery_force_reload_object(), ast_sorcery_get_wizard_mapping(), ast_sorcery_get_wizard_mapping_count(), ast_sorcery_is_stale(), ast_sorcery_load_object(), ast_sorcery_object_fields_register(), ast_sorcery_object_set_copy_handler(), ast_sorcery_object_set_diff_handler(), ast_sorcery_objectset_apply(), ast_sorcery_objectset_create2(), ast_sorcery_objectset_json_create(), ast_sorcery_observer_add(), ast_sorcery_observer_remove(), ast_sorcery_reload_object(), ast_sorcery_retrieve_by_fields(), ast_sorcery_retrieve_by_prefix(), ast_sorcery_retrieve_by_regex(), ast_sorcery_update(), ast_taskprocessor_create_with_listener(), ast_taskprocessor_get(), AST_TEST_DEFINE(), ast_websocket_server_add_protocol2(), ast_websocket_server_remove_protocol(), ast_websocket_uri_cb(), ast_xml_doc_item_cmp(), ast_xml_doc_item_hash(), authenticate_request(), authenticate_verify(), bridge_cmp_cb(), bridge_dtmf_hook_sort(), bridge_hash_cb(), bridge_profile_find(), bridge_sort_cmp(), bucket_file_wizard_retrieve(), bucket_rbtree_str_sort_cmp(), bucket_wizard_retrieve(), build_peer(), build_user(), channel_cmp(), channel_hash(), check_featuregroup_item(), cli_show_module_options(), cli_show_module_type(), cli_show_module_types(), client_buddy_handler(), complete_confbridge_participant(), complete_config_option(), complete_config_type(), conf_find_bridge(), conf_find_bridge_profile(), conf_find_user_profile(), conf_handle_talker_cb(), conf_set_menu_to_user(), conference_bridge_cmp_cb(), conference_bridge_hash_cb(), config_opt_cmp(), config_opt_hash(), confkick_exec(), datastore_cmp(), datastore_hash(), db_cmp_fn(), db_hash_fn(), endpoint_internal_create(), featuregroup_cmp(), featuregroup_find(), featuregroup_hash(), find_database(), find_member_by_queuename_and_interface(), find_peer(), find_user(), find_variant(), forwards_sort(), func_confbridge_info(), generic_lock_unlock_helper(), generic_mute_unmute_helper(), get_buddy_status(), group_item_sort(), handle_cli_confbridge_kick(), handle_cli_confbridge_list(), handle_cli_confbridge_start_record(), handle_cli_confbridge_stop_record(), handle_cli_iax2_unregister(), handle_incoming_sdp(), handle_manager_show_event(), handle_negotiated_sdp_session_media(), iax2_destroy_helper(), insert_test_duplicates(), jingle_action_hook(), jingle_endpoint_cmp(), jingle_endpoint_find(), jingle_endpoint_hash(), jingle_request(), jingle_session_cmp(), jingle_session_hash(), join_conference_bridge(), media_info_cmp(), media_info_hash(), media_variant_cmp(), media_variant_hash(), member_cmp_fn(), member_hash_fn(), menu_cmp_cb(), menu_find(), menu_hash_cb(), menu_template_handler(), named_item_find(), notify_option_cmp(), notify_option_find(), notify_option_hash(), parking_lot_cfg_cmp_fn(), parking_lot_cfg_hash_fn(), parking_lot_sort_fn(), peer_cmp_cb(), peer_hash_cb(), persistent_endpoint_cmp(), persistent_endpoint_hash(), playback_cmp(), playback_hash(), protocol_cmp_fn(), protocol_hash_fn(), publication_cmp_fn(), publication_hash_fn(), pubsub_on_rx_publish_request(), recording_cmp(), recording_hash(), recording_sort(), sdp_handler_list_cmp(), sdp_handler_list_hash(), sdp_requires_deferral(), session_outgoing_nat_hook(), skel_find_or_create_state(), skel_level_cmp(), skel_level_find(), skel_level_hash(), sorcery_memory_cmp(), sorcery_memory_create(), sorcery_memory_delete(), sorcery_memory_hash(), sorcery_memory_retrieve_id(), sorcery_memory_update(), sorcery_reloadable(), stasis_app_control_record(), stasis_app_playback_find_by_id(), stasis_app_recording_find_by_name(), test_ao2_find_w_OBJ_KEY(), test_cmp_cb(), test_expected_duplicates(), test_hash_cb(), test_item_cmp(), test_item_find(), test_performance(), test_sort_cb(), tps_cmp_cb(), tps_hash_cb(), user_cmp_cb(), user_hash_cb(), user_profile_find(), verify_default_parking_lot(), verify_default_profiles(), wait_bridge_hash_fn(), wait_bridge_sort_fn(), wait_bridge_wrapper_find_by_name(), xmldoc_update_config_option(), xmldoc_update_config_type(), xmpp_buddy_cmp(), xmpp_buddy_hash(), xmpp_client_config_merge_buddies(), xmpp_client_service_discovery_result_hook(), xmpp_component_register_get_hook(), xmpp_config_cmp(), xmpp_config_find(), xmpp_pak_message(), xmpp_pak_presence(), xmpp_pak_s10n(), xmpp_resource_hash(), and xmpp_roster_hook().

◆ OBJ_PARTIAL_KEY

#define OBJ_PARTIAL_KEY   OBJ_SEARCH_PARTIAL_KEY

◆ OBJ_POINTER

#define OBJ_POINTER   OBJ_SEARCH_OBJECT

Deprecated name

Definition at line 1154 of file astobj2.h.

Referenced by __find_call(), __find_callno(), _mohclass_unref(), _sip_tcp_helper_thread(), add_calltoken_ignore(), agent_cfg_sort_cmp(), agent_pvt_cmp(), agent_pvt_sort_cmp(), applicationmap_sort(), ast_config_hook_unregister(), ast_get_indication_zone(), ast_get_namedgroups(), ast_rtp_ice_add_cand(), ast_srtp_add_stream(), ast_srtp_change_source(), AST_TEST_DEFINE(), ast_unregister_indication_country(), bridge_cmp_cb(), bridge_dtmf_hook_sort(), bridge_hash_cb(), bridge_sort_cmp(), bucket_rbtree_str_sort_cmp(), build_callno_limits(), build_peer(), channel_cmp(), channel_hash(), cli_alias_passthrough(), cli_fax_show_session(), compare_weight(), complete_indications(), conference_bridge_cmp_cb(), conference_bridge_hash_cb(), entry_cmp_fn(), featuregroup_cmp(), featuregroup_hash(), find_calendar(), find_cc_core_instance(), find_event(), find_generic_monitor_instance_list(), find_load_queue_rt_friendly(), find_pvt(), find_queue_by_name_rt(), forwards_sort(), get_esc_entry(), get_sip_pvt_from_replaces(), group_cmp_fn(), group_item_sort(), handle_cli_indication_show(), hash_test_lookup(), hash_test_shrink(), ice_candidates_compare(), manager_fax_session(), menu_cmp_cb(), menu_hash_cb(), msg_data_find(), named_acl_find(), namedgroup_match(), parking_lot_cfg_cmp_fn(), parking_lot_cfg_hash_fn(), parking_lot_sort_fn(), parse_tone_zone(), peercnt_add(), peercnt_modify(), peercnt_remove_by_addr(), pending_members_remove(), presence_state_cb(), queue_function_queuegetchannel(), queue_function_queuewaitingcount(), realtime_common(), realtime_sqlite3_require(), recording_cleanup(), recording_sort(), reload_queue_members(), reload_single_member(), reload_single_queue(), remove_from_playbacks(), remove_from_queue(), sched_delay_remove(), set_fn(), sip_find_peer_full(), sip_poke_peer_s(), sip_prune_realtime(), sip_tcptls_write(), sla_find_station(), sla_find_trunk(), test_ao2_find_w_OBJ_POINTER(), test_container_clone(), unsubscribe(), update_queue(), user_cmp_cb(), user_hash_cb(), ustmtext(), wait_bridge_hash_fn(), and wait_bridge_sort_fn().

Typedef Documentation

◆ ao2_callback_data_fn

typedef int() ao2_callback_data_fn(void *obj, void *arg, void *data, int flags)

Type of a generic callback function.

Parameters
objpointer to the (user-defined part) of an object.
argcallback argument from ao2_callback()
dataarbitrary data from ao2_callback()
flagsflags from ao2_callback() OBJ_SEARCH_OBJECT - if set, 'arg', is an object. OBJ_SEARCH_KEY - if set, 'arg', is a search key item that is not an object. OBJ_SEARCH_PARTIAL_KEY - if set, 'arg', is a partial search key item that is not an object.

The return values are a combination of enum _cb_results. Callback functions are used to search or manipulate objects in a container.

Definition at line 1248 of file astobj2.h.

◆ ao2_callback_fn

typedef int() ao2_callback_fn(void *obj, void *arg, int flags)

Type of a generic callback function.

Parameters
objpointer to the (user-defined part) of an object.
argcallback argument from ao2_callback()
flagsflags from ao2_callback() OBJ_SEARCH_OBJECT - if set, 'arg', is an object. OBJ_SEARCH_KEY - if set, 'arg', is a search key item that is not an object. OBJ_SEARCH_PARTIAL_KEY - if set, 'arg', is a partial search key item that is not an object.

The return values are a combination of enum _cb_results. Callback functions are used to search or manipulate objects in a container.

Definition at line 1230 of file astobj2.h.

◆ ao2_destructor_fn

typedef void(* ao2_destructor_fn) (void *vdoomed)

Typedef for an object destructor.

Parameters
vdoomedObject to destroy.

This is called just before freeing the memory for the object. It is passed a pointer to the user-defined data of the object.

Returns
Nothing

Definition at line 360 of file astobj2.h.

◆ ao2_hash_fn

typedef int() ao2_hash_fn(const void *obj, int flags)

Type of a generic function to generate a hash value from an object.

Parameters
objpointer to the (user-defined part) of an object.
flagsflags from ao2_callback() OBJ_SEARCH_OBJECT - if set, 'obj', is an object. OBJ_SEARCH_KEY - if set, 'obj', is a search key item that is not an object.
Note
This function must be idempotent.
Returns
Computed hash value.

Definition at line 1262 of file astobj2.h.

◆ ao2_prnt_fn

typedef void() ao2_prnt_fn(void *where, const char *fmt,...)

Print output.

Since
12.0.0
Parameters
whereUser data pointer needed to determine where to put output.
fmtprintf type format string.
Returns
Nothing

Definition at line 1442 of file astobj2.h.

◆ ao2_prnt_obj_fn

typedef void() ao2_prnt_obj_fn(void *v_obj, void *where, ao2_prnt_fn *prnt)

Print object key.

Since
12.0.0
Parameters
v_objA pointer to the object we want the key printed.
whereUser data needed by prnt to determine where to put output.
prntPrint output callback function to use.
Returns
Nothing

Definition at line 1454 of file astobj2.h.

◆ ao2_sort_fn

typedef int() ao2_sort_fn(const void *obj_left, const void *obj_right, int flags)

Type of generic container sort function.

Parameters
obj_leftpointer to the (user-defined part) of an object.
obj_rightpointer to the (user-defined part) of an object.
flagsflags from ao2_callback() OBJ_SEARCH_OBJECT - if set, 'obj_right', is an object. OBJ_SEARCH_KEY - if set, 'obj_right', is a search key item that is not an object. OBJ_SEARCH_PARTIAL_KEY - if set, 'obj_right', is a partial search key item that is not an object.
Note
This function must be idempotent.
Return values
<0if obj_left < obj_right
=0if obj_left == obj_right
>0if obj_left > obj_right

Definition at line 1280 of file astobj2.h.

◆ ao2_weakproxy_notification_cb

typedef void(* ao2_weakproxy_notification_cb) (void *weakproxy, void *data)

Definition at line 527 of file astobj2.h.

Enumeration Type Documentation

◆ _cb_results

A callback function will return a combination of CMP_MATCH and CMP_STOP. The latter will terminate the search in a container.

Enumerator
CMP_MATCH 

the object matches the request

CMP_STOP 

stop the search now

Definition at line 1030 of file astobj2.h.

1030  {
1031  CMP_MATCH = 0x1, /*!< the object matches the request */
1032  CMP_STOP = 0x2, /*!< stop the search now */
1033 };

◆ ao2_alloc_opts

Options available when allocating an ao2 object.

Enumerator
AO2_ALLOC_OPT_LOCK_MUTEX 

The ao2 object has a recursive mutex lock associated with it.

AO2_ALLOC_OPT_LOCK_RWLOCK 

The ao2 object has a non-recursive read/write lock associated with it.

AO2_ALLOC_OPT_LOCK_NOLOCK 

The ao2 object has no lock associated with it.

AO2_ALLOC_OPT_LOCK_MASK 

The ao2 object locking option field mask.

AO2_ALLOC_OPT_LOCK_OBJ 
AO2_ALLOC_OPT_NO_REF_DEBUG 

The ao2 object will not record any REF_DEBUG entries

Definition at line 363 of file astobj2.h.

363  {
364  /*! The ao2 object has a recursive mutex lock associated with it. */
365  AO2_ALLOC_OPT_LOCK_MUTEX = (0 << 0),
366  /*! The ao2 object has a non-recursive read/write lock associated with it. */
367  AO2_ALLOC_OPT_LOCK_RWLOCK = (1 << 0),
368  /*! The ao2 object has no lock associated with it. */
369  AO2_ALLOC_OPT_LOCK_NOLOCK = (2 << 0),
370  /*! The ao2 object locking option field mask. */
371  AO2_ALLOC_OPT_LOCK_MASK = (3 << 0),
372  /*!
373  * \internal The ao2 object uses a separate object for locking.
374  *
375  * \note This option is used internally by ao2_alloc_with_lockobj and
376  * should never be passed directly to ao2_alloc.
377  */
379  /*! The ao2 object will not record any REF_DEBUG entries */
380  AO2_ALLOC_OPT_NO_REF_DEBUG = (1 << 2),
381 };

◆ ao2_container_opts

Options available when allocating an ao2 container object.

Note
Each option is open to some interpretation by the container type as long as it makes sense with the option name.
Enumerator
AO2_CONTAINER_ALLOC_OPT_INSERT_BEGIN 

Insert objects at the beginning of the container. (Otherwise it is the opposite; insert at the end.)

Note
If an ao2_sort_fn is provided, the object is inserted before any objects with duplicate keys.
Hash containers insert the object in the computed hash bucket in the indicated manner.
AO2_CONTAINER_ALLOC_OPT_DUPS_MASK 

The ao2 container objects with duplicate keys option field mask.

AO2_CONTAINER_ALLOC_OPT_DUPS_ALLOW 

Allow objects with duplicate keys in container.

AO2_CONTAINER_ALLOC_OPT_DUPS_REJECT 

Reject objects with duplicate keys in container.

Note
The container must be sorted. i.e. have an ao2_sort_fn.
AO2_CONTAINER_ALLOC_OPT_DUPS_OBJ_REJECT 

Reject duplicate objects in container.

Don't link the same object into the container twice. However, you can link a different object with the same key.

Note
The container must be sorted. i.e. have an ao2_sort_fn.
It is assumed that the objects are located where the search key says they should be located.
AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE 

Replace objects with duplicate keys in container.

The existing duplicate object is removed and the new object takes the old object's place.

Note
The container must be sorted. i.e. have an ao2_sort_fn.

Definition at line 1165 of file astobj2.h.

1165  {
1166  /*!
1167  * \brief Insert objects at the beginning of the container.
1168  * (Otherwise it is the opposite; insert at the end.)
1169  *
1170  * \note If an ao2_sort_fn is provided, the object is inserted
1171  * before any objects with duplicate keys.
1172  *
1173  * \note Hash containers insert the object in the computed hash
1174  * bucket in the indicated manner.
1175  */
1177 
1178  /*!
1179  * \brief The ao2 container objects with duplicate keys option field mask.
1180  */
1182  /*!
1183  * \brief Allow objects with duplicate keys in container.
1184  */
1186  /*!
1187  * \brief Reject objects with duplicate keys in container.
1188  *
1189  * \note The container must be sorted. i.e. have an
1190  * ao2_sort_fn.
1191  */
1193  /*!
1194  * \brief Reject duplicate objects in container.
1195  *
1196  * \details Don't link the same object into the container twice.
1197  * However, you can link a different object with the same key.
1198  *
1199  * \note The container must be sorted. i.e. have an
1200  * ao2_sort_fn.
1201  *
1202  * \note It is assumed that the objects are located where the
1203  * search key says they should be located.
1204  */
1206  /*!
1207  * \brief Replace objects with duplicate keys in container.
1208  *
1209  * \details The existing duplicate object is removed and the new
1210  * object takes the old object's place.
1211  *
1212  * \note The container must be sorted. i.e. have an
1213  * ao2_sort_fn.
1214  */
1216 };
Allow objects with duplicate keys in container.
Definition: astobj2.h:1185
Insert objects at the beginning of the container. (Otherwise it is the opposite; insert at the end...
Definition: astobj2.h:1176
The ao2 container objects with duplicate keys option field mask.
Definition: astobj2.h:1181
Replace objects with duplicate keys in container.
Definition: astobj2.h:1215
Reject objects with duplicate keys in container.
Definition: astobj2.h:1192
Reject duplicate objects in container.
Definition: astobj2.h:1205

◆ ao2_iterator_flags

Flags that can be passed to ao2_iterator_init() to modify the behavior of the iterator.

Enumerator
AO2_ITERATOR_DONTLOCK 

Assume that the ao2_container is already locked.

Note
For ao2_containers that have mutexes, no locking will be done.
For ao2_containers that have RWLOCKs, the lock will be promoted to write mode as needed. The lock will be returned to the original locked state.
Only use this flag if the ao2_container is manually locked already. You should hold the lock until after ao2_iterator_destroy(). If you must release the lock then you must at least hold the lock whenever you call an ao2_iterator_xxx function with this iterator.
AO2_ITERATOR_MALLOCD 

Indicates that the iterator was dynamically allocated by astobj2 API and should be freed by ao2_iterator_destroy().

AO2_ITERATOR_UNLINK 

Indicates that before the iterator returns an object from the container being iterated, the object should be unlinked from the container.

AO2_ITERATOR_DESCENDING 

Iterate in descending order (Last to first container object) (Otherwise ascending order)

Note
Other traversal orders such as pre-order and post-order do not make sense because they require the container structure to be static during the traversal. Iterators just about guarantee that is not going to happen because the container is allowed to change by other threads during the iteration.

Definition at line 1855 of file astobj2.h.

1855  {
1856  /*!
1857  * \brief Assume that the ao2_container is already locked.
1858  *
1859  * \note For ao2_containers that have mutexes, no locking will
1860  * be done.
1861  *
1862  * \note For ao2_containers that have RWLOCKs, the lock will be
1863  * promoted to write mode as needed. The lock will be returned
1864  * to the original locked state.
1865  *
1866  * \note Only use this flag if the ao2_container is manually
1867  * locked already. You should hold the lock until after
1868  * ao2_iterator_destroy(). If you must release the lock then
1869  * you must at least hold the lock whenever you call an
1870  * ao2_iterator_xxx function with this iterator.
1871  */
1872  AO2_ITERATOR_DONTLOCK = (1 << 0),
1873  /*!
1874  * Indicates that the iterator was dynamically allocated by
1875  * astobj2 API and should be freed by ao2_iterator_destroy().
1876  */
1877  AO2_ITERATOR_MALLOCD = (1 << 1),
1878  /*!
1879  * Indicates that before the iterator returns an object from
1880  * the container being iterated, the object should be unlinked
1881  * from the container.
1882  */
1883  AO2_ITERATOR_UNLINK = (1 << 2),
1884  /*!
1885  * Iterate in descending order (Last to first container object)
1886  * (Otherwise ascending order)
1887  *
1888  * \note Other traversal orders such as pre-order and post-order
1889  * do not make sense because they require the container
1890  * structure to be static during the traversal. Iterators just
1891  * about guarantee that is not going to happen because the
1892  * container is allowed to change by other threads during the
1893  * iteration.
1894  */
1895  AO2_ITERATOR_DESCENDING = (1 << 3),
1896 };
Assume that the ao2_container is already locked.
Definition: astobj2.h:1872

◆ ao2_lock_req

Which lock to request.

Enumerator
AO2_LOCK_REQ_MUTEX 

Request the mutex lock be acquired.

AO2_LOCK_REQ_RDLOCK 

Request the read lock be acquired.

AO2_LOCK_REQ_WRLOCK 

Request the write lock be acquired.

Definition at line 701 of file astobj2.h.

701  {
702  /*! Request the mutex lock be acquired. */
704  /*! Request the read lock be acquired. */
706  /*! Request the write lock be acquired. */
708 };

◆ search_flags

Flags passed to ao2_callback_fn(), ao2_hash_fn(), and ao2_sort_fn() to modify behaviour.

Enumerator
OBJ_UNLINK 

Unlink the object for which the callback function returned CMP_MATCH.

OBJ_NODATA 

On match, don't return the object hence do not increase its refcount.

OBJ_MULTIPLE 

Don't stop at the first match in ao2_callback() unless the result of the callback function has the CMP_STOP bit set.

OBJ_NOLOCK 

Assume that the ao2_container is already locked.

Note
For ao2_containers that have mutexes, no locking will be done.
For ao2_containers that have RWLOCKs, the lock will be promoted to write mode as needed. The lock will be returned to the original locked state.
Only use this flag if the ao2_container is manually locked already.
OBJ_SEARCH_MASK 

Search option field mask.

Todo:
Eventually OBJ_SEARCH_MASK will shrink to a two bit field when the codebase is made to use the search field values as a field instead of independent bits.
OBJ_SEARCH_NONE 

The arg parameter has no meaning to the astobj2 code.

OBJ_SEARCH_OBJECT 

The arg parameter is an object of the same type.

The arg parameter is an object of the same type as the one being searched for, so use the object's ao2_hash_fn and/or ao2_sort_fn functions for optimized searching.

Note
The supplied ao2_callback_fn is called after the container nodes have been filtered by the ao2_hash_fn and/or ao2_sort_fn functions.
OBJ_SEARCH_KEY 

The arg parameter is a search key, but is not an object.

This can be used when you want to be able to pass custom data to the container's stored ao2_hash_fn, ao2_sort_fn, and ao2_find ao2_callback_fn functions that is not a full object, but perhaps just a string.

Note
The supplied ao2_callback_fn is called after the container nodes have been filtered by the ao2_hash_fn and/or ao2_sort_fn functions.
OBJ_SEARCH_PARTIAL_KEY 

The arg parameter is a partial search key similar to OBJ_SEARCH_KEY.

The partial key can be used by the ao2_sort_fn to guide the search to find a contiguous subset of a sorted container. For example, a sorted container holds: "A", "B", "Bert", "Beth", "Earnie". Doing a partial key search with "B" will find the sorted subset of all held objects starting with "B".

Note
The supplied ao2_callback_fn is called after the container nodes have been filtered by the ao2_sort_fn function.
OBJ_ORDER_MASK 

Traverse order option field mask.

OBJ_ORDER_ASCENDING 

Traverse in ascending order (First to last container object)

OBJ_ORDER_DESCENDING 

Traverse in descending order (Last to first container object)

OBJ_ORDER_PRE 

Traverse in pre-order (Node then children, for tree container)

Note
For non-tree containers, it is up to the container type to make the best interpretation of the order. For list and hash containers, this also means ascending order because a binary tree can degenerate into a list.
OBJ_ORDER_POST 

Traverse in post-order (Children then node, for tree container)

Note
For non-tree containers, it is up to the container type to make the best interpretation of the order. For list and hash containers, this also means descending order because a binary tree can degenerate into a list.

Definition at line 1038 of file astobj2.h.

1038  {
1039  /*!
1040  * Unlink the object for which the callback function returned
1041  * CMP_MATCH.
1042  */
1043  OBJ_UNLINK = (1 << 0),
1044  /*!
1045  * On match, don't return the object hence do not increase its
1046  * refcount.
1047  */
1048  OBJ_NODATA = (1 << 1),
1049  /*!
1050  * Don't stop at the first match in ao2_callback() unless the
1051  * result of the callback function has the CMP_STOP bit set.
1052  */
1053  OBJ_MULTIPLE = (1 << 2),
1054  /*!
1055  * \brief Assume that the ao2_container is already locked.
1056  *
1057  * \note For ao2_containers that have mutexes, no locking will
1058  * be done.
1059  *
1060  * \note For ao2_containers that have RWLOCKs, the lock will be
1061  * promoted to write mode as needed. The lock will be returned
1062  * to the original locked state.
1063  *
1064  * \note Only use this flag if the ao2_container is manually
1065  * locked already.
1066  */
1067  OBJ_NOLOCK = (1 << 4),
1068 
1069  /*!
1070  * \brief Search option field mask.
1071  *
1072  * \todo Eventually OBJ_SEARCH_MASK will shrink to a two bit
1073  * field when the codebase is made to use the search field
1074  * values as a field instead of independent bits.
1075  */
1076  OBJ_SEARCH_MASK = (0x07 << 5),
1077  /*! \brief The arg parameter has no meaning to the astobj2 code. */
1078  OBJ_SEARCH_NONE = (0 << 5),
1079  /*!
1080  * \brief The arg parameter is an object of the same type.
1081  *
1082  * \details
1083  * The arg parameter is an object of the same type as the one
1084  * being searched for, so use the object's ao2_hash_fn and/or
1085  * ao2_sort_fn functions for optimized searching.
1086  *
1087  * \note The supplied ao2_callback_fn is called after the
1088  * container nodes have been filtered by the ao2_hash_fn and/or
1089  * ao2_sort_fn functions.
1090  */
1091  OBJ_SEARCH_OBJECT = (1 << 5),
1092  /*!
1093  * \brief The arg parameter is a search key, but is not an object.
1094  *
1095  * \details
1096  * This can be used when you want to be able to pass custom data
1097  * to the container's stored ao2_hash_fn, ao2_sort_fn, and
1098  * ao2_find ao2_callback_fn functions that is not a full object,
1099  * but perhaps just a string.
1100  *
1101  * \note The supplied ao2_callback_fn is called after the
1102  * container nodes have been filtered by the ao2_hash_fn and/or
1103  * ao2_sort_fn functions.
1104  */
1105  OBJ_SEARCH_KEY = (2 << 5),
1106  /*!
1107  * \brief The arg parameter is a partial search key similar to OBJ_SEARCH_KEY.
1108  *
1109  * \details
1110  * The partial key can be used by the ao2_sort_fn to guide the
1111  * search to find a contiguous subset of a sorted container.
1112  * For example, a sorted container holds: "A", "B", "Bert",
1113  * "Beth", "Earnie". Doing a partial key search with "B" will
1114  * find the sorted subset of all held objects starting with "B".
1115  *
1116  * \note The supplied ao2_callback_fn is called after the
1117  * container nodes have been filtered by the ao2_sort_fn
1118  * function.
1119  */
1120  OBJ_SEARCH_PARTIAL_KEY = (4 << 5),
1121 
1122  /*! \brief Traverse order option field mask. */
1123  OBJ_ORDER_MASK = (0x03 << 8),
1124  /*! \brief Traverse in ascending order (First to last container object) */
1125  OBJ_ORDER_ASCENDING = (0 << 8),
1126  /*! \brief Traverse in descending order (Last to first container object) */
1127  OBJ_ORDER_DESCENDING = (1 << 8),
1128  /*!
1129  * \brief Traverse in pre-order (Node then children, for tree container)
1130  *
1131  * \note For non-tree containers, it is up to the container type
1132  * to make the best interpretation of the order. For list and
1133  * hash containers, this also means ascending order because a
1134  * binary tree can degenerate into a list.
1135  */
1136  OBJ_ORDER_PRE = (2 << 8),
1137  /*!
1138  * \brief Traverse in post-order (Children then node, for tree container)
1139  *
1140  * \note For non-tree containers, it is up to the container type
1141  * to make the best interpretation of the order. For list and
1142  * hash containers, this also means descending order because a
1143  * binary tree can degenerate into a list.
1144  */
1145  OBJ_ORDER_POST = (3 << 8),
1146 };
The arg parameter is a search key, but is not an object.
Definition: astobj2.h:1105
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
The arg parameter has no meaning to the astobj2 code.
Definition: astobj2.h:1078
Traverse in ascending order (First to last container object)
Definition: astobj2.h:1125
The arg parameter is a partial search key similar to OBJ_SEARCH_KEY.
Definition: astobj2.h:1120
Traverse in descending order (Last to first container object)
Definition: astobj2.h:1127
Traverse in pre-order (Node then children, for tree container)
Definition: astobj2.h:1136
The arg parameter is an object of the same type.
Definition: astobj2.h:1091
Traverse in post-order (Children then node, for tree container)
Definition: astobj2.h:1145
Search option field mask.
Definition: astobj2.h:1076
Traverse order option field mask.
Definition: astobj2.h:1123

Function Documentation

◆ __ao2_alloc()

void* __ao2_alloc ( size_t  data_size,
ao2_destructor_fn  destructor_fn,
unsigned int  options,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 765 of file astobj2.c.

References internal_ao2_alloc(), and NULL.

Referenced by __ao2_container_alloc_hash(), __ao2_container_alloc_rbtree(), __ao2_weakproxy_alloc(), __ast_channel_internal_alloc(), __ast_format_cap_alloc(), __ast_named_lock_get(), __ast_sorcery_open(), __sip_alloc(), _moh_class_malloc(), and state_alloc().

767 {
768  return internal_ao2_alloc(data_size, destructor_fn, options, NULL, tag, file, line, func);
769 }
#define NULL
Definition: resample.c:96
static struct test_options options
static void * internal_ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, void *lockobj, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:681

◆ __ao2_alloc_with_lockobj()

void* __ao2_alloc_with_lockobj ( size_t  data_size,
ao2_destructor_fn  destructor_fn,
void *  lockobj,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 771 of file astobj2.c.

References AO2_ALLOC_OPT_LOCK_OBJ, and internal_ao2_alloc().

773 {
774  return internal_ao2_alloc(data_size, destructor_fn, AO2_ALLOC_OPT_LOCK_OBJ, lockobj,
775  tag, file, line, func);
776 }
static void * internal_ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, void *lockobj, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:681

◆ __ao2_callback()

void* __ao2_callback ( struct ao2_container c,
enum search_flags  flags,
ao2_callback_fn cb_fn,
void *  arg,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 410 of file astobj2_container.c.

References AO2_CALLBACK_DEFAULT, internal_ao2_traverse(), and NULL.

Referenced by __ao2_find(), __ao2_unlink(), and __find_call().

413 {
414  return internal_ao2_traverse(c, flags, cb_fn, arg, NULL, AO2_CALLBACK_DEFAULT, tag, file, line, func);
415 }
#define NULL
Definition: resample.c:96
static void * internal_ao2_traverse(struct ao2_container *self, enum search_flags flags, void *cb_fn, void *arg, void *data, enum ao2_callback_type type, const char *tag, const char *file, int line, const char *func)

◆ __ao2_callback_data()

void* __ao2_callback_data ( struct ao2_container c,
enum search_flags  flags,
ao2_callback_data_fn cb_fn,
void *  arg,
void *  data,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 417 of file astobj2_container.c.

References AO2_CALLBACK_WITH_DATA, and internal_ao2_traverse().

420 {
421  return internal_ao2_traverse(c, flags, cb_fn, arg, data, AO2_CALLBACK_WITH_DATA, tag, file, line, func);
422 }
static void * internal_ao2_traverse(struct ao2_container *self, enum search_flags flags, void *cb_fn, void *arg, void *data, enum ao2_callback_type type, const char *tag, const char *file, int line, const char *func)

◆ __ao2_cleanup()

void __ao2_cleanup ( void *  obj)

gcc attribute(cleanup()) functions

Note
they must be able to handle NULL parameters because most of the allocation/find functions can fail and we don't want to try to tear down a NULL

Definition at line 674 of file astobj2.c.

References ao2_ref.

Referenced by agent_request_exec(), ast_ari_bridges_set_video_source(), bridge_agent_hold_push(), bridge_builtin_set_limits(), bridge_stasis_queue_join_action(), dial_bridge_after_cb(), internal_bridge_after_cb(), native_rtp_bridge_framehook_attach(), and parking_set_duration().

675 {
676  if (obj) {
677  ao2_ref(obj, -1);
678  }
679 }
#define ao2_ref(o, delta)
Definition: astobj2.h:464
void * obj
Definition: astobj2.h:808

◆ __ao2_cleanup_debug()

void __ao2_cleanup_debug ( void *  obj,
const char *  tag,
const char *  file,
int  line,
const char *  function 
)

Definition at line 667 of file astobj2.c.

References __ao2_ref().

668 {
669  if (obj) {
670  __ao2_ref(obj, -1, tag, file, line, function);
671  }
672 }
int __ao2_ref(void *user_data, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498
void * obj
Definition: astobj2.h:808

◆ __ao2_container_alloc_hash()

struct ao2_container* __ao2_container_alloc_hash ( unsigned int  ao2_options,
unsigned int  container_options,
unsigned int  n_buckets,
ao2_hash_fn hash_fn,
ao2_sort_fn sort_fn,
ao2_callback_fn cmp_fn,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 1079 of file astobj2_hash.c.

References __ao2_alloc(), container_destruct(), hash_ao2_container_init(), and ao2_container_hash::n_buckets.

Referenced by __ao2_container_alloc_list(), and hash_ao2_alloc_empty_clone().

1083 {
1084  unsigned int num_buckets;
1085  size_t container_size;
1086  struct ao2_container_hash *self;
1087 
1088  num_buckets = hash_fn ? n_buckets : 1;
1089  container_size = sizeof(struct ao2_container_hash) + num_buckets * sizeof(struct hash_bucket);
1090 
1091  self = __ao2_alloc(container_size, container_destruct, ao2_options,
1092  tag ?: __PRETTY_FUNCTION__, file, line, func);
1093  return hash_ao2_container_init(self, container_options, num_buckets, hash_fn,
1094  sort_fn, cmp_fn);
1095 }
void container_destruct(void *_c)
void * __ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
Definition: astobj2.c:765
static struct ao2_container * hash_ao2_container_init(struct ao2_container_hash *self, unsigned int options, unsigned int n_buckets, ao2_hash_fn *hash_fn, ao2_sort_fn *sort_fn, ao2_callback_fn *cmp_fn)
Initialize a hash container with the desired number of buckets.
ao2_hash_fn * hash_fn
Definition: astobj2_hash.c:71

◆ __ao2_container_alloc_list()

struct ao2_container* __ao2_container_alloc_list ( unsigned int  ao2_options,
unsigned int  container_options,
ao2_sort_fn sort_fn,
ao2_callback_fn cmp_fn,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 1097 of file astobj2_hash.c.

References __ao2_container_alloc_hash(), and NULL.

1100 {
1101  return __ao2_container_alloc_hash(ao2_options, container_options, 1, NULL,
1102  sort_fn, cmp_fn, tag, file, line, func);
1103 }
struct ao2_container * __ao2_container_alloc_hash(unsigned int ao2_options, unsigned int container_options, unsigned int n_buckets, ao2_hash_fn *hash_fn, ao2_sort_fn *sort_fn, ao2_callback_fn *cmp_fn, const char *tag, const char *file, int line, const char *func)
#define NULL
Definition: resample.c:96

◆ __ao2_container_alloc_rbtree()

struct ao2_container* __ao2_container_alloc_rbtree ( unsigned int  ao2_options,
unsigned int  container_options,
ao2_sort_fn sort_fn,
ao2_callback_fn cmp_fn,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 2040 of file astobj2_rbtree.c.

References __ao2_alloc(), __LOG_ERROR, ast_log, container_destruct(), NULL, and rb_ao2_container_init().

Referenced by rb_ao2_alloc_empty_clone().

2043 {
2044  struct ao2_container_rbtree *self;
2045 
2046  if (!sort_fn) {
2047  /* Sanity checks. */
2048  ast_log(__LOG_ERROR, file, line, func, "Missing sort_fn()!\n");
2049  return NULL;
2050  }
2051 
2052  self = __ao2_alloc(sizeof(*self), container_destruct, ao2_options,
2053  tag ?: __PRETTY_FUNCTION__, file, line, func);
2054  return rb_ao2_container_init(self, container_options, sort_fn, cmp_fn);
2055 }
void container_destruct(void *_c)
void * __ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
Definition: astobj2.c:765
#define __LOG_ERROR
Definition: logger.h:284
#define NULL
Definition: resample.c:96
#define ast_log
Definition: astobj2.c:42
static struct ao2_container * rb_ao2_container_init(struct ao2_container_rbtree *self, unsigned int options, ao2_sort_fn *sort_fn, ao2_callback_fn *cmp_fn)
Initialize a rbtree container.

◆ __ao2_container_clone()

struct ao2_container* __ao2_container_clone ( struct ao2_container orig,
enum search_flags  flags,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Create a clone/copy of the given container.

Since
11.0
Parameters
origContainer to copy all object references from.
flagsOBJ_NOLOCK if a lock is already held on the container.
Note
This can potentially be expensive because a malloc is needed for every object in the orig container.
Return values
Clonecontainer on success.
NULLon error.

Definition at line 753 of file astobj2_container.c.

References __ao2_ref(), __ast_assert_failed(), __is_ao2_object, ao2_container_methods::alloc_empty_clone, ao2_container_dup(), ao2_unlock, ao2_wrlock, NULL, OBJ_NOLOCK, and ao2_container::v_table.

754 {
755  struct ao2_container *clone;
756  int failed;
757 
758  /* Create the clone container with the same properties as the original. */
759  if (!__is_ao2_object(orig, file, line, func)) {
760  return NULL;
761  }
762 
763  if (!orig->v_table || !orig->v_table->alloc_empty_clone) {
764  /* Sanity checks. */
765  __ast_assert_failed(0, "invalid container v_table", file, line, func);
766  return NULL;
767  }
768 
769  clone = orig->v_table->alloc_empty_clone(orig, tag, file, line, func);
770  if (!clone) {
771  return NULL;
772  }
773 
774  /* This test is correct. clone must be locked before calling
775  * ao2_container_dup when the OBJ_NOLOCK flag is set, otherwise
776  * we could have errors in __adjust_lock. */
777  if (flags & OBJ_NOLOCK) {
778  ao2_wrlock(clone);
779  }
780  failed = ao2_container_dup(clone, orig, flags);
781  if (flags & OBJ_NOLOCK) {
782  ao2_unlock(clone);
783  }
784  if (failed) {
785  /* Object copy into the clone container failed. */
786  __ao2_ref(clone, -1, tag ?: "Clone creation failed", file, line, func);
787  clone = NULL;
788  }
789  return clone;
790 }
#define __is_ao2_object(user_data, file, line, func)
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
#define NULL
Definition: resample.c:96
#define ao2_wrlock(a)
Definition: astobj2.h:720
int __ao2_ref(void *o, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498
const struct ao2_container_methods * v_table
void DO_CRASH_NORETURN __ast_assert_failed(int condition, const char *condition_str, const char *file, int line, const char *function)
Definition: main/utils.c:2564
Generic container type.
ao2_container_alloc_empty_clone_fn alloc_empty_clone
Create an empty copy of this container.
int ao2_container_dup(struct ao2_container *dest, struct ao2_container *src, enum search_flags flags)
Copy all object references in the src container into the dest container.

◆ __ao2_find()

void* __ao2_find ( struct ao2_container c,
const void *  arg,
enum search_flags  flags,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

the find function just invokes the default callback with some reasonable flags.

Definition at line 427 of file astobj2_container.c.

References __ao2_callback(), ast_assert, ao2_container::cmp_fn, and NULL.

Referenced by __ast_format_cache_get(), __find_call(), and _get_mohbyname().

429 {
430  void *arged = (void *) arg;/* Done to avoid compiler const warning */
431 
432  if (!c) {
433  /* Sanity checks. */
434  ast_assert(0);
435  return NULL;
436  }
437  return __ao2_callback(c, flags, c->cmp_fn, arged, tag, file, line, func);
438 }
void * __ao2_callback(struct ao2_container *c, enum search_flags flags, ao2_callback_fn *cb_fn, void *arg, const char *tag, const char *file, int line, const char *func)
#define ast_assert(a)
Definition: utils.h:695
#define NULL
Definition: resample.c:96
ao2_callback_fn * cmp_fn

◆ __ao2_get_weakproxy()

void* __ao2_get_weakproxy ( void *  obj,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Get the weakproxy attached to obj.

Since
14.0.0
Parameters
objThe object to retrieve a weakproxy from
Returns
The weakproxy object

Definition at line 914 of file astobj2.c.

References __ao2_ref(), __INTERNAL_OBJ_CHECK, AO2_MAGIC, __priv_data::magic, NULL, astobj2::priv_data, and __priv_data::weakptr.

915 {
916  struct astobj2 *obj_internal = __INTERNAL_OBJ_CHECK(obj, file, line, func);
917 
918  if (!obj_internal || obj_internal->priv_data.magic != AO2_MAGIC) {
919  /* This method is meant to be run on normal ao2 objects! */
920  return NULL;
921  }
922 
923  if (!obj_internal->priv_data.weakptr) {
924  return NULL;
925  }
926 
927  __ao2_ref(obj_internal->priv_data.weakptr, +1, tag, file, line, func);
928  return obj_internal->priv_data.weakptr;
929 }
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define NULL
Definition: resample.c:96
#define AO2_MAGIC
Definition: astobj2.c:96
int __ao2_ref(void *user_data, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498
void * weakptr
Definition: astobj2.c:57
struct __priv_data priv_data
Definition: astobj2.c:105
uint32_t magic
Definition: astobj2.c:93

◆ __ao2_global_obj_ref()

void* __ao2_global_obj_ref ( struct ao2_global_obj holder,
const char *  tag,
const char *  file,
int  line,
const char *  func,
const char *  name 
)

Definition at line 72 of file astobj2_global.c.

References __ao2_ref(), __ast_rwlock_rdlock(), __ast_rwlock_unlock(), ast_assert, ast_log, ao2_global_obj::lock, LOG_ERROR, NULL, and ao2_global_obj::obj.

73 {
74  void *obj;
75 
76  if (!holder) {
77  /* For sanity */
78  ast_log(LOG_ERROR, "Must be called with a global object!\n");
79  ast_assert(0);
80  return NULL;
81  }
82 
83  if (__ast_rwlock_rdlock(file, line, func, &holder->lock, name)) {
84  /* Could not get the read lock. */
85  ast_assert(0);
86  return NULL;
87  }
88 
89  obj = holder->obj;
90  if (obj) {
91  __ao2_ref(obj, +1, tag, file, line, func);
92  }
93 
94  __ast_rwlock_unlock(file, line, func, &holder->lock, name);
95 
96  return obj;
97 }
int __ast_rwlock_rdlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:819
#define ast_assert(a)
Definition: utils.h:695
#define NULL
Definition: resample.c:96
int __ast_rwlock_unlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:748
int __ao2_ref(void *o, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
void * obj
Definition: astobj2.h:808
static const char name[]
Definition: cdr_mysql.c:74
ast_rwlock_t lock
Definition: astobj2.h:806

◆ __ao2_global_obj_replace()

void* __ao2_global_obj_replace ( struct ao2_global_obj holder,
void *  obj,
const char *  tag,
const char *  file,
int  line,
const char *  func,
const char *  name 
)

Definition at line 33 of file astobj2_global.c.

References __ao2_ref(), __ast_rwlock_unlock(), __ast_rwlock_wrlock(), ast_assert, ast_log, ao2_global_obj::lock, LOG_ERROR, NULL, and ao2_global_obj::obj.

Referenced by __ao2_global_obj_replace_unref().

34 {
35  void *obj_old;
36 
37  if (!holder) {
38  /* For sanity */
39  ast_log(LOG_ERROR, "Must be called with a global object!\n");
40  ast_assert(0);
41  return NULL;
42  }
43  if (__ast_rwlock_wrlock(file, line, func, &holder->lock, name)) {
44  /* Could not get the write lock. */
45  ast_assert(0);
46  return NULL;
47  }
48 
49  if (obj) {
50  __ao2_ref(obj, +1, tag, file, line, func);
51  }
52  obj_old = holder->obj;
53  holder->obj = obj;
54 
55  __ast_rwlock_unlock(file, line, func, &holder->lock, name);
56 
57  return obj_old;
58 }
#define ast_assert(a)
Definition: utils.h:695
#define NULL
Definition: resample.c:96
int __ast_rwlock_unlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:748
int __ao2_ref(void *o, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
void * obj
Definition: astobj2.h:808
static const char name[]
Definition: cdr_mysql.c:74
ast_rwlock_t lock
Definition: astobj2.h:806
int __ast_rwlock_wrlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:917

◆ __ao2_global_obj_replace_unref()

int __ao2_global_obj_replace_unref ( struct ao2_global_obj holder,
void *  obj,
const char *  tag,
const char *  file,
int  line,
const char *  func,
const char *  name 
)

Definition at line 60 of file astobj2_global.c.

References __ao2_global_obj_replace(), and __ao2_ref().

61 {
62  void *obj_old;
63 
64  obj_old = __ao2_global_obj_replace(holder, obj, tag, file, line, func, name);
65  if (obj_old) {
66  __ao2_ref(obj_old, -1, tag, file, line, func);
67  return 1;
68  }
69  return 0;
70 }
int __ao2_ref(void *o, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498
static const char name[]
Definition: cdr_mysql.c:74
void * __ao2_global_obj_replace(struct ao2_global_obj *holder, void *obj, const char *tag, const char *file, int line, const char *func, const char *name)

◆ __ao2_iterator_next()

void* __ao2_iterator_next ( struct ao2_iterator iter,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 556 of file astobj2_container.c.

References __adjust_lock(), __ao2_ref(), __ast_assert_failed(), __container_unlink_node_debug(), __is_ao2_object, AO2_ITERATOR_DONTLOCK, AO2_ITERATOR_UNLINK, AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_RDLOCK, AO2_LOCK_REQ_WRLOCK, ao2_rdlock, ao2_ref, AO2_UNLINK_NODE_DEC_COUNT, ao2_unlock, ao2_wrlock, ao2_iterator::c, ao2_iterator::complete, ao2_iterator::flags, ao2_container_methods::iterator_next, ao2_iterator::last_node, NULL, ao2_container_node::obj, and ao2_container::v_table.

558 {
559  enum ao2_lock_req orig_lock;
560  struct ao2_container_node *node;
561  void *ret;
562 
563  if (!__is_ao2_object(iter->c, file, line, func)) {
564  return NULL;
565  }
566 
567  if (!iter->c->v_table || !iter->c->v_table->iterator_next) {
568  /* Sanity checks. */
569  __ast_assert_failed(0, "invalid iterator container v_table", file, line, func);
570  return NULL;
571  }
572 
573  if (iter->complete) {
574  /* Don't return any more objects. */
575  return NULL;
576  }
577 
578  if (iter->flags & AO2_ITERATOR_DONTLOCK) {
579  if (iter->flags & AO2_ITERATOR_UNLINK) {
580  orig_lock = __adjust_lock(iter->c, AO2_LOCK_REQ_WRLOCK, 1);
581  } else {
582  orig_lock = __adjust_lock(iter->c, AO2_LOCK_REQ_RDLOCK, 1);
583  }
584  } else {
585  orig_lock = AO2_LOCK_REQ_MUTEX;
586  if (iter->flags & AO2_ITERATOR_UNLINK) {
587  ao2_wrlock(iter->c);
588  } else {
589  ao2_rdlock(iter->c);
590  }
591  }
592 
593  node = iter->c->v_table->iterator_next(iter->c, iter->last_node, iter->flags);
594  if (node) {
595  ret = node->obj;
596 
597  if (iter->flags & AO2_ITERATOR_UNLINK) {
598  /* Transfer the object ref from the container to the returned object. */
600 
601  /* Transfer the container's node ref to the iterator. */
602  } else {
603  /* Bump ref of returned object */
604  __ao2_ref(ret, +1, tag ?: "Next iterator object.", file, line, func);
605 
606  /* Bump the container's node ref for the iterator. */
607  ao2_ref(node, +1);
608  }
609  } else {
610  /* The iteration has completed. */
611  iter->complete = 1;
612  ret = NULL;
613  }
614 
615  /* Replace the iterator's node */
616  if (iter->last_node) {
617  ao2_ref(iter->last_node, -1);
618  }
619  iter->last_node = node;
620 
621  if (iter->flags & AO2_ITERATOR_DONTLOCK) {
622  __adjust_lock(iter->c, orig_lock, 0);
623  } else {
624  ao2_unlock(iter->c);
625  }
626 
627  return ret;
628 }
Definition: test_heap.c:38
int __container_unlink_node_debug(struct ao2_container_node *node, uint32_t flags, const char *tag, const char *file, int line, const char *func)
void * last_node
Definition: astobj2.h:1845
#define __is_ao2_object(user_data, file, line, func)
ao2_lock_req
Which lock to request.
Definition: astobj2.h:701
#define ao2_unlock(a)
Definition: astobj2.h:730
#define NULL
Definition: resample.c:96
#define ao2_wrlock(a)
Definition: astobj2.h:720
int complete
Definition: astobj2.h:1847
struct ao2_container * c
Definition: astobj2.h:1843
Generic container node.
int __ao2_ref(void *o, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498
#define ao2_ref(o, delta)
Definition: astobj2.h:464
const struct ao2_container_methods * v_table
void DO_CRASH_NORETURN __ast_assert_failed(int condition, const char *condition_str, const char *file, int line, const char *function)
Definition: main/utils.c:2564
ao2_iterator_next_fn iterator_next
#define ao2_rdlock(a)
Definition: astobj2.h:719
Assume that the ao2_container is already locked.
Definition: astobj2.h:1872
enum ao2_lock_req __adjust_lock(void *user_data, enum ao2_lock_req lock_how, int keep_stronger)
Definition: astobj2.c:425

◆ __ao2_link()

int __ao2_link ( struct ao2_container c,
void *  obj_new,
int  flags,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 94 of file astobj2_container.c.

References __adjust_lock(), __ast_assert_failed(), __is_ao2_object, ao2_container_check(), AO2_CONTAINER_INSERT_NODE_INSERTED, AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED, AO2_CONTAINER_INSERT_NODE_REJECTED, AO2_DEVMODE_STAT, AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_WRLOCK, ao2_ref, ao2_unlock, ao2_wrlock, ast_atomic_fetchadd_int(), ast_log, ao2_container_node::is_linked, LOG_ERROR, and OBJ_NOLOCK.

Referenced by internal_ao2_traverse().

96 {
97  int res;
98  enum ao2_lock_req orig_lock;
99  struct ao2_container_node *node;
100 
101  if (!__is_ao2_object(obj_new, file, line, func)
102  || !__is_ao2_object(self, file, line, func)) {
103  return 0;
104  }
105 
106  if (!self->v_table || !self->v_table->new_node || !self->v_table->insert) {
107  /* Sanity checks. */
108  __ast_assert_failed(0, "invalid container v_table", file, line, func);
109  return 0;
110  }
111 
112  if (flags & OBJ_NOLOCK) {
113  orig_lock = __adjust_lock(self, AO2_LOCK_REQ_WRLOCK, 1);
114  } else {
115  ao2_wrlock(self);
116  orig_lock = AO2_LOCK_REQ_MUTEX;
117  }
118 
119  res = 0;
120  node = self->v_table->new_node(self, obj_new, tag, file, line, func);
121  if (node) {
122 #if defined(AO2_DEBUG)
123  if (ao2_container_check(self, OBJ_NOLOCK)) {
124  ast_log(LOG_ERROR, "Container integrity failed before insert.\n");
125  }
126 #endif /* defined(AO2_DEBUG) */
127 
128  /* Insert the new node. */
129  switch (self->v_table->insert(self, node)) {
131  node->is_linked = 1;
132  ast_atomic_fetchadd_int(&self->elements, 1);
133 #if defined(AO2_DEBUG)
134  AO2_DEVMODE_STAT(++self->nodes);
135  if (self->v_table->link_stat) {
136  self->v_table->link_stat(self, node);
137  }
138 #endif /* defined(AO2_DEBUG) */
139  /* Fall through */
141 #if defined(AO2_DEBUG)
142  if (ao2_container_check(self, OBJ_NOLOCK)) {
143  ast_log(LOG_ERROR, "Container integrity failed after insert or replace.\n");
144  }
145 #endif /* defined(AO2_DEBUG) */
146  res = 1;
147  break;
149  ao2_ref(node, -1);
150  break;
151  }
152  }
153 
154  if (flags & OBJ_NOLOCK) {
155  __adjust_lock(self, orig_lock, 0);
156  } else {
157  ao2_unlock(self);
158  }
159 
160  return res;
161 }
Definition: test_heap.c:38
#define __is_ao2_object(user_data, file, line, func)
ao2_lock_req
Which lock to request.
Definition: astobj2.h:701
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
int ao2_container_check(struct ao2_container *self, enum search_flags flags)
Perform an integrity check on the specified container.
#define ao2_wrlock(a)
Definition: astobj2.h:720
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:755
Generic container node.
#define ast_log
Definition: astobj2.c:42
#define ao2_ref(o, delta)
Definition: astobj2.h:464
#define AO2_DEVMODE_STAT(stat)
void DO_CRASH_NORETURN __ast_assert_failed(int condition, const char *condition_str, const char *file, int line, const char *function)
Definition: main/utils.c:2564
#define LOG_ERROR
Definition: logger.h:285
enum ao2_lock_req __adjust_lock(void *user_data, enum ao2_lock_req lock_how, int keep_stronger)
Definition: astobj2.c:425

◆ __ao2_lock()

int __ao2_lock ( void *  a,
enum ao2_lock_req  lock_how,
const char *  file,
const char *  func,
int  line,
const char *  var 
)

Lock an object.

Parameters
aA pointer to the object we want to lock.
lock_how,file,func,line,var
Returns
0 on success, other values on error.

Definition at line 222 of file astobj2.c.

References __ast_pthread_mutex_lock(), __ast_rwlock_rdlock(), __ast_rwlock_wrlock(), __INTERNAL_OBJ_CHECK, __LOG_ERROR, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_OBJ, AO2_ALLOC_OPT_LOCK_RWLOCK, AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_RDLOCK, AO2_LOCK_REQ_WRLOCK, ast_atomic_fetchadd_int(), ast_log, INTERNAL_OBJ_LOCKOBJ, INTERNAL_OBJ_MUTEX, INTERNAL_OBJ_RWLOCK, ao2_lock_priv::lock, ao2_rwlock_priv::lock, ao2_lockobj_priv::lock, astobj2_lockobj::lockobj, __priv_data::lockused, astobj2_lock::mutex, NULL, ao2_rwlock_priv::num_lockers, __priv_data::options, astobj2::priv_data, ref_log, and astobj2_rwlock::rwlock.

Referenced by _agent_lock(), _ast_bridge_channel_lock(), and _ast_bridge_lock().

223 {
224  struct astobj2 *obj = __INTERNAL_OBJ_CHECK(user_data, file, line, func);
225  struct astobj2_lock *obj_mutex;
226  struct astobj2_rwlock *obj_rwlock;
227  struct astobj2_lockobj *obj_lockobj;
228  int res = 0;
229 
230  if (obj == NULL) {
231  return -1;
232  }
233 
234  if (ref_log) {
235  obj->priv_data.lockused = 1;
236  }
237 
238  switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
240  obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
241  res = __ast_pthread_mutex_lock(file, line, func, var, &obj_mutex->mutex.lock);
242 #ifdef AO2_DEBUG
243  if (!res) {
244  ast_atomic_fetchadd_int(&ao2.total_locked, 1);
245  }
246 #endif
247  break;
249  obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
250  switch (lock_how) {
251  case AO2_LOCK_REQ_MUTEX:
252  case AO2_LOCK_REQ_WRLOCK:
253  res = __ast_rwlock_wrlock(file, line, func, &obj_rwlock->rwlock.lock, var);
254  if (!res) {
255  ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, -1);
256 #ifdef AO2_DEBUG
257  ast_atomic_fetchadd_int(&ao2.total_locked, 1);
258 #endif
259  }
260  break;
261  case AO2_LOCK_REQ_RDLOCK:
262  res = __ast_rwlock_rdlock(file, line, func, &obj_rwlock->rwlock.lock, var);
263  if (!res) {
264  ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, +1);
265 #ifdef AO2_DEBUG
266  ast_atomic_fetchadd_int(&ao2.total_locked, 1);
267 #endif
268  }
269  break;
270  }
271  break;
273  /* The ao2 object has no lock. */
274  break;
276  obj_lockobj = INTERNAL_OBJ_LOCKOBJ(user_data);
277  res = __ao2_lock(obj_lockobj->lockobj.lock, lock_how, file, func, line, var);
278  break;
279  default:
280  ast_log(__LOG_ERROR, file, line, func, "Invalid lock option on ao2 object %p\n",
281  user_data);
282  return -1;
283  }
284 
285  return res;
286 }
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
int __ao2_lock(void *user_data, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var)
Lock an object.
Definition: astobj2.c:222
struct ao2_lock_priv mutex
Definition: astobj2.c:121
#define var
Definition: ast_expr2f.c:614
int __ast_rwlock_rdlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:819
#define __LOG_ERROR
Definition: logger.h:284
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define NULL
Definition: resample.c:96
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:755
ast_rwlock_t lock
Definition: astobj2.c:127
#define INTERNAL_OBJ_LOCKOBJ(user_data)
Definition: astobj2.c:160
struct ao2_rwlock_priv rwlock
Definition: astobj2.c:134
ast_mutex_t lock
Definition: astobj2.c:116
#define ast_log
Definition: astobj2.c:42
uint32_t lockused
Set to 1 when the lock is used if refdebug is enabled.
Definition: astobj2.c:77
void * user_data[0]
Definition: astobj2.c:147
#define INTERNAL_OBJ_RWLOCK(user_data)
Definition: astobj2.c:157
#define INTERNAL_OBJ_MUTEX(user_data)
Definition: astobj2.c:154
int __ast_rwlock_wrlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:917
void * user_data[0]
Definition: astobj2.c:106
int __ast_pthread_mutex_lock(const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t)
Definition: lock.c:253
struct __priv_data priv_data
Definition: astobj2.c:105
static FILE * ref_log
Definition: astobj2.c:44
struct ao2_lockobj_priv lockobj
Definition: astobj2.c:145

◆ __ao2_ref()

int __ao2_ref ( void *  o,
int  delta,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 498 of file astobj2.c.

References __ast_assert_failed(), __INTERNAL_OBJ_CHECK, __LOG_ERROR, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_OBJ, AO2_ALLOC_OPT_LOCK_RWLOCK, AO2_ALLOC_OPT_NO_REF_DEBUG, ao2_lock, AO2_MAGIC, ao2_ref, ao2_t_ref, ao2_unlock, ast_assert, ast_atomic_fetch_add, ast_atomic_fetchadd_int(), ast_free, ast_get_tid(), AST_LIST_HEAD_INIT_NOLOCK, AST_LIST_REMOVE_HEAD, ast_log, ast_mutex_destroy, ast_rwlock_destroy, ao2_weakproxy_notification::cb, ao2_weakproxy_notification::data, ao2_weakproxy::destroyed_cb, __priv_data::destructor_fn, EXCESSIVE_REF_COUNT, INTERNAL_OBJ_CHECK, INTERNAL_OBJ_LOCKOBJ, INTERNAL_OBJ_MUTEX, INTERNAL_OBJ_RWLOCK, ao2_weakproxy_notification::list, ao2_lock_priv::lock, ao2_rwlock_priv::lock, ao2_lockobj_priv::lock, astobj2_lockobj::lockobj, __priv_data::lockused, __priv_data::magic, astobj2_lock::mutex, NULL, __priv_data::options, astobj2::priv_data, __priv_data::ref_counter, ref_log, astobj2_rwlock::rwlock, and __priv_data::weakptr.

Referenced by __ao2_cleanup_debug(), __ao2_container_clone(), __ao2_get_weakproxy(), __ao2_global_obj_ref(), __ao2_global_obj_replace(), __ao2_global_obj_replace_unref(), __ao2_iterator_next(), __ao2_weakproxy_get_object(), __ao2_weakproxy_ref_object(), __ao2_weakproxy_set_object(), __ast_format_cap_append(), __ast_module_ref(), __ast_module_unref(), __container_unlink_node_debug(), __find_call(), _mohclass_unref(), hash_ao2_new_node(), internal_ao2_traverse(), and rb_ao2_new_node().

500 {
501  struct astobj2 *obj = __INTERNAL_OBJ_CHECK(user_data, file, line, func);
502  struct astobj2_lock *obj_mutex;
503  struct astobj2_rwlock *obj_rwlock;
504  struct astobj2_lockobj *obj_lockobj;
505  int32_t current_value;
506  int32_t ret;
507  struct ao2_weakproxy *weakproxy = NULL;
508  const char *lock_state;
509 
510  if (obj == NULL) {
511  if (ref_log && user_data) {
512  fprintf(ref_log, "%p,%d,%d,%s,%d,%s,**invalid**,%s\n",
513  user_data, delta, ast_get_tid(), file, line, func, tag ?: "");
514  fflush(ref_log);
515  }
516  return -1;
517  }
518 
519  /* if delta is 0, just return the refcount */
520  if (delta == 0) {
521  return obj->priv_data.ref_counter;
522  }
523 
524  if (delta < 0 && obj->priv_data.magic == AO2_MAGIC && (weakproxy = obj->priv_data.weakptr)) {
525  ao2_lock(weakproxy);
526  }
527 
528  /* we modify with an atomic operation the reference counter */
529  ret = ast_atomic_fetch_add(&obj->priv_data.ref_counter, delta, __ATOMIC_RELAXED);
530  current_value = ret + delta;
531 
532 #ifdef AO2_DEBUG
533  ast_atomic_fetchadd_int(&ao2.total_refs, delta);
534 #endif
535 
536  if (weakproxy) {
537  struct ao2_weakproxy cbs;
538 
539  if (current_value == 1) {
540  /* The only remaining reference is the one owned by the weak object */
541  struct astobj2 *internal_weakproxy;
542 
543  internal_weakproxy = INTERNAL_OBJ_CHECK(weakproxy);
544 
545  /* Unlink the obj from the weak proxy */
546  internal_weakproxy->priv_data.weakptr = NULL;
547  obj->priv_data.weakptr = NULL;
548 
549  /* transfer list to local copy so callbacks are run with weakproxy unlocked. */
550  cbs.destroyed_cb = weakproxy->destroyed_cb;
552 
553  /* weak is already unlinked from obj so this won't recurse */
554  ao2_ref(user_data, -1);
555  }
556 
557  ao2_unlock(weakproxy);
558 
559  if (current_value == 1) {
560  struct ao2_weakproxy_notification *destroyed_cb;
561 
562  /* Notify the subscribers that weakproxy now points to NULL. */
563  while ((destroyed_cb = AST_LIST_REMOVE_HEAD(&cbs.destroyed_cb, list))) {
564  destroyed_cb->cb(weakproxy, destroyed_cb->data);
565  ast_free(destroyed_cb);
566  }
567 
568  ao2_ref(weakproxy, -1);
569  }
570  }
571 
572  if (0 < current_value) {
573  /* The object still lives. */
574 #define EXCESSIVE_REF_COUNT 100000
575 
576  if (EXCESSIVE_REF_COUNT <= current_value && ret < EXCESSIVE_REF_COUNT) {
577  char excessive_ref_buf[100];
578 
579  /* We just reached or went over the excessive ref count trigger */
580  snprintf(excessive_ref_buf, sizeof(excessive_ref_buf),
581  "Excessive refcount %d reached on ao2 object %p",
582  (int)current_value, user_data);
583  ast_log(__LOG_ERROR, file, line, func, "%s\n", excessive_ref_buf);
584 
585  __ast_assert_failed(0, excessive_ref_buf, file, line, func);
586  }
587 
589  fprintf(ref_log, "%p,%s%d,%d,%s,%d,%s,%d,%s\n", user_data,
590  (delta < 0 ? "" : "+"), delta, ast_get_tid(),
591  file, line, func, (int)ret, tag ?: "");
592  fflush(ref_log);
593  }
594  return ret;
595  }
596 
597  /* this case must never happen */
598  if (current_value < 0) {
599  ast_log(__LOG_ERROR, file, line, func,
600  "Invalid refcount %d on ao2 object %p\n", (int)current_value, user_data);
601  if (ref_log) {
602  /* Log to ref_log even if AO2_ALLOC_OPT_NO_REF_DEBUG */
603  fprintf(ref_log, "%p,%d,%d,%s,%d,%s,**invalid**,%s\n",
604  user_data, delta, ast_get_tid(), file, line, func, tag ?: "");
605  fflush(ref_log);
606  }
607  ast_assert(0);
608  /* stop here even if assert doesn't DO_CRASH */
609  return -1;
610  }
611 
612  /* last reference, destroy the object */
613  if (obj->priv_data.destructor_fn != NULL) {
614  obj->priv_data.destructor_fn(user_data);
615  }
616 
617 #ifdef AO2_DEBUG
618  ast_atomic_fetchadd_int(&ao2.total_mem, - obj->priv_data.data_size);
619  ast_atomic_fetchadd_int(&ao2.total_objects, -1);
620 #endif
621 
622  /* In case someone uses an object after it's been freed */
623  obj->priv_data.magic = 0;
624 
625  switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
627  obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
628  lock_state = obj->priv_data.lockused ? "used" : "unused";
629  ast_mutex_destroy(&obj_mutex->mutex.lock);
630 
631  ast_free(obj_mutex);
632  break;
634  obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
635  lock_state = obj->priv_data.lockused ? "used" : "unused";
636  ast_rwlock_destroy(&obj_rwlock->rwlock.lock);
637 
638  ast_free(obj_rwlock);
639  break;
641  lock_state = "none";
642  ast_free(obj);
643  break;
645  obj_lockobj = INTERNAL_OBJ_LOCKOBJ(user_data);
646  lock_state = obj->priv_data.lockused ? "used" : "unused";
647  ao2_t_ref(obj_lockobj->lockobj.lock, -1, "release lockobj");
648 
649  ast_free(obj_lockobj);
650  break;
651  default:
652  ast_log(__LOG_ERROR, file, line, func,
653  "Invalid lock option on ao2 object %p\n", user_data);
654  lock_state = "invalid";
655  break;
656  }
657 
659  fprintf(ref_log, "%p,%d,%d,%s,%d,%s,**destructor**lock-state:%s**,%s\n",
660  user_data, delta, ast_get_tid(), file, line, func, lock_state, tag ?: "");
661  fflush(ref_log);
662  }
663 
664  return ret;
665 }
#define ao2_t_ref(o, delta, tag)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:463
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
struct ao2_lock_priv mutex
Definition: astobj2.c:121
#define ast_rwlock_destroy(rwlock)
Definition: lock.h:231
#define ast_atomic_fetch_add(ptr, val, memorder)
Support for atomic instructions.
Definition: lock.h:667
#define ast_assert(a)
Definition: utils.h:695
#define ao2_unlock(a)
Definition: astobj2.h:730
#define __LOG_ERROR
Definition: logger.h:284
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define NULL
Definition: resample.c:96
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:755
ast_rwlock_t lock
Definition: astobj2.c:127
#define EXCESSIVE_REF_COUNT
#define AO2_MAGIC
Definition: astobj2.c:96
#define INTERNAL_OBJ_LOCKOBJ(user_data)
Definition: astobj2.c:160
struct ao2_rwlock_priv rwlock
Definition: astobj2.c:134
ast_mutex_t lock
Definition: astobj2.c:116
#define ast_log
Definition: astobj2.c:42
#define INTERNAL_OBJ_CHECK(user_data)
Definition: astobj2.c:183
int ast_get_tid(void)
Get current thread ID.
Definition: main/utils.c:2504
#define ao2_ref(o, delta)
Definition: astobj2.h:464
ao2_destructor_fn destructor_fn
Definition: astobj2.c:55
#define ao2_lock(a)
Definition: astobj2.h:718
uint32_t lockused
Set to 1 when the lock is used if refdebug is enabled.
Definition: astobj2.c:77
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
Definition: linkedlists.h:832
void DO_CRASH_NORETURN __ast_assert_failed(int condition, const char *condition_str, const char *file, int line, const char *function)
Definition: main/utils.c:2564
struct ao2_weakproxy::@224 destroyed_cb
struct ao2_weakproxy_notification::@339 list
void * weakptr
Definition: astobj2.c:57
#define INTERNAL_OBJ_RWLOCK(user_data)
Definition: astobj2.c:157
#define INTERNAL_OBJ_MUTEX(user_data)
Definition: astobj2.c:154
#define ast_free(a)
Definition: astmm.h:182
#define AST_LIST_HEAD_INIT_NOLOCK(head)
Initializes a list head structure.
Definition: linkedlists.h:680
void * user_data[0]
Definition: astobj2.c:106
This struct should be opaque, but it&#39;s size is needed.
Definition: astobj2.h:530
int32_t ref_counter
Definition: astobj2.c:63
struct __priv_data priv_data
Definition: astobj2.c:105
ao2_weakproxy_notification_cb cb
Definition: astobj2.c:110
int int32_t
Definition: db.h:60
#define ast_mutex_destroy(a)
Definition: lock.h:186
static FILE * ref_log
Definition: astobj2.c:44
struct ao2_lockobj_priv lockobj
Definition: astobj2.c:145
uint32_t magic
Definition: astobj2.c:93

◆ __ao2_trylock()

int __ao2_trylock ( void *  a,
enum ao2_lock_req  lock_how,
const char *  file,
const char *  func,
int  line,
const char *  var 
)

Try locking– (don't block if fail)

Parameters
aA pointer to the object we want to lock.
lock_how,file,func,line,var
Returns
0 on success, other values on error.

Definition at line 342 of file astobj2.c.

References __ast_pthread_mutex_trylock(), __ast_rwlock_tryrdlock(), __ast_rwlock_trywrlock(), __INTERNAL_OBJ_CHECK, __LOG_ERROR, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_OBJ, AO2_ALLOC_OPT_LOCK_RWLOCK, AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_RDLOCK, AO2_LOCK_REQ_WRLOCK, ast_atomic_fetchadd_int(), ast_log, INTERNAL_OBJ_LOCKOBJ, INTERNAL_OBJ_MUTEX, INTERNAL_OBJ_RWLOCK, ao2_lock_priv::lock, ao2_rwlock_priv::lock, ao2_lockobj_priv::lock, astobj2_lockobj::lockobj, __priv_data::lockused, astobj2_lock::mutex, NULL, ao2_rwlock_priv::num_lockers, __priv_data::options, astobj2::priv_data, ref_log, and astobj2_rwlock::rwlock.

Referenced by _ast_bridge_channel_trylock(), and _ast_bridge_trylock().

343 {
344  struct astobj2 *obj = __INTERNAL_OBJ_CHECK(user_data, file, line, func);
345  struct astobj2_lock *obj_mutex;
346  struct astobj2_rwlock *obj_rwlock;
347  struct astobj2_lockobj *obj_lockobj;
348  int res = 0;
349 
350  if (obj == NULL) {
351  return -1;
352  }
353 
354  if (ref_log) {
355  obj->priv_data.lockused = 1;
356  }
357 
358  switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
360  obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
361  res = __ast_pthread_mutex_trylock(file, line, func, var, &obj_mutex->mutex.lock);
362 #ifdef AO2_DEBUG
363  if (!res) {
364  ast_atomic_fetchadd_int(&ao2.total_locked, 1);
365  }
366 #endif
367  break;
369  obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
370  switch (lock_how) {
371  case AO2_LOCK_REQ_MUTEX:
372  case AO2_LOCK_REQ_WRLOCK:
373  res = __ast_rwlock_trywrlock(file, line, func, &obj_rwlock->rwlock.lock, var);
374  if (!res) {
375  ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, -1);
376 #ifdef AO2_DEBUG
377  ast_atomic_fetchadd_int(&ao2.total_locked, 1);
378 #endif
379  }
380  break;
381  case AO2_LOCK_REQ_RDLOCK:
382  res = __ast_rwlock_tryrdlock(file, line, func, &obj_rwlock->rwlock.lock, var);
383  if (!res) {
384  ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, +1);
385 #ifdef AO2_DEBUG
386  ast_atomic_fetchadd_int(&ao2.total_locked, 1);
387 #endif
388  }
389  break;
390  }
391  break;
393  /* The ao2 object has no lock. */
394  return 0;
396  obj_lockobj = INTERNAL_OBJ_LOCKOBJ(user_data);
397  res = __ao2_trylock(obj_lockobj->lockobj.lock, lock_how, file, func, line, var);
398  break;
399  default:
400  ast_log(__LOG_ERROR, file, line, func, "Invalid lock option on ao2 object %p\n",
401  user_data);
402  return -1;
403  }
404 
405  return res;
406 }
int __ao2_trylock(void *user_data, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var)
Try locking– (don&#39;t block if fail)
Definition: astobj2.c:342
int __ast_rwlock_trywrlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:1228
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
struct ao2_lock_priv mutex
Definition: astobj2.c:121
#define var
Definition: ast_expr2f.c:614
#define __LOG_ERROR
Definition: logger.h:284
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define NULL
Definition: resample.c:96
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:755
ast_rwlock_t lock
Definition: astobj2.c:127
#define INTERNAL_OBJ_LOCKOBJ(user_data)
Definition: astobj2.c:160
struct ao2_rwlock_priv rwlock
Definition: astobj2.c:134
ast_mutex_t lock
Definition: astobj2.c:116
#define ast_log
Definition: astobj2.c:42
uint32_t lockused
Set to 1 when the lock is used if refdebug is enabled.
Definition: astobj2.c:77
void * user_data[0]
Definition: astobj2.c:147
#define INTERNAL_OBJ_RWLOCK(user_data)
Definition: astobj2.c:157
#define INTERNAL_OBJ_MUTEX(user_data)
Definition: astobj2.c:154
void * user_data[0]
Definition: astobj2.c:106
struct __priv_data priv_data
Definition: astobj2.c:105
int __ast_pthread_mutex_trylock(const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t)
Definition: lock.c:366
static FILE * ref_log
Definition: astobj2.c:44
int __ast_rwlock_tryrdlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:1178
struct ao2_lockobj_priv lockobj
Definition: astobj2.c:145

◆ __ao2_unlink()

void* __ao2_unlink ( struct ao2_container c,
void *  obj,
int  flags,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 175 of file astobj2_container.c.

References __ao2_callback(), __is_ao2_object, ao2_match_by_addr(), NULL, OBJ_NODATA, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_UNLINK.

177 {
178  if (!__is_ao2_object(user_data, file, line, func)) {
179  /* Sanity checks. */
180  return NULL;
181  }
182 
183  flags &= ~OBJ_SEARCH_MASK;
184  flags |= (OBJ_UNLINK | OBJ_SEARCH_OBJECT | OBJ_NODATA);
185  __ao2_callback(c, flags, ao2_match_by_addr, user_data, tag, file, line, func);
186 
187  return NULL;
188 }
#define __is_ao2_object(user_data, file, line, func)
void * __ao2_callback(struct ao2_container *c, enum search_flags flags, ao2_callback_fn *cb_fn, void *arg, const char *tag, const char *file, int line, const char *func)
#define NULL
Definition: resample.c:96
int ao2_match_by_addr(void *user_data, void *arg, int flags)
another convenience function is a callback that matches on address
void * user_data[0]
Definition: astobj2.c:147
The arg parameter is an object of the same type.
Definition: astobj2.h:1091
Search option field mask.
Definition: astobj2.h:1076

◆ __ao2_unlock()

int __ao2_unlock ( void *  a,
const char *  file,
const char *  func,
int  line,
const char *  var 
)

Unlock an object.

Parameters
aA pointer to the object we want unlock.
file,func,line,var
Returns
0 on success, other values on error.

Definition at line 288 of file astobj2.c.

References __ast_pthread_mutex_unlock(), __ast_rwlock_unlock(), __INTERNAL_OBJ_CHECK, __LOG_ERROR, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_OBJ, AO2_ALLOC_OPT_LOCK_RWLOCK, ast_atomic_fetchadd_int(), ast_log, INTERNAL_OBJ_LOCKOBJ, INTERNAL_OBJ_MUTEX, INTERNAL_OBJ_RWLOCK, ao2_lock_priv::lock, ao2_rwlock_priv::lock, ao2_lockobj_priv::lock, astobj2_lockobj::lockobj, astobj2_lock::mutex, NULL, ao2_rwlock_priv::num_lockers, __priv_data::options, astobj2::priv_data, and astobj2_rwlock::rwlock.

Referenced by _agent_unlock(), _ast_bridge_channel_unlock(), and _ast_bridge_unlock().

289 {
290  struct astobj2 *obj = __INTERNAL_OBJ_CHECK(user_data, file, line, func);
291  struct astobj2_lock *obj_mutex;
292  struct astobj2_rwlock *obj_rwlock;
293  struct astobj2_lockobj *obj_lockobj;
294  int res = 0;
295  int current_value;
296 
297  if (obj == NULL) {
298  return -1;
299  }
300 
301  switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
303  obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
304  res = __ast_pthread_mutex_unlock(file, line, func, var, &obj_mutex->mutex.lock);
305 #ifdef AO2_DEBUG
306  if (!res) {
307  ast_atomic_fetchadd_int(&ao2.total_locked, -1);
308  }
309 #endif
310  break;
312  obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
313 
314  current_value = ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, -1) - 1;
315  if (current_value < 0) {
316  /* It was a WRLOCK that we are unlocking. Fix the count. */
317  ast_atomic_fetchadd_int(&obj_rwlock->rwlock.num_lockers, -current_value);
318  }
319  res = __ast_rwlock_unlock(file, line, func, &obj_rwlock->rwlock.lock, var);
320 #ifdef AO2_DEBUG
321  if (!res) {
322  ast_atomic_fetchadd_int(&ao2.total_locked, -1);
323  }
324 #endif
325  break;
327  /* The ao2 object has no lock. */
328  break;
330  obj_lockobj = INTERNAL_OBJ_LOCKOBJ(user_data);
331  res = __ao2_unlock(obj_lockobj->lockobj.lock, file, func, line, var);
332  break;
333  default:
334  ast_log(__LOG_ERROR, file, line, func, "Invalid lock option on ao2 object %p\n",
335  user_data);
336  res = -1;
337  break;
338  }
339  return res;
340 }
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
struct ao2_lock_priv mutex
Definition: astobj2.c:121
#define var
Definition: ast_expr2f.c:614
#define __LOG_ERROR
Definition: logger.h:284
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define NULL
Definition: resample.c:96
int __ast_rwlock_unlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Definition: lock.c:748
int __ao2_unlock(void *user_data, const char *file, const char *func, int line, const char *var)
Unlock an object.
Definition: astobj2.c:288
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:755
ast_rwlock_t lock
Definition: astobj2.c:127
#define INTERNAL_OBJ_LOCKOBJ(user_data)
Definition: astobj2.c:160
struct ao2_rwlock_priv rwlock
Definition: astobj2.c:134
ast_mutex_t lock
Definition: astobj2.c:116
#define ast_log
Definition: astobj2.c:42
int __ast_pthread_mutex_unlock(const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t)
Definition: lock.c:421
void * user_data[0]
Definition: astobj2.c:147
#define INTERNAL_OBJ_RWLOCK(user_data)
Definition: astobj2.c:157
#define INTERNAL_OBJ_MUTEX(user_data)
Definition: astobj2.c:154
void * user_data[0]
Definition: astobj2.c:106
struct __priv_data priv_data
Definition: astobj2.c:105
struct ao2_lockobj_priv lockobj
Definition: astobj2.c:145

◆ __ao2_weakproxy_alloc()

void* __ao2_weakproxy_alloc ( size_t  data_size,
ao2_destructor_fn  destructor_fn,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Allocate an ao2_weakproxy object.

Since
14.0.0
Parameters
data_sizeThe sizeof() of the user-defined structure.
destructor_fnThe destructor function (can be NULL)
Note
"struct ao2_weakproxy" must be the first field of any object. This can be done by using AO2_WEAKPROXY to declare your structure.

Definition at line 790 of file astobj2.c.

References __ao2_alloc(), AO2_ALLOC_OPT_LOCK_MUTEX, AO2_WEAK, ast_assert, ast_log, INTERNAL_OBJ, LOG_ERROR, __priv_data::magic, NULL, and astobj2::priv_data.

792 {
793  struct ao2_weakproxy *weakproxy;
794 
795  if (data_size < sizeof(*weakproxy)) {
796  ast_assert(0);
797  ast_log(LOG_ERROR, "Requested data_size smaller than minimum.\n");
798  return NULL;
799  }
800 
801  weakproxy = __ao2_alloc(data_size, destructor_fn, AO2_ALLOC_OPT_LOCK_MUTEX,
802  tag, file, line, func);
803 
804  if (weakproxy) {
805  struct astobj2 *weakproxy_internal;
806 
807  /* Just created weakproxy, no need to check if it's valid. */
808  weakproxy_internal = INTERNAL_OBJ(weakproxy);
809  weakproxy_internal->priv_data.magic = AO2_WEAK;
810  }
811 
812  return weakproxy;
813 }
#define ast_assert(a)
Definition: utils.h:695
#define AO2_WEAK
Definition: astobj2.c:97
#define NULL
Definition: resample.c:96
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
#define INTERNAL_OBJ(user_data)
Definition: astobj2.c:163
void * __ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:765
This struct should be opaque, but it&#39;s size is needed.
Definition: astobj2.h:530
struct __priv_data priv_data
Definition: astobj2.c:105
uint32_t magic
Definition: astobj2.c:93

◆ __ao2_weakproxy_find()

void* __ao2_weakproxy_find ( struct ao2_container c,
const void *  arg,
enum search_flags  flags,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Definition at line 440 of file astobj2_container.c.

References __adjust_lock(), __ao2_weakproxy_get_object(), ao2_find, AO2_LOCK_REQ_RDLOCK, AO2_LOCK_REQ_WRLOCK, ao2_rdlock, ao2_ref, ao2_unlink_flags, ao2_unlock, ast_assert, NULL, OBJ_NOLOCK, and OBJ_SEARCH_MASK.

Referenced by __ast_named_lock_get(), and __ast_sorcery_open().

442 {
443  void *proxy;
444  void *obj = NULL;
445  enum ao2_lock_req orig_lock;
446 
447  ast_assert(!!c);
448  ast_assert(flags & OBJ_SEARCH_MASK);
449  ast_assert(!(flags & ~(OBJ_SEARCH_MASK | OBJ_NOLOCK)));
450 
451  if (flags & OBJ_NOLOCK) {
452  orig_lock = __adjust_lock(c, AO2_LOCK_REQ_RDLOCK, 1);
453  } else {
454  orig_lock = AO2_LOCK_REQ_RDLOCK;
455  ao2_rdlock(c);
456  }
457 
458  while ((proxy = ao2_find(c, arg, flags | OBJ_NOLOCK))) {
459  obj = __ao2_weakproxy_get_object(proxy, 0, tag ?: __PRETTY_FUNCTION__, file, line, func);
460 
461  if (obj) {
462  ao2_ref(proxy, -1);
463  break;
464  }
465 
466  /* Upgrade to a write lock */
468  ao2_unlink_flags(c, proxy, OBJ_NOLOCK);
469  ao2_ref(proxy, -1);
470  }
471 
472  if (flags & OBJ_NOLOCK) {
473  /* We'll keep any upgraded lock */
474  __adjust_lock(c, orig_lock, 1);
475  } else {
476  ao2_unlock(c);
477  }
478 
479  return obj;
480 }
ao2_lock_req
Which lock to request.
Definition: astobj2.h:701
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ast_assert(a)
Definition: utils.h:695
#define ao2_unlock(a)
Definition: astobj2.h:730
#define NULL
Definition: resample.c:96
#define ao2_ref(o, delta)
Definition: astobj2.h:464
void * __ao2_weakproxy_get_object(void *weakproxy, int flags, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result
Get the object associated with weakproxy.
Definition: astobj2.c:886
#define ao2_rdlock(a)
Definition: astobj2.h:719
#define ao2_find(container, arg, flags)
Definition: astobj2.h:1756
enum ao2_lock_req __adjust_lock(void *user_data, enum ao2_lock_req lock_how, int keep_stronger)
Definition: astobj2.c:425
#define ao2_unlink_flags(container, obj, flags)
Definition: astobj2.h:1622
Search option field mask.
Definition: astobj2.h:1076

◆ __ao2_weakproxy_get_object()

void* __ao2_weakproxy_get_object ( void *  weakproxy,
int  flags,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Get the object associated with weakproxy.

Since
14.0.0
Parameters
weakproxyThe weakproxy to read from.
flagsOBJ_NOLOCK to avoid locking weakproxy.
Returns
A reference to the object previously set by ao2_weakproxy_set_object.
Return values
NULLEither no object was set or the previously set object has been freed.

Definition at line 886 of file astobj2.c.

References __ao2_ref(), __INTERNAL_OBJ_CHECK, ao2_lock, ao2_unlock, AO2_WEAK, NULL, and OBJ_NOLOCK.

Referenced by __ao2_weakproxy_find().

888 {
889  struct astobj2 *internal = __INTERNAL_OBJ_CHECK(weakproxy, file, line, func);
890  void *obj;
891 
892  if (!internal || internal->priv_data.magic != AO2_WEAK) {
893  /* This method is meant to be run on weakproxy objects! */
894  return NULL;
895  }
896 
897  /* We have a weak object, grab reference to object within lock */
898  if (!(flags & OBJ_NOLOCK)) {
899  ao2_lock(weakproxy);
900  }
901 
902  obj = internal->priv_data.weakptr;
903  if (obj) {
904  __ao2_ref(obj, +1, tag, file, line, func);
905  }
906 
907  if (!(flags & OBJ_NOLOCK)) {
908  ao2_unlock(weakproxy);
909  }
910 
911  return obj;
912 }
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define AO2_WEAK
Definition: astobj2.c:97
#define NULL
Definition: resample.c:96
#define ao2_lock(a)
Definition: astobj2.h:718
int __ao2_ref(void *user_data, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498

◆ __ao2_weakproxy_ref_object()

int __ao2_weakproxy_ref_object ( void *  weakproxy,
int  delta,
int  flags,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Run ao2_t_ref on the object associated with weakproxy.

Since
14.0.0
Parameters
weakproxyThe weakproxy to read from.
deltaValue to add to the reference counter.
flagsOBJ_NOLOCK to avoid locking weakproxy.
Return values
-2weakproxy is not a valid ao2_weakproxy.
-1weakproxy has no associated object.
Returns
The value of the reference counter before the operation.

Definition at line 859 of file astobj2.c.

References __ao2_ref(), __INTERNAL_OBJ_CHECK, ao2_lock, ao2_unlock, AO2_WEAK, and OBJ_NOLOCK.

861 {
862  struct astobj2 *internal = __INTERNAL_OBJ_CHECK(weakproxy, file, line, func);
863  int ret = -1;
864 
865  if (!internal || internal->priv_data.magic != AO2_WEAK) {
866  /* This method is meant to be run on weakproxy objects! */
867  return -2;
868  }
869 
870  /* We have a weak object, grab lock. */
871  if (!(flags & OBJ_NOLOCK)) {
872  ao2_lock(weakproxy);
873  }
874 
875  if (internal->priv_data.weakptr) {
876  ret = __ao2_ref(internal->priv_data.weakptr, delta, tag, file, line, func);
877  }
878 
879  if (!(flags & OBJ_NOLOCK)) {
880  ao2_unlock(weakproxy);
881  }
882 
883  return ret;
884 }
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define AO2_WEAK
Definition: astobj2.c:97
#define ao2_lock(a)
Definition: astobj2.h:718
int __ao2_ref(void *user_data, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498

◆ __ao2_weakproxy_set_object()

int __ao2_weakproxy_set_object ( void *  weakproxy,
void *  obj,
int  flags,
const char *  tag,
const char *  file,
int  line,
const char *  func 
)

Associate weakproxy with obj.

Since
14.0.0
Parameters
weakproxyAn object created by ao2_weakproxy_alloc.
objAn ao2 object not created by ao2_weakproxy_alloc.
flagsOBJ_NOLOCK to avoid locking weakproxy.
Return values
0Success
-1Failure
Note
obj must be newly created, this procedure is not thread safe if any other code can reach obj before this procedure ends.
weakproxy may be previously existing, but must not currently have an object set.
The only way to unset an object is for it to be destroyed. Any call to this function while an object is already set will fail.

Definition at line 815 of file astobj2.c.

References __ao2_ref(), __INTERNAL_OBJ_CHECK, ao2_lock, AO2_MAGIC, ao2_unlock, AO2_WEAK, __priv_data::magic, OBJ_NOLOCK, astobj2::priv_data, and __priv_data::weakptr.

817 {
818  struct astobj2 *weakproxy_internal = __INTERNAL_OBJ_CHECK(weakproxy, file, line, func);
819  struct astobj2 *obj_internal = __INTERNAL_OBJ_CHECK(obj, file, line, func);
820  int ret = -1;
821 
822  if (!weakproxy_internal
823  || weakproxy_internal->priv_data.magic != AO2_WEAK) {
824  return -1;
825  }
826 
827  if (!obj_internal
828  || obj_internal->priv_data.weakptr
829  || obj_internal->priv_data.magic != AO2_MAGIC) {
830  return -1;
831  }
832 
833  if (!(flags & OBJ_NOLOCK)) {
834  ao2_lock(weakproxy);
835  }
836 
837  if (!weakproxy_internal->priv_data.weakptr) {
838  __ao2_ref(obj, +1, tag, file, line, func);
839  __ao2_ref(weakproxy, +1, tag, file, line, func);
840 
841  weakproxy_internal->priv_data.weakptr = obj;
842  obj_internal->priv_data.weakptr = weakproxy;
843 
844  ret = 0;
845  }
846 
847  if (!(flags & OBJ_NOLOCK)) {
848  ao2_unlock(weakproxy);
849  /* It is possible for obj to be accessed now. It's allowed
850  * for weakproxy to already be in a container. Another thread
851  * could have been waiting for a lock on weakproxy to retrieve
852  * the object.
853  */
854  }
855 
856  return ret;
857 }
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
#define __INTERNAL_OBJ_CHECK(user_data, file, line, func)
convert from a pointer _p to a user-defined object
Definition: astobj2.c:171
#define AO2_WEAK
Definition: astobj2.c:97
#define AO2_MAGIC
Definition: astobj2.c:96
#define ao2_lock(a)
Definition: astobj2.h:718
int __ao2_ref(void *user_data, int delta, const char *tag, const char *file, int line, const char *func)
Definition: astobj2.c:498
void * weakptr
Definition: astobj2.c:57
struct __priv_data priv_data
Definition: astobj2.c:105
uint32_t magic
Definition: astobj2.c:93

◆ ao2_container_check()

int ao2_container_check ( struct ao2_container self,
enum search_flags  flags 
)

Perform an integrity check on the specified container.

Since
12.0.0
Parameters
selfContainer to check integrity.
flagsOBJ_NOLOCK if a lock is already held on the container.
Return values
0on success.
-1on error.

Definition at line 856 of file astobj2_container.c.

References ao2_rdlock, ao2_t_ref, ao2_unlock, ast_assert, is_ao2_object, len(), name, OBJ_NOLOCK, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.

Referenced by __ao2_link(), ao2_container_unregister(), AST_TEST_DEFINE(), astobj2_test_1_helper(), hash_ao2_node_destructor(), insert_test_duplicates(), insert_test_vector(), rb_ao2_node_destructor(), and test_container_clone().

857 {
858  int res = 0;
859 
860  if (!is_ao2_object(self) || !self->v_table) {
861  /* Sanity checks. */
862  ast_assert(0);
863  return -1;
864  }
865 #if defined(AO2_DEBUG)
866  if (!self->v_table->integrity) {
867  /* No ingetrigy check available. Assume container is ok. */
868  return 0;
869  }
870 
871  if (!(flags & OBJ_NOLOCK)) {
872  ao2_rdlock(self);
873  }
874  res = self->v_table->integrity(self);
875  if (!(flags & OBJ_NOLOCK)) {
876  ao2_unlock(self);
877  }
878 #endif /* defined(AO2_DEBUG) */
879  return res;
880 }
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ast_assert(a)
Definition: utils.h:695
#define ao2_unlock(a)
Definition: astobj2.h:730
#define is_ao2_object(user_data)
const struct ao2_container_methods * v_table
#define ao2_rdlock(a)
Definition: astobj2.h:719

◆ ao2_container_count()

int ao2_container_count ( struct ao2_container c)

Returns the number of elements in a container.

return the number of elements in the container

Definition at line 34 of file astobj2_container.c.

References ast_atomic_fetchadd_int(), and ao2_container::elements.

Referenced by _sip_show_peers(), action_confbridgekick(), action_confbridgelist(), action_confbridgelistrooms(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_confbridgestoprecord(), action_lock_unlock_helper(), action_mute_unmute_helper(), ami_show_aors(), ami_show_auths(), ami_show_contacts(), ami_show_endpoints(), ami_show_resource_lists(), ao2_iterator_count(), ao2_weakproxy_unsubscribe(), app_is_finished(), ari_show(), ast_active_channels(), ast_ari_applications_list(), ast_bridge_transfer_attended(), ast_bridge_transfer_blind(), ast_cdr_generic_unregister(), ast_endpoint_snapshot_create(), ast_get_chan_applicationmap(), ast_get_namedgroups(), ast_merge_contexts_and_delete(), ast_namedgroups_intersect(), ast_rtp_ice_add_remote_candidate(), ast_rtp_ice_start(), ast_sip_cli_traverse_objects(), ast_sip_initialize_system(), ast_sip_location_retrieve_first_aor_contact_filtered(), ast_sorcery_create(), ast_sorcery_delete(), ast_sorcery_retrieve_by_fields(), ast_sorcery_retrieve_by_prefix(), ast_sorcery_retrieve_by_regex(), ast_sorcery_update(), ast_srtp_unprotect(), AST_TEST_DEFINE(), ast_tone_zone_count(), astobj2_test_1_helper(), auth_observer(), bridges_scrape_cb(), calc_metric(), cc_cli_output_status(), cel_pre_apply_config(), channels_scrape_cb(), check_events(), check_expiration_thread(), cleanup(), cleanup_module(), cli_display_parking_lot(), cli_fax_show_sessions(), cli_show_modules(), cli_show_tasks(), common_identify(), control_command_count(), control_wait(), cpg_confchg_cb(), create_sound_blob(), create_unsolicited_mwi_subscriptions(), device_state_cb(), dial_state_process_bridge_enter(), do_timing(), endelm(), endpoints_scrape_cb(), exten_state_pub_data_alloc(), format_ami_aor_handler(), get_device_state_causing_channels(), global_loaded_observer(), grow(), handle_cli_sound_show(), handle_feature_show(), handle_manager_show_events(), handle_registrations(), handle_show_hint(), handle_show_hints(), hash_ao2_destroy(), ice_candidates_compare(), insert_test_vector(), ip_identify_apply(), locals_show(), match_filter(), member_add_to_queue(), memory_cache_full_update(), memory_cache_populate(), mid_test_sync(), mwi_subscription_established(), native_bridge_is_capable(), native_rtp_bridge_compatible_check(), object_type_loaded_observer(), one_protocol(), parking_lot_remove_if_unused(), pjsip_acf_dial_contacts_read(), presence_state_cb(), print_queue(), process_config(), pthread_timer_open(), publisher_start(), queue_exec(), queue_function_mem_read(), queued_set_size(), queued_task_pushed(), rb_ao2_destroy(), register_aor_core(), send_unsolicited_mwi_notify(), shrink(), single_state_process_bridge_enter(), sip_options_apply_aor_configuration(), sip_options_contact_add_task(), sip_options_contact_delete_task(), sip_options_unused_endpoint_state_compositor(), sip_send_all_registers(), sip_show_objects(), sla_in_use(), smdi_load(), sorcery_memory_cache_create(), sorcery_memory_cache_dump(), sorcery_memory_cache_populate(), sorcery_memory_cache_retrieve_multiple(), sorcery_memory_cache_retrieve_prefix(), sorcery_memory_cache_retrieve_regex(), sorcery_memory_cache_show(), sorcery_object_load(), stale_cache_update(), stasis_app_set_global_debug(), stasis_app_to_cli(), statistics_show_subscription(), statistics_show_topic(), statistics_show_topics(), stir_shaken_certificate_show_all(), stir_shaken_general_get(), system_create_resolver_and_set_nameservers(), test_ao2_iteration(), test_cel_peer_strings_match(), test_container_clone(), test_sub(), threadpool_send_state_changed(), try_calling(), unload_module(), and xmpp_show_clients().

35 {
36  return ast_atomic_fetchadd_int(&c->elements, 0);
37 }
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:755

◆ ao2_container_dump()

void ao2_container_dump ( struct ao2_container self,
enum search_flags  flags,
const char *  name,
void *  where,
ao2_prnt_fn prnt,
ao2_prnt_obj_fn prnt_obj 
)

Display contents of the specified container.

Since
12.0.0
Parameters
selfContainer to dump.
flagsOBJ_NOLOCK if a lock is already held on the container.
nameContainer name. (NULL if anonymous)
whereUser data needed by prnt to determine where to put output.
prntPrint output callback function to use.
prnt_objCallback function to print the given object's key. (NULL if not available)
Returns
Nothing

Definition at line 792 of file astobj2_container.c.

References ao2_rdlock, ao2_unlock, ast_assert, is_ao2_object, and OBJ_NOLOCK.

Referenced by ao2_container_unregister(), astobj2_test_1_helper(), and test_traversal_sorted().

793 {
794  if (!is_ao2_object(self) || !self->v_table) {
795  prnt(where, "Invalid container\n");
796  ast_assert(0);
797  return;
798  }
799 
800  if (!(flags & OBJ_NOLOCK)) {
801  ao2_rdlock(self);
802  }
803  if (name) {
804  prnt(where, "Container name: %s\n", name);
805  }
806 #if defined(AO2_DEBUG)
807  if (self->v_table->dump) {
808  self->v_table->dump(self, where, prnt, prnt_obj);
809  } else
810 #endif /* defined(AO2_DEBUG) */
811  {
812  prnt(where, "Container dump not available.\n");
813  }
814  if (!(flags & OBJ_NOLOCK)) {
815  ao2_unlock(self);
816  }
817 }
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ast_assert(a)
Definition: utils.h:695
#define ao2_unlock(a)
Definition: astobj2.h:730
#define is_ao2_object(user_data)
const struct ao2_container_methods * v_table
#define ao2_rdlock(a)
Definition: astobj2.h:719
static const char name[]
Definition: cdr_mysql.c:74

◆ ao2_container_dup()

int ao2_container_dup ( struct ao2_container dest,
struct ao2_container src,
enum search_flags  flags 
)

Copy all object references in the src container into the dest container.

Since
11.0
Parameters
destContainer to copy src object references into.
srcContainer to copy all object references from.
flagsOBJ_NOLOCK if a lock is already held on both containers. Otherwise, the src container is locked first.
Precondition
The dest container must be empty. If the duplication fails, the dest container will be returned empty.
Note
This can potentially be expensive because a malloc is needed for every object in the src container.
Return values
0on success.
-1on error.

Definition at line 673 of file astobj2_container.c.

References ao2_callback, ao2_rdlock, ao2_t_ref, ao2_unlock, ao2_wrlock, dup_obj_cb(), NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_NOLOCK, and OBJ_UNLINK.

Referenced by __ao2_container_clone(), __queues_show(), cli_aor_get_container(), cli_endpoint_get_container(), cli_get_container(), cli_show_tasks(), cli_unid_get_container(), handle_cli_sounds_show(), sip_options_apply_aor_configuration(), stasis_show_topics(), statistics_show_subscriptions(), statistics_show_topics(), and tps_report_taskprocessor_list().

674 {
675  void *obj;
676  int res = 0;
677 
678  if (!(flags & OBJ_NOLOCK)) {
679  ao2_rdlock(src);
680  ao2_wrlock(dest);
681  }
682  obj = ao2_callback(src, OBJ_NOLOCK, dup_obj_cb, dest);
683  if (obj) {
684  /* Failed to put this obj into the dest container. */
685  ao2_t_ref(obj, -1, "Failed to put this object into the dest container.");
686 
687  /* Remove all items from the dest container. */
688  ao2_callback(dest, OBJ_NOLOCK | OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL,
689  NULL);
690  res = -1;
691  }
692  if (!(flags & OBJ_NOLOCK)) {
693  ao2_unlock(dest);
694  ao2_unlock(src);
695  }
696 
697  return res;
698 }
#define ao2_t_ref(o, delta, tag)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:463
#define ao2_callback(c, flags, cb_fn, arg)
Definition: astobj2.h:1716
static int dup_obj_cb(void *obj, void *arg, int flags)
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
#define NULL
Definition: resample.c:96
#define ao2_wrlock(a)
Definition: astobj2.h:720
#define ao2_rdlock(a)
Definition: astobj2.h:719

◆ ao2_container_dup_weakproxy_objs()

int ao2_container_dup_weakproxy_objs ( struct ao2_container dest,
struct ao2_container src,
enum search_flags  flags 
)

Copy object references associated with src container weakproxies into the dest container.

Parameters
destContainer to copy src strong object references into.
srcContainer to copy all weak object references from.
flagsOBJ_NOLOCK if a lock is already held on both containers. Otherwise, the src container is locked first.
Precondition
The dest container must be empty. If the duplication fails, the dest container will be returned empty.
Note
This can potentially be expensive because a malloc is needed for every object in the src container.
Every object inside the container is locked by ao2_weakproxy_get_object. Any weakproxy in src with no associated object is ignored.
Return values
0on success.
-1on error.

Definition at line 726 of file astobj2_container.c.

References ao2_callback, ao2_rdlock, ao2_t_ref, ao2_unlock, ao2_wrlock, dup_weakproxy_cb(), NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_NOLOCK, and OBJ_UNLINK.

Referenced by AST_TEST_DEFINE().

727 {
728  void *obj;
729  int res = 0;
730 
731  if (!(flags & OBJ_NOLOCK)) {
732  ao2_rdlock(src);
733  ao2_wrlock(dest);
734  }
735  obj = ao2_callback(src, OBJ_NOLOCK, dup_weakproxy_cb, dest);
736  if (obj) {
737  /* Failed to put this obj into the dest container. */
738  ao2_t_ref(obj, -1, "Failed to put this object into the dest container.");
739 
740  /* Remove all items from the dest container. */
741  ao2_callback(dest, OBJ_NOLOCK | OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL,
742  NULL);
743  res = -1;
744  }
745  if (!(flags & OBJ_NOLOCK)) {
746  ao2_unlock(dest);
747  ao2_unlock(src);
748  }
749 
750  return res;
751 }
#define ao2_t_ref(o, delta, tag)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:463
#define ao2_callback(c, flags, cb_fn, arg)
Definition: astobj2.h:1716
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
#define NULL
Definition: resample.c:96
#define ao2_wrlock(a)
Definition: astobj2.h:720
#define ao2_rdlock(a)
Definition: astobj2.h:719
static int dup_weakproxy_cb(void *proxy, void *arg, int flags)
Copy obj associated with a weakproxy into the arg container.

◆ ao2_container_register()

int ao2_container_register ( const char *  name,
struct ao2_container self,
ao2_prnt_obj_fn prnt_obj 
)

Register a container for CLI stats and integrity check.

Since
12.0.0
Parameters
nameName to register the container under.
selfContainer to register.
prnt_objCallback function to print the given object's key. (NULL if not available)
Return values
0on success.
-1on error.

Definition at line 958 of file astobj2_container.c.

References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_t_alloc_options, ao2_t_link, and ao2_t_ref.

Referenced by ast_bridging_init(), ast_channels_init(), ast_pbx_init(), load_module(), stasis_caching_topic_create(), stasis_state_manager_create(), and stasis_topic_pool_create().

959 {
960  int res = 0;
961 #if defined(AO2_DEBUG)
962  struct ao2_reg_container *reg;
963 
964  reg = ao2_t_alloc_options(sizeof(*reg) + strlen(name), ao2_reg_destructor,
965  AO2_ALLOC_OPT_LOCK_NOLOCK, "Container registration object.");
966  if (!reg) {
967  return -1;
968  }
969 
970  /* Fill in registered entry */
971  ao2_t_ref(self, +1, "Registering container.");
972  reg->registered = self;
973  reg->prnt_obj = prnt_obj;
974  strcpy(reg->name, name);/* safe */
975 
976  if (!ao2_t_link(reg_containers, reg, "Save registration object.")) {
977  res = -1;
978  }
979 
980  ao2_t_ref(reg, -1, "Done registering container.");
981 #endif /* defined(AO2_DEBUG) */
982  return res;
983 }
#define ao2_t_ref(o, delta, tag)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:463
#define ao2_t_link(container, obj, tag)
Add an object to a container.
Definition: astobj2.h:1547
#define ao2_t_alloc_options(data_size, destructor_fn, options, debug_msg)
Allocate and initialize an object.
Definition: astobj2.h:404
static const char name[]
Definition: cdr_mysql.c:74

◆ ao2_container_stats()

void ao2_container_stats ( struct ao2_container self,
enum search_flags  flags,
const char *  name,
void *  where,
ao2_prnt_fn prnt 
)

Display statistics of the specified container.

Since
12.0.0
Parameters
selfContainer to display statistics.
flagsOBJ_NOLOCK if a lock is already held on the container.
nameContainer name. (NULL if anonymous)
whereUser data needed by prnt to determine where to put output.
prntPrint output callback function to use.
Returns
Nothing

Definition at line 819 of file astobj2_container.c.

References ao2_rdlock, ao2_unlock, ast_assert, is_ao2_object, and OBJ_NOLOCK.

Referenced by ao2_container_unregister(), astobj2_test_1_helper(), and test_traversal_sorted().

820 {
821  if (!is_ao2_object(self) || !self->v_table) {
822  prnt(where, "Invalid container\n");
823  ast_assert(0);
824  return;
825  }
826 
827  if (!(flags & OBJ_NOLOCK)) {
828  ao2_rdlock(self);
829  }
830  if (name) {
831  prnt(where, "Container name: %s\n", name);
832  }
833  prnt(where, "Number of objects: %d\n", self->elements);
834 #if defined(AO2_DEBUG)
835  prnt(where, "Number of nodes: %d\n", self->nodes);
836  prnt(where, "Number of empty nodes: %d\n", self->nodes - self->elements);
837  /*
838  * XXX
839  * If the max_empty_nodes count gets out of single digits you
840  * likely have a code path where ao2_iterator_destroy() is not
841  * called.
842  *
843  * Empty nodes do not harm the container but they do make
844  * container operations less efficient.
845  */
846  prnt(where, "Maximum empty nodes: %d\n", self->max_empty_nodes);
847  if (self->v_table->stats) {
848  self->v_table->stats(self, where, prnt);
849  }
850 #endif /* defined(AO2_DEBUG) */
851  if (!(flags & OBJ_NOLOCK)) {
852  ao2_unlock(self);
853  }
854 }
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ast_assert(a)
Definition: utils.h:695
#define ao2_unlock(a)
Definition: astobj2.h:730
#define is_ao2_object(user_data)
const struct ao2_container_methods * v_table
#define ao2_rdlock(a)
Definition: astobj2.h:719
static const char name[]
Definition: cdr_mysql.c:74

◆ ao2_container_unregister()

void ao2_container_unregister ( const char *  name)

Unregister a container for CLI stats and integrity check.

Since
12.0.0
Parameters
nameName the container is registered under.
Returns
Nothing

Definition at line 985 of file astobj2_container.c.

References a, ao2_callback, ao2_container_check(), ao2_container_dump(), ao2_container_stats(), ao2_t_find, ao2_t_ref, ast_cli_args::argc, ast_cli_args::argv, ARRAY_LEN, ast_cli(), ast_cli_completion_add(), AST_CLI_DEFINE, ast_cli_unregister_multiple(), AST_DYNSTR_BUILD_FAILED, ast_str_buffer(), ast_str_set_va(), ast_str_thread_get(), ast_strdup, AST_THREADSTORAGE, buf, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, CMP_STOP, ast_cli_entry::command, ast_cli_args::fd, format, name, NULL, OBJ_NODATA, OBJ_SEARCH_KEY, OBJ_SEARCH_PARTIAL_KEY, OBJ_UNLINK, ast_cli_args::pos, ast_cli_entry::usage, and ast_cli_args::word.

Referenced by bridge_cleanup(), cdr_engine_shutdown(), channels_shutdown(), load_module(), pbx_shutdown(), stasis_caching_topic_dtor(), state_manager_dtor(), topic_pool_dtor(), and unload_module().

986 {
987 #if defined(AO2_DEBUG)
988  ao2_t_find(reg_containers, name, OBJ_UNLINK | OBJ_NODATA | OBJ_SEARCH_KEY,
989  "Unregister container");
990 #endif /* defined(AO2_DEBUG) */
991 }
The arg parameter is a search key, but is not an object.
Definition: astobj2.h:1105
static const char name[]
Definition: cdr_mysql.c:74
#define ao2_t_find(container, arg, flags, tag)
Definition: astobj2.h:1754

◆ ao2_iterator_cleanup()

void ao2_iterator_cleanup ( struct ao2_iterator iter)

Definition at line 549 of file astobj2_container.c.

References ao2_iterator_destroy().

Referenced by AST_TEST_DEFINE(), and stasis_app_set_global_debug().

550 {
551  if (iter) {
552  ao2_iterator_destroy(iter);
553  }
554 }
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.

◆ ao2_iterator_count()

int ao2_iterator_count ( struct ao2_iterator iter)

Get a count of the iterated container objects.

Parameters
iterthe iterator to query
Return values
Thenumber of objects in the iterated container

Definition at line 630 of file astobj2_container.c.

References ao2_container_count(), and ao2_iterator::c.

631 {
632  return ao2_container_count(iter->c);
633 }
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
struct ao2_container * c
Definition: astobj2.h:1843

◆ ao2_iterator_destroy()

void ao2_iterator_destroy ( struct ao2_iterator iter)

Destroy a container iterator.

Parameters
iterthe iterator to destroy
Return values
noneThis function will release the container reference held by the iterator and any other resources it may be holding.

Definition at line 534 of file astobj2_container.c.

References AO2_ITERATOR_MALLOCD, ao2_iterator_restart(), ao2_t_ref, ast_free, ao2_iterator::c, ao2_iterator::flags, and NULL.

Referenced by __find_call(), __iax2_show_peers(), __manager_event_sessions_va(), __queues_show(), __test_cel_generate_peer_str(), _sip_show_peers(), aco_set_defaults(), action_agents(), action_confbridgelistrooms(), action_coreshowchannels(), action_devicestatelist(), action_extensionstatelist(), action_meetmelist(), action_presencestatelist(), add_ice_to_sdp(), add_ice_to_stream(), agent_show_requested(), agents_post_apply_config(), agents_sweep(), alias_show(), ami_show_registration_contact_statuses(), ao2_iterator_cleanup(), ao2_weakproxy_unsubscribe(), app_to_json(), ari_show_apps(), ast_add_hint(), ast_ari_bridges_list(), ast_ari_channels_list(), ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), ast_ari_recordings_list_stored(), ast_bridge_channel_kick(), ast_bucket_file_json(), ast_bucket_json(), ast_cdr_setvar(), ast_channel_iterator_destroy(), ast_complete_channels(), ast_endpoint_snapshot_create(), ast_format_cache_get_by_codec(), ast_merge_contexts_and_delete(), ast_msg_var_iterator_destroy(), ast_multi_channel_blob_get_channels(), ast_pickup_find_by_group(), ast_print_namedgroups(), ast_rtp_ice_start(), ast_sip_destroy_scheduler(), ast_sip_for_each_contact(), ast_sorcery_objectset_create2(), ast_sorcery_objectset_json_create(), ast_srtp_unprotect(), AST_TEST_DEFINE(), ast_var_indications(), ast_var_indications_table(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), astobj2_test_1_helper(), auth_observer(), authenticate(), authenticate_reply(), bridge_app_subscribed_involved(), bridge_channel_event_join_leave(), bridge_channel_moving(), bridge_channel_talking(), bridges_scrape_cb(), build_cli_notify(), calendar_query_exec(), cel_generate_peer_str(), channels_scrape_cb(), check_access(), check_events(), clear_queue(), clear_stats(), cli_complete_endpoint(), cli_complete_notify(), cli_complete_registration(), cli_complete_show(), cli_complete_uri(), cli_console_active(), cli_display_named_acl_list(), cli_fax_show_sessions(), cli_list_devices(), cli_show_channels(), cli_show_modules(), cli_show_tasks(), cli_tps_reset_stats_all(), compare_weight(), complete_bridge_profile_name(), complete_confbridge_name(), complete_config_module(), complete_core_id(), complete_core_show_hint(), complete_country(), complete_iax2_peers(), complete_iax2_unregister(), complete_menu_name(), complete_mohclass_realtime(), complete_queue(), complete_queue_remove_member(), complete_show_sorcery_object(), complete_sip_peer(), complete_sip_registered_peer(), complete_sip_user(), complete_sipch(), complete_user_profile_name(), complete_userno(), conf_queue_dtmf(), config_hook_exec(), configure_parking_extensions(), container_to_json_array(), control_dispatch_all(), control_flush_queue(), control_prestart_dispatch_all(), destroy_pvts(), device_state_cb(), device_state_notify_callbacks(), dial_state_process_bridge_enter(), dialgroup_read(), disable_marked_lots(), dump_queue_members(), endpoints_scrape_cb(), event_session_shutdown(), exten_state_publisher_state_cb(), extension_state_cb(), fax_session_tab_complete(), find_queue_by_name_rt(), find_ringing_channel(), find_session(), find_session_by_nonce(), free_members(), generate_or_link_lots_to_configs(), get_device_state_causing_channels(), get_member_status(), get_transferee(), get_udp_transport(), get_write_timeout(), handle_bridge_pairings(), handle_bridge_show_all(), handle_chanlist(), handle_cli_confbridge_list(), handle_cli_confbridge_show_bridge_profiles(), handle_cli_confbridge_show_menus(), handle_cli_confbridge_show_user_profiles(), handle_cli_iax2_show_callno_limits(), handle_cli_iax2_show_users(), handle_cli_indication_show(), handle_cli_moh_show_classes(), handle_cli_moh_show_files(), handle_cli_moh_unregister_class(), handle_cli_odbc_show(), handle_cli_sound_show(), handle_cli_status(), handle_export_primitives(), handle_manager_show_event(), handle_manager_show_events(), handle_show_calendar(), handle_show_calendars(), handle_show_hint(), handle_show_hints(), handle_show_named_acl_cmd(), handle_showmanconn(), handle_skel_show_games(), handle_skel_show_levels(), handle_voicemail_show_aliases(), has_mwi_subscription(), iax2_getpeername(), iax2_getpeertrunk(), ice_candidates_compare(), interface_exists(), ip_identify_apply(), jingle_add_google_candidates_to_transport(), jingle_add_ice_udp_candidates_to_transport(), jingle_request(), keepalive_transport_thread(), kill_duplicate_offers(), load_users(), local_devicestate(), locals_show(), manager_fax_sessions(), manager_iax2_show_peer_list(), manager_parking_status_all_lots(), manager_parking_status_single_lot(), manager_queues_status(), manager_queues_summary(), manager_show_registry(), manager_sip_peer_status(), mark_lots_as_disabled(), media_cache_handle_show_item(), meetme_menu_admin_extended(), meetme_show_cmd(), moh_rescan_files(), msg_func_write(), mwi_contact_deleted(), mwi_initial_events(), mwi_mailbox_delete_all(), mwi_mailbox_get(), mwi_subscription_mailboxes_str(), num_available_members(), parking_lot_get_space(), pjsip_acf_dial_contacts_read(), pjsip_aor_function_read(), poke_all_peers(), presence_state_cb(), presence_state_notify_callbacks(), print_queue(), prune_peers(), prune_users(), purge_sessions(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuememberlist(), queue_mwi_event(), qupd_exec(), reload(), reload_single_queue(), remove_all_configured_parking_lot_extensions(), remove_pending_parking_lot_extensions(), rt_handle_member_record(), rtp_add_candidates_to_ice(), set_member_paused(), set_member_value(), set_transfer_variables_all(), show_codecs(), single_state_process_bridge_enter(), sip_keepalive_all_peers(), sip_options_apply_aor_configuration(), sip_options_cleanup_task(), sip_options_endpoint_unlink_aor_feeders(), sip_options_get_endpoint_state_compositor_state(), sip_outbound_publish_synchronize(), sip_poke_all_peers(), sip_prune_realtime(), sip_send_all_mwi_subscriptions(), sip_send_all_registers(), sip_show_channel(), sip_show_channels(), sip_show_channelstats(), sip_show_history(), sip_show_inuse(), sip_show_mwi(), sip_show_objects(), sip_show_registry(), sip_show_tcp(), sip_show_users(), sla_calc_station_delays(), sla_change_trunk_state(), sla_queue_event_conf(), sla_show_stations(), sla_show_trunks(), sorcery_memory_cache_complete_name(), sorcery_memory_cache_complete_object_name(), stasis_app_mailboxes_to_json(), stasis_app_to_cli(), stasis_show_topics(), statistics_show_subscription(), statistics_show_subscriptions(), statistics_show_topic(), statistics_show_topics(), stir_shaken_tab_complete_name(), stop_streams(), subscription_statistics_complete_name(), system_create_resolver_and_set_nameservers(), test_ao2_callback_traversal(), test_ao2_iteration(), test_container_clone(), test_expected_duplicates(), topic_complete_name(), topic_statistics_complete_name(), tps_report_taskprocessor_list(), tps_taskprocessor_tab_complete(), try_calling(), unbound_config_preapply(), unlink_peers_from_tables(), unload_module(), update_queue(), update_realtime_members(), xmpp_pubsub_create_affiliations(), xmpp_show_buddies(), and xmpp_show_clients().

535 {
536  /* Release any last container node reference. */
537  ao2_iterator_restart(iter);
538 
539  /* Release the iterated container reference. */
540  ao2_t_ref(iter->c, -1, "Unref iterator in ao2_iterator_destroy");
541  iter->c = NULL;
542 
543  /* Free the malloced iterator. */
544  if (iter->flags & AO2_ITERATOR_MALLOCD) {
545  ast_free(iter);
546  }
547 }
#define ao2_t_ref(o, delta, tag)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:463
void ao2_iterator_restart(struct ao2_iterator *iter)
Restart an iteration.
#define NULL
Definition: resample.c:96
struct ao2_container * c
Definition: astobj2.h:1843
#define ast_free(a)
Definition: astmm.h:182

◆ ao2_iterator_init()

struct ao2_iterator ao2_iterator_init ( struct ao2_container c,
int  flags 
)

Create an iterator for a container.

Parameters
cthe container
flagsone or more flags from ao2_iterator_flags.
Return values
theconstructed iterator
Note
This function does not take a pointer to an iterator; rather, it returns an iterator structure that should be assigned to (overwriting) an existing iterator structure allocated on the stack or on the heap.

This function will take a reference on the container being iterated.

initialize an iterator so we start from the first object

Definition at line 485 of file astobj2_container.c.

References a, ao2_t_ref, c, ao2_iterator::c, and ao2_iterator::flags.

Referenced by __iax2_show_peers(), __manager_event_sessions_va(), __queues_show(), __test_cel_generate_peer_str(), aco_set_defaults(), action_agents(), action_confbridgelistrooms(), action_coreshowchannels(), action_devicestatelist(), action_extensionstatelist(), action_meetmelist(), action_presencestatelist(), add_ice_to_sdp(), add_ice_to_stream(), agent_show_requested(), agents_post_apply_config(), alias_show(), ami_show_registration_contact_statuses(), ao2_weakproxy_unsubscribe(), app_to_json(), ari_show_apps(), ast_add_hint(), ast_ari_bridges_list(), ast_ari_channels_list(), ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), ast_ari_recordings_list_stored(), ast_bridge_channel_kick(), ast_bucket_file_json(), ast_bucket_json(), ast_channel_iterator_all_new(), ast_complete_channels(), ast_endpoint_snapshot_create(), ast_format_cache_get_by_codec(), ast_merge_contexts_and_delete(), ast_msg_var_iterator_init(), ast_pickup_find_by_group(), ast_print_namedgroups(), ast_rtp_ice_start(), ast_sip_destroy_scheduler(), ast_sip_for_each_contact(), ast_sorcery_objectset_create2(), ast_sorcery_objectset_json_create(), ast_srtp_unprotect(), AST_TEST_DEFINE(), ast_tone_zone_iterator_init(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), astobj2_test_1_helper(), auth_observer(), authenticate(), authenticate_reply(), bridge_app_subscribed_involved(), bridge_channel_event_join_leave(), bridge_channel_moving(), bridge_channel_talking(), bridges_scrape_cb(), build_cli_notify(), calendar_query_exec(), cel_generate_peer_str(), channels_scrape_cb(), check_access(), check_events(), clear_queue(), clear_stats(), cli_complete_endpoint(), cli_complete_notify(), cli_complete_registration(), cli_complete_show(), cli_complete_uri(), cli_console_active(), cli_display_named_acl_list(), cli_fax_show_sessions(), cli_list_devices(), cli_show_channels(), cli_show_modules(), cli_show_tasks(), cli_tps_reset_stats_all(), compare_weight(), complete_bridge_profile_name(), complete_confbridge_name(), complete_config_module(), complete_core_id(), complete_core_show_hint(), complete_country(), complete_iax2_peers(), complete_iax2_unregister(), complete_menu_name(), complete_mohclass_realtime(), complete_queue(), complete_queue_remove_member(), complete_show_sorcery_object(), complete_sip_peer(), complete_sip_registered_peer(), complete_sip_user(), complete_sipch(), complete_user_profile_name(), complete_userno(), conf_queue_dtmf(), config_hook_exec(), configure_parking_extensions(), container_to_json_array(), control_dispatch_all(), control_flush_queue(), control_prestart_dispatch_all(), destroy_pvts(), device_state_cb(), device_state_notify_callbacks(), dial_state_process_bridge_enter(), dialgroup_read(), disable_marked_lots(), dump_queue_members(), endpoints_scrape_cb(), event_session_shutdown(), exten_state_publisher_state_cb(), extension_state_cb(), fax_session_tab_complete(), find_queue_by_name_rt(), find_ringing_channel(), find_session(), find_session_by_nonce(), free_members(), generate_or_link_lots_to_configs(), get_device_state_causing_channels(), get_member_status(), get_transferee(), get_udp_transport(), get_write_timeout(), handle_bridge_pairings(), handle_bridge_show_all(), handle_chanlist(), handle_cli_confbridge_list(), handle_cli_confbridge_show_bridge_profiles(), handle_cli_confbridge_show_menus(), handle_cli_confbridge_show_user_profiles(), handle_cli_iax2_show_callno_limits(), handle_cli_iax2_show_users(), handle_cli_moh_show_classes(), handle_cli_moh_show_files(), handle_cli_moh_unregister_class(), handle_cli_odbc_show(), handle_cli_sound_show(), handle_cli_status(), handle_export_primitives(), handle_manager_show_event(), handle_show_calendar(), handle_show_calendars(), handle_show_hint(), handle_show_hints(), handle_show_named_acl_cmd(), handle_showmanconn(), handle_skel_show_games(), handle_skel_show_levels(), handle_voicemail_show_aliases(), iax2_getpeername(), iax2_getpeertrunk(), ice_candidates_compare(), interface_exists(), internal_ao2_traverse(), ip_identify_apply(), jingle_add_google_candidates_to_transport(), jingle_add_ice_udp_candidates_to_transport(), jingle_request(), keepalive_transport_thread(), load_users(), local_devicestate(), locals_show(), manager_fax_sessions(), manager_iax2_show_peer_list(), manager_parking_status_all_lots(), manager_parking_status_single_lot(), manager_queues_status(), manager_queues_summary(), manager_show_registry(), manager_sip_peer_status(), mark_lots_as_disabled(), media_cache_handle_show_item(), meetme_menu_admin_extended(), meetme_show_cmd(), moh_rescan_files(), msg_func_write(), mwi_initial_events(), mwi_mailbox_delete_all(), mwi_mailbox_get(), mwi_subscription_mailboxes_str(), num_available_members(), parking_lot_get_space(), pjsip_acf_dial_contacts_read(), pjsip_aor_function_read(), poke_all_peers(), presence_state_notify_callbacks(), print_queue(), prune_peers(), prune_users(), purge_sessions(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuememberlist(), qupd_exec(), reload(), reload_single_queue(), remove_all_configured_parking_lot_extensions(), remove_pending_parking_lot_extensions(), rt_handle_member_record(), rtp_add_candidates_to_ice(), set_member_paused(), set_member_value(), set_transfer_variables_all(), show_codecs(), single_state_process_bridge_enter(), sip_keepalive_all_peers(), sip_options_apply_aor_configuration(), sip_options_cleanup_task(), sip_options_endpoint_unlink_aor_feeders(), sip_options_get_endpoint_state_compositor_state(), sip_outbound_publish_synchronize(), sip_poke_all_peers(), sip_prune_realtime(), sip_send_all_mwi_subscriptions(), sip_send_all_registers(), sip_show_channel(), sip_show_channels(), sip_show_channelstats(), sip_show_history(), sip_show_inuse(), sip_show_mwi(), sip_show_objects(), sip_show_registry(), sip_show_tcp(), sip_show_users(), sla_calc_station_delays(), sla_change_trunk_state(), sla_queue_event_conf(), sla_show_stations(), sla_show_trunks(), sorcery_memory_cache_complete_name(), sorcery_memory_cache_complete_object_name(), stasis_app_mailboxes_to_json(), stasis_app_set_global_debug(), stasis_show_topics(), statistics_show_subscription(), statistics_show_subscriptions(), statistics_show_topic(), statistics_show_topics(), stir_shaken_tab_complete_name(), stop_streams(), subscription_statistics_complete_name(), system_create_resolver_and_set_nameservers(), test_ao2_iteration(), test_container_clone(), topic_complete_name(), topic_statistics_complete_name(), tps_report_taskprocessor_list(), tps_taskprocessor_tab_complete(), try_calling(), unbound_config_preapply(), unload_module(), update_queue(), update_realtime_members(), xmpp_pubsub_create_affiliations(), xmpp_show_buddies(), and xmpp_show_clients().

486 {
487  struct ao2_iterator a = {
488  .c = c,
489  .flags = flags
490  };
491 
492  ao2_t_ref(c, +1, "Init iterator with container.");
493 
494  return a;
495 }
#define ao2_t_ref(o, delta, tag)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:463
static struct test_val c
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Definition: astobj2.h:1841
static struct test_val a

◆ ao2_iterator_restart()

void ao2_iterator_restart ( struct ao2_iterator iter)

Restart an iteration.

Parameters
iterthe iterator to restart
Note
A restart is not going to have any effect if the iterator was created with the AO2_ITERATOR_UNLINK flag. Any previous objects returned were removed from the container.
Return values
none

Definition at line 497 of file astobj2_container.c.

References __adjust_lock(), AO2_ITERATOR_DONTLOCK, AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_RDLOCK, ao2_rdlock, ao2_ref, ao2_unlock, ao2_iterator::c, ao2_iterator::complete, ao2_iterator::flags, is_ao2_object, ao2_iterator::last_node, and NULL.

Referenced by ao2_iterator_destroy().

498 {
499  if (!is_ao2_object(iter->c)) {
500  /* Sanity check. */
501  return;
502  }
503 
504  /* Release the last container node reference if we have one. */
505  if (iter->last_node) {
506  enum ao2_lock_req orig_lock;
507 
508  /*
509  * Do a read lock in case the container node unref does not
510  * destroy the node. If the container node is destroyed then
511  * the lock will be upgraded to a write lock.
512  */
513  if (iter->flags & AO2_ITERATOR_DONTLOCK) {
514  orig_lock = __adjust_lock(iter->c, AO2_LOCK_REQ_RDLOCK, 1);
515  } else {
516  orig_lock = AO2_LOCK_REQ_MUTEX;
517  ao2_rdlock(iter->c);
518  }
519 
520  ao2_ref(iter->last_node, -1);
521  iter->last_node = NULL;
522 
523  if (iter->flags & AO2_ITERATOR_DONTLOCK) {
524  __adjust_lock(iter->c, orig_lock, 0);
525  } else {
526  ao2_unlock(iter->c);
527  }
528  }
529 
530  /* The iteration is no longer complete. */
531  iter->complete = 0;
532 }
void * last_node
Definition: astobj2.h:1845
ao2_lock_req
Which lock to request.
Definition: astobj2.h:701
#define ao2_unlock(a)
Definition: astobj2.h:730
#define NULL
Definition: resample.c:96
int complete
Definition: astobj2.h:1847
struct ao2_container * c
Definition: astobj2.h:1843
#define is_ao2_object(user_data)
#define ao2_ref(o, delta)
Definition: astobj2.h:464
#define ao2_rdlock(a)
Definition: astobj2.h:719
Assume that the ao2_container is already locked.
Definition: astobj2.h:1872
enum ao2_lock_req __adjust_lock(void *user_data, enum ao2_lock_req lock_how, int keep_stronger)
Definition: astobj2.c:425

◆ ao2_match_by_addr()

int ao2_match_by_addr ( void *  user_data,
void *  arg,
int  flags 
)

A common ao2_callback is one that matches by address.

A common ao2_callback is one that matches by address.

Definition at line 166 of file astobj2_container.c.

References CMP_MATCH, and CMP_STOP.

Referenced by __ao2_unlink(), _mohclass_unref(), load_module(), and test_container_clone().

167 {
168  return (user_data == arg) ? (CMP_MATCH | CMP_STOP) : 0;
169 }

◆ ao2_object_get_lockaddr()

void* ao2_object_get_lockaddr ( void *  obj)

Return the mutex lock address of an object.

Parameters
[in]objA pointer to the object we want.
Returns
the address of the mutex lock, else NULL.

This function comes in handy mainly for debugging locking situations, where the locking trace code reports the lock address, this allows you to correlate against object address, to match objects to reported locks.

Warning
AO2 lock objects do not include tracking fields when DEBUG_THREADS is not enabled.
Since
1.6.1

Definition at line 476 of file astobj2.c.

References AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, INTERNAL_OBJ_CHECK, INTERNAL_OBJ_MUTEX, ao2_lock_priv::lock, astobj2_lock::mutex, NULL, __priv_data::options, and astobj2::priv_data.

Referenced by ast_rtp_ice_turn_request(), ast_serializer_shutdown_group_join(), ast_sip_session_suspend(), bridge_channel_wait(), bridge_manager_thread(), consumer_should_stay(), consumer_wait_for(), consumer_wait_for_completion(), control_wait(), db_sync_thread(), ice_reset_session(), pbx_outgoing_attempt(), rtp_deallocate_transport(), sip_session_suspend_task(), stasis_subscription_join(), and wait_for_stimulus().

477 {
478  struct astobj2 *obj;
479  struct astobj2_lock *obj_mutex;
480 
482 
483  if (obj == NULL) {
484  return NULL;
485  }
486 
487  switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
489  obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
490  return &obj_mutex->mutex.lock;
491  default:
492  break;
493  }
494 
495  return NULL;
496 }
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
struct ao2_lock_priv mutex
Definition: astobj2.c:121
void * user_data[0]
Definition: astobj2.c:123
#define NULL
Definition: resample.c:96
ast_mutex_t lock
Definition: astobj2.c:116
#define INTERNAL_OBJ_CHECK(user_data)
Definition: astobj2.c:183
#define INTERNAL_OBJ_MUTEX(user_data)
Definition: astobj2.c:154
struct __priv_data priv_data
Definition: astobj2.c:105

◆ ao2_options_get()

unsigned int ao2_options_get ( void *  obj)

Retrieve the ao2 options used to create the object.

Parameters
objpointer to the (user-defined part) of an object.
Returns
options from enum ao2_alloc_opts.

Definition at line 778 of file astobj2.c.

References INTERNAL_OBJ_CHECK, __priv_data::options, and astobj2::priv_data.

Referenced by __ast_named_lock_get(), hash_ao2_alloc_empty_clone(), and rb_ao2_alloc_empty_clone().

779 {
780  struct astobj2 *orig_obj;
781 
782  orig_obj = INTERNAL_OBJ_CHECK(obj);
783  if (!orig_obj) {
784  return 0;
785  }
786  return orig_obj->priv_data.options;
787 }
uint32_t options
The ao2 object option flags.
Definition: astobj2.c:70
#define INTERNAL_OBJ_CHECK(user_data)
Definition: astobj2.c:183
struct __priv_data priv_data
Definition: astobj2.c:105

◆ ao2_ref_and_lock()

int ao2_ref_and_lock ( void *  obj)
inline

Increment reference count on an object and lock it.

Since
13.9.0
Parameters
[in]objA pointer to the ao2 object
Return values
0The object is not an ao2 object or wasn't locked successfully
1The object's reference count was incremented and was locked

Definition at line 781 of file astobj2.h.

References ao2_ref, and ao2_unlock.

793 {

◆ ao2_unlock_and_unref()

int ao2_unlock_and_unref ( void *  obj)
inline

Unlock an object and decrement its reference count.

Since
13.9.0
Parameters
[in]objA pointer to the ao2 object
Return values
0The object is not an ao2 object or wasn't unlocked successfully
1The object was unlocked and it's reference count was decremented

Definition at line 801 of file astobj2.h.

804 {

◆ ao2_weakproxy_subscribe()

int ao2_weakproxy_subscribe ( void *  weakproxy,
ao2_weakproxy_notification_cb  cb,
void *  data,
int  flags 
)

Request notification when weakproxy points to NULL.

Since
14.0.0
Parameters
weakproxyThe weak object
cbProcedure to call when no real object is associated
dataPassed to cb
flagsOBJ_NOLOCK to avoid locking weakproxy.
Return values
0Success
-1Failure
Note
Callbacks are run in the reverse order of subscriptions.
This procedure will allow the same cb / data pair to be added to the same weakproxy multiple times.
It is the caller's responsibility to ensure that *data is valid until after cb() is run or ao2_weakproxy_unsubscribe is called.
If the weakproxy currently points to NULL the callback will be run immediately, without being added to the subscriber list.

Definition at line 931 of file astobj2.c.

References ao2_lock, ao2_unlock, AO2_WEAK, ast_calloc, AST_LIST_INSERT_HEAD, ao2_weakproxy_notification::cb, ao2_weakproxy_notification::data, ao2_weakproxy::destroyed_cb, INTERNAL_OBJ_CHECK, ao2_weakproxy_notification::list, __priv_data::magic, NULL, OBJ_NOLOCK, astobj2::priv_data, sub, and __priv_data::weakptr.

Referenced by __ast_named_lock_get(), __ast_sorcery_open(), AST_TEST_DEFINE(), link_topic_proxy(), and state_alloc().

932 {
933  struct astobj2 *weakproxy_internal = INTERNAL_OBJ_CHECK(weakproxy);
934  int ret = -1;
935  int hasobj;
936 
937  if (!weakproxy_internal || weakproxy_internal->priv_data.magic != AO2_WEAK) {
938  return -1;
939  }
940 
941  if (!(flags & OBJ_NOLOCK)) {
942  ao2_lock(weakproxy);
943  }
944 
945  hasobj = weakproxy_internal->priv_data.weakptr != NULL;
946  if (hasobj) {
947  struct ao2_weakproxy *weak = weakproxy;
948  struct ao2_weakproxy_notification *sub = ast_calloc(1, sizeof(*sub));
949 
950  if (sub) {
951  sub->cb = cb;
952  sub->data = data;
953  AST_LIST_INSERT_HEAD(&weak->destroyed_cb, sub, list);
954  ret = 0;
955  }
956  }
957 
958  if (!(flags & OBJ_NOLOCK)) {
959  ao2_unlock(weakproxy);
960  }
961 
962  if (!hasobj) {
963  cb(weakproxy, data);
964  ret = 0;
965  }
966 
967  return ret;
968 }
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
#define AO2_WEAK
Definition: astobj2.c:97
#define NULL
Definition: resample.c:96
#define INTERNAL_OBJ_CHECK(user_data)
Definition: astobj2.c:183
#define ao2_lock(a)
Definition: astobj2.h:718
struct ao2_weakproxy::@224 destroyed_cb
struct ao2_weakproxy_notification::@339 list
void * weakptr
Definition: astobj2.c:57
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
Definition: linkedlists.h:710
#define ast_calloc(num, len)
A wrapper for calloc()
Definition: astmm.h:204
This struct should be opaque, but it&#39;s size is needed.
Definition: astobj2.h:530
struct __priv_data priv_data
Definition: astobj2.c:105
struct stasis_forward * sub
Definition: res_corosync.c:240
ao2_weakproxy_notification_cb cb
Definition: astobj2.c:110
uint32_t magic
Definition: astobj2.c:93

◆ ao2_weakproxy_unsubscribe()

int ao2_weakproxy_unsubscribe ( void *  weakproxy,
ao2_weakproxy_notification_cb  cb,
void *  data,
int  flags 
)

Remove notification of real object destruction.

Since
14.0.0
Parameters
weakproxyThe weak object
cbCallback to remove from destroy notification list
dataData pointer to match
flagsOBJ_NOLOCK to avoid locking weakproxy. OBJ_MULTIPLE to remove all copies of the same cb / data pair.
Returns
The number of subscriptions removed.
Return values
0cb / data pair not found, nothing removed.
-1Failure due to invalid parameters.
Note
Unless flags includes OBJ_MULTIPLE, this will only remove a single copy of the cb / data pair. If it was subscribed multiple times it must be unsubscribed as many times. The OBJ_MULTIPLE flag can be used to remove matching subscriptions.
When it's time to run callbacks they are copied to a temporary list so the weakproxy can be unlocked before running. That means it's possible for this function to find nothing before the callback is run in another thread.

Definition at line 970 of file astobj2.c.

References a, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_clone, ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_link, ao2_lock, ao2_t_alloc, ao2_t_callback, ao2_t_container_alloc_list, ao2_t_iterator_next, ao2_t_ref, ao2_t_unlink, ao2_unlock, AO2_WEAK, ast_cli_args::argc, ast_cli_args::argv, ast_add_profile(), ast_cli(), AST_CLI_DEFINE, ast_free, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, ast_mark(), ast_verbose(), ao2_weakproxy_notification::cb, CLI_GENERATE, CLI_HANDLER, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ao2_weakproxy_notification::data, ao2_weakproxy::destroyed_cb, ast_cli_args::fd, INTERNAL_OBJ_CHECK, ao2_weakproxy_notification::list, __priv_data::magic, NULL, OBJ_MULTIPLE, OBJ_NOLOCK, astobj2::priv_data, sub, and ast_cli_entry::usage.

Referenced by AST_TEST_DEFINE().

971 {
972  struct astobj2 *internal_weakproxy = INTERNAL_OBJ_CHECK(weakproxy);
973  struct ao2_weakproxy *weak;
975  int ret = 0;
976 
977  if (!internal_weakproxy || internal_weakproxy->priv_data.magic != AO2_WEAK || !destroyed_cb) {
978  return -1;
979  }
980 
981  if (!(flags & OBJ_NOLOCK)) {
982  ao2_lock(weakproxy);
983  }
984 
985  weak = weakproxy;
987  if (sub->cb == destroyed_cb && sub->data == data) {
989  ast_free(sub);
990  ret++;
991  if (!(flags & OBJ_MULTIPLE)) {
992  break;
993  }
994  }
995  }
997 
998  if (!(flags & OBJ_NOLOCK)) {
999  ao2_unlock(weakproxy);
1000  }
1001 
1002  return ret;
1003 }
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
#define ao2_unlock(a)
Definition: astobj2.h:730
#define AO2_WEAK
Definition: astobj2.c:97
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
Definition: linkedlists.h:614
#define INTERNAL_OBJ_CHECK(user_data)
Definition: astobj2.c:183
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
Definition: linkedlists.h:556
#define ao2_lock(a)
Definition: astobj2.h:718
struct ao2_weakproxy::@224 destroyed_cb
struct ao2_weakproxy_notification::@339 list
#define ast_free(a)
Definition: astmm.h:182
This struct should be opaque, but it&#39;s size is needed.
Definition: astobj2.h:530
struct __priv_data priv_data
Definition: astobj2.c:105
struct stasis_forward * sub
Definition: res_corosync.c:240
ao2_weakproxy_notification_cb cb
Definition: astobj2.c:110
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
Definition: linkedlists.h:528
uint32_t magic
Definition: astobj2.c:93