86 const char *right_key = arg;
91 right_key = object_right->
name;
93 cmp = strcasecmp(object_left->
name, right_key);
96 cmp = strncasecmp(object_left->
name, right_key, strlen(right_key));
252 int name_len = strlen(
name) + 1;
403 if (!strcmp(
current->name, tech_name)) {
413 char *tech_name =
NULL;
423 tech_name =
strsep(&tech_name,
":");
466 ast_verb(5,
"Refer technology '%s' registered.\n", tech->
name);
484 if (!vec_elem->
name || !srch->
name) {
485 return (vec_elem->
name == srch->
name) ? 1 : 0;
487 return !strcmp(vec_elem->
name, srch->
name);
504 ast_verb(5,
"Refer technology '%s' unregistered.\n", tech->
name);
Prototypes for public functions only of internal interest,.
Asterisk main include file. File version handling, generic pbx functions.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
#define ast_strdup(str)
A wrapper for strdup()
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ast_calloc(num, len)
A wrapper for calloc()
#define ao2_iterator_next(iter)
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_NOLOCK
@ AO2_ALLOC_OPT_LOCK_MUTEX
#define ao2_unlink(container, obj)
Remove an object from a container.
#define ao2_find(container, arg, flags)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_alloc_options(data_size, destructor_fn, options)
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
@ OBJ_SEARCH_PARTIAL_KEY
The arg parameter is a partial search key similar to OBJ_SEARCH_KEY.
@ OBJ_SEARCH_OBJECT
The arg parameter is an object of the same type.
@ OBJ_SEARCH_MASK
Search option field mask.
@ OBJ_SEARCH_KEY
The arg parameter is a search key, but is not an object.
#define ao2_container_alloc_list(ao2_options, container_options, sort_fn, cmp_fn)
Allocate and initialize a list container.
static int match(struct ast_sockaddr *addr, unsigned short callno, unsigned short dcallno, const struct chan_iax2_pvt *cur, int check_dcallno)
Asterisk datastore objects.
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
char * strsep(char **str, const char *delims)
#define ast_verb(level,...)
#define ast_rwlock_wrlock(a)
#define ast_rwlock_rdlock(a)
#define ast_rwlock_init(rwlock)
wrapper for rwlock with tracking enabled
#define ast_rwlock_destroy(rwlock)
#define ast_rwlock_unlock(a)
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
Asterisk module definitions.
Core PBX routines and definitions.
static int refer_data_cmp_fn(void *obj, void *arg, int flags)
void ast_refer_var_unref_current(struct ast_refer_var_iterator *iter)
Unref a refer var from inside an iterator loop.
int ast_refer_tech_unregister(const struct ast_refer_tech *tech)
Unregister a refer technology.
const char * ast_refer_get_to(const struct ast_refer *refer)
Retrieve the destination of this refer.
int ast_refer_var_iterator_next(struct ast_refer_var_iterator *iter, const char **name, const char **value)
Get the next variable name and value.
static void refer_shutdown(void)
static int refer_set_var_full(struct ast_refer *refer, const char *name, const char *value)
struct ast_refer_var_iterator * ast_refer_var_iterator_init(const struct ast_refer *refer)
Create a new refer variable iterator.
struct ast_refer * ast_refer_alloc(void)
Allocate a refer.
const char * ast_refer_get_from(const struct ast_refer *refer)
Retrieve the source of this refer.
static int refer_tech_cmp(const struct ast_refer_tech *vec_elem, const struct ast_refer_tech *srch)
Comparison callback for ast_refer_tech vector removal.
struct @381 refer_techs
Vector of refer technologies.
const char * ast_refer_get_var(struct ast_refer *refer, const char *name)
Get the specified variable on the refer.
static ast_rwlock_t refer_techs_lock
Lock for refer_techs vector.
int ast_refer_set_var_outbound(struct ast_refer *refer, const char *name, const char *value)
Set a variable on the refer being sent to a refer tech directly.
const char * ast_refer_get_endpoint(const struct ast_refer *refer)
Retrieve the endpoint associated with this refer.
char * ast_refer_get_var_and_unlink(struct ast_refer *refer, const char *name)
Get the specified variable on the refer and unlink it from the container of variables.
int ast_refer_set_endpoint(struct ast_refer *refer, const char *fmt,...)
Set the technology's endpoint associated with this refer.
static void refer_destructor(void *obj)
int ast_refer_set_from(struct ast_refer *refer, const char *fmt,...)
Set the 'from' URI of a refer.
struct ast_refer * ast_refer_destroy(struct ast_refer *refer)
Destroy an ast_refer.
int ast_refer_set_refer_to(struct ast_refer *refer, const char *fmt,...)
Set the 'refer_to' URI of a refer.
const char * ast_refer_get_refer_to(const struct ast_refer *refer)
Get the "refer-to" value of a refer.
int ast_refer_set_tech(struct ast_refer *refer, const char *fmt,...)
Set the technology associated with this refer.
static void refer_data_destructor(void *obj)
int ast_refer_tech_register(const struct ast_refer_tech *tech)
Register a refer technology.
int ast_refer_set_to_self(struct ast_refer *refer, int val)
Set the 'to_self' value of a refer.
int ast_refer_send(struct ast_refer *refer)
Send a refer directly to an endpoint.
static struct refer_data * refer_data_find(struct ao2_container *vars, const char *name)
struct ast_refer * ast_refer_ref(struct ast_refer *refer)
Bump a refer's ref count.
int ast_refer_set_to(struct ast_refer *refer, const char *fmt,...)
Set the 'to' URI of a refer.
int ast_refer_get_to_self(const struct ast_refer *refer)
Retrieve the "to_self" value of this refer.
void ast_refer_var_iterator_destroy(struct ast_refer_var_iterator *iter)
Destroy a refer variable iterator.
static const struct ast_refer_tech * refer_find_by_tech_name(const char *tech_name)
const char * ast_refer_get_tech(const struct ast_refer *refer)
Retrieve the technology associated with this refer.
static struct refer_data * refer_data_new(const char *name)
Out-of-call refer support.
static const struct ast_refer_tech refer_tech
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
#define AST_STRING_FIELD(name)
Declare a string field.
#define ast_string_field_build_va(x, field, fmt, args)
Set a field to a complex (built) value.
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
String manipulation functions.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
int(*const refer_send)(const struct ast_refer *refer)
Send a refer.
const char *const name
Name of this refer technology.
struct refer_data * current_used
struct ao2_container * vars
const ast_string_field tech
const ast_string_field from
const ast_string_field refer_to
const ast_string_field endpoint
const ast_string_field to
Structure for rwlock and tracking information.
An API for managing task processing threads that can be shared across modules.
Vector container support.
#define AST_VECTOR_ELEM_CLEANUP_NOOP(elem)
Vector element cleanup that does nothing.
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
#define AST_VECTOR_FREE(vec)
Deallocates this vector.
#define AST_VECTOR_REMOVE_CMP_UNORDERED(vec, value, cmp, cleanup)
Remove an element from a vector that matches the given comparison.
#define AST_VECTOR_INIT(vec, size)
Initialize a vector.
#define AST_VECTOR_APPEND(vec, elem)
Append an element to a vector, growing the vector if needed.
#define AST_VECTOR(name, type)
Define a vector structure.
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.