40#define BRIDGE_ALL "__AST_BRIDGE_ALL_TOPIC"
41#define CHANNEL_ALL "__AST_CHANNEL_ALL_TOPIC"
42#define ENDPOINT_ALL "__AST_ENDPOINT_ALL_TOPIC"
130 strcpy(forwards->
id,
id);
235 if (!
app->endpoint_router) {
257static int forwards_sort(
const void *obj_left,
const void *obj_right,
int flags)
261 const char *right_key = obj_right;
266 right_key = object_right->
id;
269 cmp = strcmp(object_left->
id, right_key);
276 cmp = strncmp(object_left->
id, right_key, strlen(right_key));
290 size_t size = strlen(
"stasis-") + strlen(
app->name) + 1;
293 ast_verb(1,
"Destroying Stasis app %s\n",
app->name);
371typedef struct ast_json *(*channel_snapshot_monitor)(
374 const struct timeval *tv);
379 const struct timeval *tv)
390 "channel", json_channel);
395 const struct timeval *tv)
402 const struct timeval *tv)
411 "type",
"ChannelDestroyed",
415 "channel", json_channel);
420 const struct timeval *tv)
429 const struct timeval *tv)
432 new_snapshot : old_snapshot;
438 }
else if (old_snapshot->
state != new_snapshot->
state) {
448 const struct timeval *tv)
472 "type",
"ChannelDialplan",
476 "channel", json_channel);
482 const struct timeval *tv)
501 "type",
"ChannelCallerId",
503 "caller_presentation", new_snapshot->
caller->
pres,
506 "channel", json_channel);
512 const struct timeval *tv)
531 "type",
"ChannelConnectedLine",
533 "channel", json_channel);
570 const struct timeval *tv)
574 if (!json_endpoint) {
581 "endpoint", json_endpoint);
594 resource = strchr(tech,
'/');
611 if (!json_endpoint) {
616 "type",
"TextMessageReceived",
618 "endpoint", json_endpoint,
636 const struct timeval *tv;
661 if (!new_snapshot && old_snapshot) {
669 const struct timeval *tv)
679 "bridge", json_bridge);
689 const struct timeval *tv;
695 if (!
update->new_snapshot) {
697 }
else if (!
update->old_snapshot) {
700 && strcmp(
update->new_snapshot->video_source_id,
update->old_snapshot->video_source_id)) {
870 int debug_enabled = 0;
884 return debug_enabled;
920 size_t context_size = strlen(
"stasis-") + strlen(
name) + 1;
930 size =
sizeof(*app) + strlen(
name) + 1;
940 if (!
app->forwards) {
956 if (!
app->bridge_router) {
1004 strncpy(
app->name,
name, size -
sizeof(*
app));
1020 ast_log(
LOG_WARNING,
"Not creating context '%s' for Stasis application '%s' because it already exists\n",
1056 "Inactive Stasis app '%s' missed message\n",
app->name);
1065 ast_verb(1,
"Deactivating Stasis app '%s'\n",
app->name);
1114 if (
app->handler &&
app->data) {
1117 ast_verb(1,
"Replacing Stasis app '%s'\n",
app->name);
1120 "type",
"ApplicationReplaced",
1122 "application",
app->name);
1133 if (!
app->handler) {
1143 ast_verb(1,
"Activating Stasis app '%s'\n",
app->name);
1178 " Subscription Model: %s\n",
1180 app->debug ?
"Yes" :
"No",
1182 "Global Resource Subscription" :
1183 "Application/Explicit Resource Subscription");
1234 "channel_ids",
"bridge_ids",
"endpoint_ids");
1263 if (append_res != 0) {
1318 ast_debug(3,
"Channel '%s' is %d interested in %s\n",
1339 if (!strcmp(kind,
"bridge")) {
1341 }
else if (!strcmp(kind,
"channel")) {
1343 }
else if (!strcmp(kind,
"endpoint")) {
1355 ast_debug(3,
"App '%s' not subscribed to %s '%s'\n",
app->name, kind,
id);
1361 if (forwards->
interested == 0 || terminate) {
1363 ast_debug(3,
"%s '%s' unsubscribed from %s\n", kind,
id,
app->name);
1369 if (!strcmp(kind,
"endpoint")) {
1407 return forwards !=
NULL;
1465 ast_debug(3,
"Bridge '%s' is %d interested in %s\n",
1510 return forwards !=
NULL;
1571 ast_debug(3,
"Endpoint '%s' is %d interested in %s\n",
1606 return forwards !=
NULL;
1638 if (!
app || !json) {
1669 ast_log(
LOG_ERROR,
"Invalid json type event filter - app: %s, filter: %s\n",
1670 app->name, filter_type);
1684 "filter: %s\n",
app->name, filter_type);
Asterisk main include file. File version handling, generic pbx functions.
#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
#define ast_asprintf(ret, fmt,...)
A wrapper for asprintf()
#define ao2_iterator_next(iter)
@ AO2_ALLOC_OPT_LOCK_MUTEX
void ao2_iterator_cleanup(struct ao2_iterator *iter)
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container,...
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
#define ao2_link_flags(container, obj, flags)
Add an object to 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_container_alloc_rbtree(ao2_options, container_options, sort_fn, cmp_fn)
Allocate and initialize a red-black tree container.
#define ao2_replace(dst, src)
Replace one object reference with another cleaning up the original.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_alloc_options(data_size, destructor_fn, options)
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
#define ao2_t_alloc(data_size, destructor_fn, debug_msg)
@ OBJ_NOLOCK
Assume that the ao2_container is already locked.
@ OBJ_SEARCH_KEY
The arg parameter is a search key, but is not an object.
@ AO2_CONTAINER_ALLOC_OPT_DUPS_OBJ_REJECT
Reject duplicate objects in container.
static struct ao2_container * bridges
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
const char * ast_describe_caller_presentation(int data)
Convert caller ID pres value to explanatory string.
struct stasis_topic * ast_channel_topic(struct ast_channel *chan)
A topic which publishes the events for a particular channel.
const char * ast_channel_uniqueid(const struct ast_channel *chan)
#define ast_channel_unref(c)
Decrease channel reference count.
const char * ast_cause2str(int cause) attribute_pure
Gives the string form of a given cause code.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
Standard Command Line Interface.
void ast_cli(int fd, const char *fmt,...)
static struct channel_usage channels
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
Internal API for the Stasis application controller.
struct ast_endpoint * ast_endpoint_find_by_id(const char *id)
Finds the endpoint with the given tech[/resource] id.
const char * ast_endpoint_get_id(const struct ast_endpoint *endpoint)
Gets the tech/resource id of the given endpoint.
static const char context_name[]
static int array(struct ast_channel *chan, const char *cmd, char *var, const char *value)
static int filter(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
struct stasis_topic * ast_endpoint_topic_cached(struct ast_endpoint *endpoint)
Returns the topic for a specific endpoint.
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
struct ast_channel_snapshot * ast_multi_channel_blob_get_channel(struct ast_multi_channel_blob *obj, const char *role)
Retrieve a channel snapshot associated with a specific role from a ast_multi_channel_blob.
struct stasis_message_type * ast_endpoint_contact_state_type(void)
Message type for endpoint contact state changes.
struct stasis_message_type * ast_endpoint_snapshot_type(void)
Message type for ast_endpoint_snapshot.
struct stasis_topic * ast_endpoint_topic(struct ast_endpoint *endpoint)
Returns the topic for a specific endpoint.
struct stasis_message_type * stasis_subscription_change_type(void)
Gets the message type for subscription change notices.
struct stasis_topic * ast_endpoint_topic_all_cached(void)
Cached topic for all endpoint related messages.
struct stasis_message_type * ast_channel_dial_type(void)
Message type for when a channel dials another channel.
struct stasis_message_type * stasis_cache_update_type(void)
Message type for cache update messages.
struct ast_endpoint_snapshot * ast_endpoint_latest_snapshot(const char *tech, const char *resource)
Retrieve the most recent snapshot for the endpoint with the given name.
struct stasis_message_type * ast_channel_snapshot_type(void)
Message type for ast_channel_snapshot_update.
struct stasis_message_type * ast_endpoint_state_type(void)
Message type for endpoint state changes.
#define ast_debug(level,...)
Log a DEBUG message.
#define ast_verb(level,...)
#define ast_json_object_string_get(object, key)
Get a string field from a JSON object.
struct ast_json * ast_json_string_create(const char *value)
Construct a JSON string from value.
enum ast_json_type ast_json_typeof(const struct ast_json *value)
Get the type of value.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
size_t ast_json_object_size(struct ast_json *object)
Get size of JSON object.
struct ast_json * ast_json_array_get(const struct ast_json *array, size_t index)
Get an element from an array.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
struct ast_json * ast_json_timeval(const struct timeval tv, const char *zone)
Construct a timeval as JSON.
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
int ast_json_object_set(struct ast_json *object, const char *key, struct ast_json *value)
Set a field in a JSON object.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
#define AST_JSON_UTF8_VALIDATE(str)
Check str for UTF-8 and replace with an empty string if fails the check.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
size_t ast_json_array_size(const struct ast_json *array)
Get the size of a JSON array.
static struct ao2_container * endpoints
int messaging_app_subscribe_endpoint(const char *app_name, struct ast_endpoint *endpoint, message_received_cb callback, void *pvt)
Subscribe an application to an endpoint for messages.
void messaging_app_unsubscribe_endpoint(const char *app_name, const char *endpoint_id)
Subscribe for messages from a particular endpoint.
Stasis out-of-call text message support.
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.
struct ast_context * ast_context_find(const char *name)
Find a context.
struct ast_context * ast_context_find_or_create(struct ast_context **extcontexts, struct ast_hashtab *exttable, const char *name, const char *registrar)
Register a new context or find an existing one.
const char * app_name(struct ast_app *app)
void stasis_app_set_debug(struct stasis_app *app, int debug)
Enable/disable request/response and event logging on an application.
int app_subscribe_endpoint(struct stasis_app *app, struct ast_endpoint *endpoint)
Subscribes an application to a endpoint.
static int forwards_filter_by_type(void *obj, void *arg, int flags)
static struct ast_json * channel_destroyed_event(struct ast_channel_snapshot *snapshot, const struct timeval *tv)
static struct ast_json * channel_connected_line(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *tv)
static int subscribe_bridge(struct stasis_app *app, void *obj)
int app_is_subscribed_endpoint_id(struct stasis_app *app, const char *endpoint_id)
Test if an app is subscribed to a endpoint.
int app_unsubscribe_bridge_id(struct stasis_app *app, const char *bridge_id)
Cancel the subscription an app has for a bridge.
int app_subscribe_bridge(struct stasis_app *app, struct ast_bridge *bridge)
Add a bridge subscription to an existing channel subscription.
static struct app_forwards * forwards_create_channel(struct stasis_app *app, struct ast_channel *chan)
void app_update(struct stasis_app *app, stasis_app_cb handler, void *data)
Update the handler and data for a res_stasis application.
struct stasis_topic * ast_app_get_topic(struct stasis_app *app)
Returns the stasis topic for an app.
static int app_event_filter_set(struct stasis_app *app, struct ast_json **member, struct ast_json *filter, const char *filter_type)
static struct ast_json * channel_callerid(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *tv)
static struct ast_json * channel_state(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *tv)
Handle channel state changes.
int stasis_app_event_allowed(const char *app_name, struct ast_json *event)
Check if the given event should be filtered.
static void sub_endpoint_update_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void * channel_find(const struct stasis_app *app, const char *id)
static int bridge_app_subscribed(struct stasis_app *app, const char *uniqueid)
Helper function for determining if the application is subscribed to a given entity.
struct ast_json *(* channel_snapshot_monitor)(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *tv)
Typedef for callbacks that get called on channel snapshot updates.
static int subscribe_channel(struct stasis_app *app, void *obj)
int app_is_subscribed_channel_id(struct stasis_app *app, const char *channel_id)
Test if an app is subscribed to a channel.
void stasis_app_unregister_event_sources(void)
Unregister core event sources.
int app_unsubscribe_bridge(struct stasis_app *app, struct ast_bridge *bridge)
Cancel the bridge subscription for an application.
void app_shutdown(struct stasis_app *app)
Tears down an application.
static int bridge_app_subscribed_involved(struct stasis_app *app, struct ast_bridge_snapshot *snapshot)
Callback function for checking if channels in a bridge are subscribed to.
int app_unsubscribe_channel(struct stasis_app *app, struct ast_channel *chan)
Cancel the subscription an app has for a channel.
static void app_dtor(void *obj)
void stasis_app_set_debug_by_name(const char *app_name, int debug)
Enable/disable request/response and event logging on an application.
static struct ast_json * channel_created_event(struct ast_channel_snapshot *snapshot, const struct timeval *tv)
static int message_received_handler(const char *endpoint_id, struct ast_json *json_msg, void *pvt)
int app_subscribe_channel(struct stasis_app *app, struct ast_channel *chan)
Subscribes an application to a channel.
static void call_forwarded_handler(struct stasis_app *app, struct stasis_message *message)
int app_is_finished(struct stasis_app *app)
Checks whether a deactivated app has no channels.
struct ast_json * stasis_app_event_filter_to_json(struct stasis_app *app, struct ast_json *json)
Convert and add the app's event type filter(s) to the given json object.
void stasis_app_register_event_sources(void)
Register core event sources.
static void sub_subscription_change_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void sub_default_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static struct ast_json * simple_endpoint_event(const char *type, struct ast_endpoint_snapshot *snapshot, const struct timeval *tv)
struct stasis_app_event_source bridge_event_source
int stasis_app_event_filter_set(struct stasis_app *app, struct ast_json *filter)
Set the application's event type filter.
struct stasis_app * app_create(const char *name, stasis_app_cb handler, void *data, enum stasis_app_subscription_model subscription_model)
Create a res_stasis application.
static struct ast_json * channel_state_change_event(struct ast_channel_snapshot *snapshot, const struct timeval *tv)
int app_unsubscribe_endpoint_id(struct stasis_app *app, const char *endpoint_id)
Cancel the subscription an app has for a endpoint.
void stasis_app_set_global_debug(int debug)
Enable/disable request/response and event logging on all applications.
int stasis_app_get_debug(struct stasis_app *app)
Get debug status of an application.
static void bridge_subscription_change_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
void stasis_app_to_cli(const struct stasis_app *app, struct ast_cli_args *a)
Dump properties of a stasis_app to the CLI.
static struct app_forwards * forwards_create_bridge(struct stasis_app *app, struct ast_bridge *bridge)
static void bridge_blind_transfer_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void endpoint_state_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void * endpoint_find(const struct stasis_app *app, const char *id)
static void forwards_dtor(void *obj)
static void bridge_attended_transfer_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void bridge_merge_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct stasis_app_event_source channel_event_source
static void sub_bridge_update_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
int app_is_active(struct stasis_app *app)
Checks whether an app is active.
static struct ast_json * simple_bridge_event(const char *type, struct ast_bridge_snapshot *snapshot, const struct timeval *tv)
static void forwards_unsubscribe(struct app_forwards *forwards)
static void sub_channel_update_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct ast_json * app_to_json(const struct stasis_app *app)
Create a JSON representation of a stasis_app.
int app_unsubscribe_channel_id(struct stasis_app *app, const char *channel_id)
Cancel the subscription an app has for a channel.
static struct ast_json * channel_dialplan(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *tv)
int app_is_subscribed_bridge_id(struct stasis_app *app, const char *bridge_id)
Test if an app is subscribed to a bridge.
static struct ast_json * simple_channel_event(const char *type, struct ast_channel_snapshot *snapshot, const struct timeval *tv)
const char * stasis_app_name(const struct stasis_app *app)
Retrieve an application's name.
void app_deactivate(struct stasis_app *app)
Deactivates an application.
static int forwards_sort(const void *obj_left, const void *obj_right, int flags)
static channel_snapshot_monitor channel_monitors[]
static struct app_forwards * forwards_create(struct stasis_app *app, const char *id)
static int app_events_allowed_set(struct stasis_app *app, struct ast_json *filter)
static void * bridge_find(const struct stasis_app *app, const char *id)
struct stasis_app_event_source endpoint_event_source
static int unsubscribe(struct stasis_app *app, const char *kind, const char *id, int terminate)
static int app_events_disallowed_set(struct stasis_app *app, struct ast_json *filter)
static int app_event_filter_matched(struct ast_json *array, struct ast_json *event, int empty)
int stasis_app_get_debug_by_name(const char *app_name)
Get debug status of an application.
void app_send(struct stasis_app *app, struct ast_json *message)
Send a message to an application.
static struct app_forwards * forwards_create_endpoint(struct stasis_app *app, struct ast_endpoint *endpoint)
static int subscribe_endpoint(struct stasis_app *app, void *obj)
Internal API for the Stasis application controller.
stasis_app_subscription_model
@ STASIS_APP_SUBSCRIBE_ALL
An application is automatically subscribed to all resources in Asterisk, even if it does not control ...
struct stasis_forward * sub
static int debug
Global debug status.
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
struct ast_json * stasis_message_to_json(struct stasis_message *msg, struct stasis_message_sanitizer *sanitize)
Build the JSON representation of the message.
struct stasis_forward * stasis_forward_cancel(struct stasis_forward *forward)
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
@ STASIS_SUBSCRIPTION_FORMATTER_JSON
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
int stasis_subscription_final_message(struct stasis_subscription *sub, struct stasis_message *msg)
Determine whether a message is the final message to be received on a subscription.
struct stasis_forward * stasis_forward_all(struct stasis_topic *from_topic, struct stasis_topic *to_topic)
Create a subscription which forwards all messages from one topic to another.
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
const struct timeval * stasis_message_timestamp(const struct stasis_message *msg)
Get the time when a message was created.
Stasis Application API. See Stasis Application API for detailed documentation.
struct stasis_message_sanitizer * stasis_app_get_sanitizer(void)
Get the Stasis message sanitizer for app_stasis applications.
struct ast_bridge * stasis_app_bridge_find_by_id(const char *bridge_id)
Returns the bridge with the given id.
void stasis_app_unregister_event_source(struct stasis_app_event_source *obj)
Unregister an application event source.
void(* stasis_app_cb)(void *data, const char *app_name, struct ast_json *message)
Callback for Stasis application handler.
struct stasis_app * stasis_app_get_by_name(const char *name)
Retrieve a handle to a Stasis application by its name.
void stasis_app_register_event_source(struct stasis_app_event_source *obj)
Register an application event source.
struct ao2_container * stasis_app_get_all(void)
Gets the names of all registered Stasis applications.
struct ast_json * ast_bridge_snapshot_to_json(const struct ast_bridge_snapshot *snapshot, const struct stasis_message_sanitizer *sanitize)
Build a JSON object from a ast_bridge_snapshot.
struct stasis_message_type * ast_bridge_snapshot_type(void)
Message type for ast_bridge_snapshot.
struct stasis_message_type * ast_blind_transfer_type(void)
Message type for ast_blind_transfer_message.
struct stasis_topic * ast_bridge_topic(struct ast_bridge *bridge)
A topic which publishes the events for a particular bridge.
struct stasis_message_type * ast_attended_transfer_type(void)
Message type for ast_attended_transfer_message.
struct stasis_message_type * ast_bridge_merge_message_type(void)
Message type for ast_bridge_merge_message.
struct stasis_topic * ast_bridge_topic_all(void)
A topic which publishes the events for all bridges.
@ AST_ATTENDED_TRANSFER_DEST_BRIDGE_MERGE
@ AST_ATTENDED_TRANSFER_DEST_LINK
@ AST_ATTENDED_TRANSFER_DEST_THREEWAY
int ast_channel_snapshot_connected_line_equal(const struct ast_channel_snapshot *old_snapshot, const struct ast_channel_snapshot *new_snapshot)
Compares the connected line info of two snapshots.
struct ast_json * ast_channel_snapshot_to_json(const struct ast_channel_snapshot *snapshot, const struct stasis_message_sanitizer *sanitize)
Build a JSON object from a ast_channel_snapshot.
int ast_channel_snapshot_caller_id_equal(const struct ast_channel_snapshot *old_snapshot, const struct ast_channel_snapshot *new_snapshot)
Compares the callerid info of two snapshots.
int ast_channel_snapshot_cep_equal(const struct ast_channel_snapshot *old_snapshot, const struct ast_channel_snapshot *new_snapshot)
Compares the context, exten and priority of two snapshots.
struct ast_json * ast_endpoint_snapshot_to_json(const struct ast_endpoint_snapshot *snapshot, const struct stasis_message_sanitizer *sanitize)
Build a JSON object from a ast_endpoint_snapshot.
#define stasis_message_router_create(topic)
Create a new message router object.
void stasis_message_router_unsubscribe(struct stasis_message_router *router)
Unsubscribe the router from the upstream topic.
int stasis_message_router_add(struct stasis_message_router *router, struct stasis_message_type *message_type, stasis_subscription_cb callback, void *data)
Add a route to a message router.
int stasis_message_router_add_cache_update(struct stasis_message_router *router, struct stasis_message_type *message_type, stasis_subscription_cb callback, void *data)
Add a route for stasis_cache_update messages to a message router.
void stasis_message_router_set_formatters_default(struct stasis_message_router *router, stasis_subscription_cb callback, void *data, enum stasis_subscription_message_formatters formatters)
Sets the default route of a router with formatters.
int ast_strings_equal(const char *str1, const char *str2)
Compare strings for equality checking for NULL.
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...
enum forward_type forward_type
struct stasis_forward * topic_forward
struct stasis_forward * topic_cached_forward
Message representing attended transfer.
union ast_attended_transfer_message::@284 dest
enum ast_attended_transfer_dest_type dest_type
struct ast_channel_snapshot * links[2]
struct ast_bridge_channel_snapshot_pair to_transfer_target
struct ast_bridge_channel_snapshot_pair threeway
struct ast_bridge_channel_snapshot_pair to_transferee
char bridge[AST_UUID_STR_LEN]
Message published during a blind transfer.
struct ast_bridge_snapshot * bridge
struct ast_channel_snapshot * transferer
struct ast_bridge_snapshot * bridge_snapshot
struct ast_channel_snapshot * channel_snapshot
Message representing the merge of two bridges.
struct ast_bridge_snapshot * from
struct ast_bridge_snapshot * to
Structure that contains a snapshot of information about a bridge.
const ast_string_field uniqueid
struct ao2_container * channels
Structure that contains information about a bridge.
const ast_string_field uniqueid
const ast_string_field uniqueid
const ast_string_field data
const ast_string_field appl
Structure representing a change of snapshot of channel state.
Structure representing a snapshot of channel state.
struct ast_channel_snapshot_dialplan * dialplan
struct ast_channel_snapshot_base * base
enum ast_channel_state state
struct ast_channel_snapshot_caller * caller
struct ast_channel_snapshot_hangup * hangup
Main Channel structure associated with a channel.
struct ast_channel_snapshot * snapshot
A snapshot of an endpoint's state.
const ast_string_field id
Abstract JSON element (object, array, string, int, ...).
A multi channel blob data structure for multi_channel_blob stasis messages.
Event source information and callbacks.
const char * scheme
The scheme to match against on [un]subscribes.
struct stasis_topic * topic
struct ast_json * events_disallowed
struct stasis_message_router * router
struct ao2_container * forwards
struct stasis_message_router * bridge_router
struct ast_json * events_allowed
enum stasis_app_subscription_model subscription_model
struct stasis_message_router * endpoint_router
static void handler(const char *name, int response_code, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
#define ast_test_flag(p, flag)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
char * ast_eid_to_str(char *s, int maxlen, struct ast_eid *eid)
Convert an EID to a string.
struct ast_eid ast_eid_default
Global EID.