54 char *virtual_device, *
type, *device_name;
64 if (device_state->
eid) {
74 virtual_device = strchr(
type,
':');
75 device_name = strchr(
type,
'/');
76 if (virtual_device && (!device_name || (virtual_device < device_name))) {
77 device_name = virtual_device;
84 *device_name++ =
'\0';
111#define AUTOHINT_CMP_CONTEXT_NAME(elem, name) (!strcmp(ast_get_context_name(elem), 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
void ast_free_ptr(void *ptr)
free() wrapper
struct stasis_message_type * ast_device_state_message_type(void)
Get the Stasis message type for device state messages.
struct stasis_topic * ast_device_state_topic_all(void)
Get the Stasis topic for device state messages.
static struct @376 extension_state_autohints
Contexts which have autohints enabled.
int ast_extension_state_autohints_init(void)
static const char registrar[]
The static registrar for the added dialplan hints.
#define AUTOHINT_CMP_CONTEXT_NAME(elem, name)
static void extension_state_autohints_cleanup(void)
void pbx_extension_state_autohint_set(struct ast_context *context)
static struct stasis_subscription * autohints_subscription
Subscription to receive updates so we can create hints as needed on autohint enabled contexts.
void pbx_extension_state_autohint_remove(struct ast_context *context, unsigned int forced)
static ast_mutex_t extension_state_autohints_lock
Lock to protect the autohints vector.
static void extension_state_autohints_device_state_cb(void *userdata, struct stasis_subscription *sub, struct stasis_message *msg)
#define ast_mutex_unlock(a)
#define ast_mutex_lock(a)
#define AST_MUTEX_DEFINE_STATIC(mutex)
Core PBX routines and definitions.
int ast_add_extension(const char *context, int replace, const char *extension, int priority, const char *label, const char *callerid, const char *application, void *data, void(*datad)(void *), const char *registrar)
Add and extension to an extension context.
int ast_context_destroy_by_name(const char *context, const char *registrar)
Destroy a context by name.
int ast_wrlock_contexts(void)
Write locks the context list.
const char * ast_get_context_name(struct ast_context *con)
int ast_rdlock_contexts(void)
Read locks the context list.
struct ast_exten * pbx_find_extension(struct ast_channel *chan, struct ast_context *bypass, struct pbx_find_info *q, const char *context, const char *exten, int priority, const char *label, const char *callerid, enum ext_match_t action)
int ast_unlock_contexts(void)
Unlocks contexts.
Private include file for pbx.
static struct stasis_subscription * sub
Statsd channel stats. Exmaple of how to subscribe to Stasis events.
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
struct stasis_subscription * stasis_unsubscribe(struct stasis_subscription *subscription)
Cancel a subscription.
#define stasis_subscribe(topic, callback, data)
static force_inline int attribute_pure ast_strlen_zero(const char *s)
ast_context: An extension context
The structure that contains device state.
const struct ast_eid * eid
The EID of the server where this message originated.
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_ELEM_DEFAULT_CMP(elem, value)
Default comparator for AST_VECTOR_REMOVE_ELEM_UNORDERED()
#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.