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);
257 static 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;
300 strcpy(context_name,
"stasis-");
301 strcat(context_name, app->
name);
371 typedef 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;
870 int debug_enabled = 0;
884 return debug_enabled;
920 size_t context_size = strlen(
"stasis-") + strlen(name) + 1;
928 ast_verb(1,
"Creating Stasis app '%s'\n", name);
930 size =
sizeof(*app) + strlen(name) + 1;
940 if (!
app->forwards) {
944 ret =
ast_asprintf(&topic_name,
"ari:application/%s", name);
956 if (!
app->bridge_router) {
1004 strncpy(
app->name, name, size -
sizeof(*
app));
1010 strcpy(context_name,
"stasis-");
1011 strcat(context_name, name);
1014 ast_log(
LOG_WARNING,
"Could not create context '%s' for Stasis application '%s'\n", context_name, name);
1020 ast_log(
LOG_WARNING,
"Not creating context '%s' for Stasis application '%s' because it already exists\n",
1021 context_name, name);
1061 "Inactive Stasis app '%s' missed message\n", app->
name);
1070 ast_verb(1,
"Deactivating Stasis app '%s'\n", app->
name);
1125 "type",
"ApplicationReplaced",
1127 "application", app->
name);
1148 ast_verb(1,
"Activating Stasis app '%s'\n", app->
name);
1183 " Subscription Model: %s\n",
1185 app->
debug ?
"Yes" :
"No",
1187 "Global Resource Subscription" :
1188 "Application/Explicit Resource Subscription");
1239 "channel_ids",
"bridge_ids",
"endpoint_ids");
1268 if (append_res != 0) {
1323 ast_debug(3,
"Channel '%s' is %d interested in %s\n",
1344 if (!strcmp(kind,
"bridge")) {
1346 }
else if (!strcmp(kind,
"channel")) {
1348 }
else if (!strcmp(kind,
"endpoint")) {
1360 ast_debug(3,
"App '%s' not subscribed to %s '%s'\n", app->
name, kind,
id);
1366 if (forwards->
interested == 0 || terminate) {
1368 ast_debug(3,
"%s '%s' unsubscribed from %s\n", kind,
id, app->
name);
1374 if (!strcmp(kind,
"endpoint")) {
1399 return unsubscribe(app,
"channel", channel_id, 0);
1412 return forwards !=
NULL;
1470 ast_debug(3,
"Bridge '%s' is %d interested in %s\n",
1515 return forwards !=
NULL;
1576 ast_debug(3,
"Endpoint '%s' is %d interested in %s\n",
1598 return unsubscribe(app,
"endpoint", endpoint_id, 0);
1611 return forwards !=
NULL;
1643 if (!app || !json) {
1674 ast_log(
LOG_ERROR,
"Invalid json type event filter - app: %s, filter: %s\n",
1675 app->
name, filter_type);
1689 "filter: %s\n", app->
name, filter_type);
struct ast_json * events_allowed
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_app * stasis_app_get_by_name(const char *name)
Retrieve a handle to a Stasis application by its name.
static struct app_forwards * forwards_create_bridge(struct stasis_app *app, struct ast_bridge *bridge)
const ast_string_field data
struct ao2_container * channels
Main Channel structure associated with a channel.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
void stasis_app_set_debug_by_name(const char *app_name, int debug)
Enable/disable request/response and event logging on an application.
static void sub_bridge_update_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct ast_channel_snapshot_base * base
union ast_attended_transfer_message::@324 dest
Asterisk main include file. File version handling, generic pbx functions.
static struct ast_json * simple_channel_event(const char *type, struct ast_channel_snapshot *snapshot, const struct timeval *tv)
const ast_string_field uniqueid
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
struct stasis_message * old_snapshot
Old value from the cache.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
static int forwards_filter_by_type(void *obj, void *arg, int flags)
static void bridge_blind_transfer_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
Message representing attended transfer.
#define ao2_t_alloc(data_size, destructor_fn, debug_msg)
stasis_app_subscription_model
size_t ast_json_object_size(struct ast_json *object)
Get size of JSON object.
char * ast_eid_to_str(char *s, int maxlen, struct ast_eid *eid)
Convert an EID to a string.
#define ast_channel_unref(c)
Decrease channel reference count.
The arg parameter is a search key, but is not an object.
const char * ast_describe_caller_presentation(int data)
Convert caller ID pres value to explanatory string.
#define ast_test_flag(p, flag)
static void sub_channel_update_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
int stasis_app_get_debug_by_name(const char *app_name)
Get debug status of an application.
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
Message published during a blind transfer.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
static struct ast_json * channel_created_event(struct ast_channel_snapshot *snapshot, const struct timeval *tv)
static void sub_subscription_change_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
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.
static int forwards_sort(const void *obj_left, const void *obj_right, int flags)
const char * scheme
The scheme to match against on [un]subscribes.
static struct ast_json * channel_state_change_event(struct ast_channel_snapshot *snapshot, const struct timeval *tv)
static void app_dtor(void *obj)
#define ao2_callback(c, flags, cb_fn, arg)
void ao2_iterator_cleanup(struct ao2_iterator *iter)
struct stasis_message_type * ast_endpoint_snapshot_type(void)
Message type for ast_endpoint_snapshot.
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.
Structure that contains a snapshot of information about a bridge.
const ast_string_field video_source_id
void app_deactivate(struct stasis_app *app)
Deactivates an application.
Structure representing a snapshot of channel state.
static int subscribe_channel(struct stasis_app *app, void *obj)
static void bridge_attended_transfer_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void forwards_dtor(void *obj)
Assume that the ao2_container is already locked.
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
struct stasis_topic * ast_endpoint_topic(struct ast_endpoint *endpoint)
Returns the topic for a specific endpoint.
int app_unsubscribe_channel(struct stasis_app *app, struct ast_channel *chan)
Cancel the subscription an app has for a channel.
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.
static int app_event_filter_set(struct stasis_app *app, struct ast_json **member, struct ast_json *filter, const char *filter_type)
const ast_string_field uniqueid
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
int stasis_app_event_filter_set(struct stasis_app *app, struct ast_json *filter)
Set the application's event type filter.
void app_shutdown(struct stasis_app *app)
Tears down an application.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
#define ao2_alloc_options(data_size, destructor_fn, options)
#define ao2_link_flags(container, obj, flags)
static void endpoint_state_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
int app_unsubscribe_bridge_id(struct stasis_app *app, const char *bridge_id)
Cancel the subscription an app has for a bridge.
const ast_string_field id
#define ast_strdup(str)
A wrapper for strdup()
struct ast_endpoint * ast_endpoint_find_by_id(const char *id)
Finds the endpoint with the given tech[/resource] id.
char bridge[AST_UUID_STR_LEN]
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.
static void sub_default_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct stasis_forward * topic_cached_forward
void stasis_app_set_debug(struct stasis_app *app, int debug)
Enable/disable request/response and event logging on an application.
void ast_cli(int fd, const char *fmt,...)
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.
Structure representing a change of snapshot of channel state.
void ast_free_ptr(void *ptr)
free() wrapper
struct ast_channel_snapshot_dialplan * dialplan
#define ast_verb(level,...)
struct ast_bridge_channel_snapshot_pair to_transferee
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.
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 app_is_active(struct stasis_app *app)
Checks whether an app is active.
int app_is_subscribed_channel_id(struct stasis_app *app, const char *channel_id)
Test if an app is subscribed to a channel.
struct stasis_topic * ast_endpoint_topic_all_cached(void)
Cached topic for all endpoint related messages.
struct ast_json * stasis_message_to_json(struct stasis_message *msg, struct stasis_message_sanitizer *sanitize)
Build the JSON representation of the message.
int app_subscribe_bridge(struct stasis_app *app, struct ast_bridge *bridge)
Add a bridge subscription to an existing channel subscription.
static const char context_name[]
int ast_json_object_set(struct ast_json *object, const char *key, struct ast_json *value)
Set a field in a JSON object.
#define ast_asprintf(ret, fmt,...)
A wrapper for asprintf()
static channel_snapshot_monitor channel_monitors[]
static int app_events_allowed_set(struct stasis_app *app, struct ast_json *filter)
int app_is_subscribed_endpoint_id(struct stasis_app *app, const char *endpoint_id)
Test if an app is subscribed to a endpoint.
int ast_context_destroy_by_name(const char *context, const char *registrar)
Destroy a context by name.
#define ast_strlen_zero(foo)
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.
struct stasis_message_router * endpoint_router
enum forward_type forward_type
void stasis_app_to_cli(const struct stasis_app *app, struct ast_cli_args *a)
Dump properties of a stasis_app to the CLI.
struct ast_bridge_channel_snapshot_pair to_transfer_target
static int subscribe_endpoint(struct stasis_app *app, void *obj)
struct ao2_container * forwards
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
#define ast_debug(level,...)
Log a DEBUG message.
struct stasis_message_type * ast_bridge_merge_message_type(void)
Message type for ast_bridge_merge_message.
int stasis_app_event_allowed(const char *app_name, struct ast_json *event)
Check if the given event should be filtered.
void stasis_app_unregister_event_sources(void)
Unregister core event sources.
struct ast_context * ast_context_find(const char *name)
Find a context.
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.
struct stasis_app_event_source bridge_event_source
struct ast_channel_snapshot * links[2]
static struct app_forwards * forwards_create_endpoint(struct stasis_app *app, struct ast_endpoint *endpoint)
const ast_string_field appl
static struct ast_json * channel_callerid(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *tv)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
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.
struct ast_json * ast_json_string_create(const char *value)
Construct a JSON string from value.
static void call_forwarded_handler(struct stasis_app *app, struct stasis_message *message)
Event source information and callbacks.
static struct ast_json * simple_bridge_event(const char *type, struct ast_bridge_snapshot *snapshot, const struct timeval *tv)
const struct timeval * stasis_message_timestamp(const struct stasis_message *msg)
Get the time when a message was created.
#define ast_json_object_string_get(object, key)
Get a string field from a JSON object.
static struct ao2_container * endpoints
#define ao2_ref(o, delta)
struct stasis_message_type * stasis_cache_update_type(void)
Message type for cache update messages.
static int unsubscribe(struct stasis_app *app, const char *kind, const char *id, int terminate)
#define ast_strdupa(s)
duplicate a string in memory from the stack
struct ast_channel_snapshot_hangup * hangup
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
struct ast_bridge_snapshot * bridge
struct stasis_topic * ast_app_get_topic(struct stasis_app *app)
Returns the stasis topic for an 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 channel_usage channels
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
struct stasis_app_event_source endpoint_event_source
const char * stasis_app_name(const struct stasis_app *app)
Retrieve an application's name.
struct ast_bridge_snapshot * old_snapshot
Internal API for the Stasis application controller.
int app_is_finished(struct stasis_app *app)
Checks whether a deactivated app has no channels.
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
#define stasis_message_router_create(topic)
struct ast_json * ast_json_timeval(const struct timeval tv, const char *zone)
Construct a timeval as JSON.
A snapshot of an endpoint's state.
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
static void * channel_find(const struct stasis_app *app, const char *id)
struct stasis_topic * ast_endpoint_topic_cached(struct ast_endpoint *endpoint)
Returns the topic for a specific endpoint.
const char * ast_channel_uniqueid(const struct ast_channel *chan)
struct ast_channel_snapshot_caller * caller
enum ast_attended_transfer_dest_type dest_type
void stasis_app_unregister_event_source(struct stasis_app_event_source *obj)
Unregister an application event source.
struct stasis_topic * ast_channel_topic(struct ast_channel *chan)
A topic which publishes the events for a particular channel.
static void * endpoint_find(const struct stasis_app *app, const char *id)
struct stasis_message * new_snapshot
New value.
static struct ast_json * channel_dialplan(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *tv)
Structure that contains information about a bridge.
static struct ast_json * channel_connected_line(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *tv)
static struct ast_json * simple_endpoint_event(const char *type, struct ast_endpoint_snapshot *snapshot, const struct timeval *tv)
void app_send(struct stasis_app *app, struct ast_json *message)
Send a message to the given application.
struct stasis_message_sanitizer * stasis_app_get_sanitizer(void)
Get the Stasis message sanitizer for app_stasis applications.
struct ast_channel_snapshot * transferer
struct ast_channel_snapshot * channel_snapshot
int app_subscribe_endpoint(struct stasis_app *app, struct ast_endpoint *endpoint)
Subscribes an application to a endpoint.
static struct ast_json * channel_destroyed_event(struct ast_channel_snapshot *snapshot, const struct timeval *tv)
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.
struct stasis_message_router * router
static int array(struct ast_channel *chan, const char *cmd, char *var, const char *value)
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
static int message_received_handler(const char *endpoint_id, struct ast_json *json_msg, void *pvt)
struct stasis_message_type * ast_endpoint_state_type(void)
Message type for endpoint state changes.
struct ast_bridge * stasis_app_bridge_find_by_id(const char *bridge_id)
Returns the bridge with the given id.
struct stasis_message_type * type
Convenience reference to snapshot type.
int ast_strings_equal(const char *str1, const char *str2)
Compare strings for equality checking for NULL.
static void forwards_unsubscribe(struct app_forwards *forwards)
const char * app_name(struct ast_app *app)
#define ao2_iterator_next(iter)
struct ast_bridge_channel_snapshot_pair threeway
struct stasis_message_type * ast_attended_transfer_type(void)
Message type for ast_attended_transfer_message.
struct ast_json * events_disallowed
static struct ao2_container * bridges
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 ast_bridge_snapshot * bridge_snapshot
struct stasis_app_event_source channel_event_source
struct stasis_topic * topic
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.
struct stasis_forward * topic_forward
const char * ast_cause2str(int state) attribute_pure
Gives the string form of a given cause code.
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
struct ao2_container * stasis_app_get_all(void)
Gets the names of all registered Stasis applications.
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.
static void bridge_subscription_change_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct stasis_forward * stasis_forward_cancel(struct stasis_forward *forward)
enum ast_json_type ast_json_typeof(const struct ast_json *value)
Get the type of value.
struct ast_channel_snapshot * new_snapshot
enum ast_channel_state state
#define ao2_find(container, arg, flags)
const ast_string_field uniqueid
struct ast_bridge_snapshot * new_snapshot
struct stasis_message_type * ast_channel_snapshot_type(void)
Message type for ast_channel_snapshot_update.
struct ast_channel_snapshot * old_snapshot
int stasis_app_get_debug(struct stasis_app *app)
Get debug status of an application.
void(* stasis_app_cb)(void *data, const char *app_name, struct ast_json *message)
Callback for Stasis application handler.
struct ast_bridge_snapshot * from
struct stasis_topic * ast_bridge_topic_all(void)
A topic which publishes the events for all bridges.
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.
struct ast_eid ast_eid_default
Global EID.
int app_unsubscribe_endpoint_id(struct stasis_app *app, const char *endpoint_id)
Cancel the subscription an app has for a endpoint.
static void * bridge_find(const struct stasis_app *app, const char *id)
Message representing the merge of two bridges.
struct ast_json * app_to_json(const struct stasis_app *app)
Create a JSON representation of a stasis_app.
static int subscribe_bridge(struct stasis_app *app, void *obj)
#define ao2_replace(dst, src)
void stasis_app_set_global_debug(int debug)
Enable/disable request/response and event logging on all applications.
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.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Standard Command Line Interface.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
int app_unsubscribe_bridge(struct stasis_app *app, struct ast_bridge *bridge)
Cancel the bridge subscription for an application.
static struct app_forwards * forwards_create(struct stasis_app *app, const char *id)
Internal API for the Stasis application controller.
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 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.
A multi channel blob data structure for multi_channel_blob stasis messages.
void app_update(struct stasis_app *app, stasis_app_cb handler, void *data)
Update the handler and data for a res_stasis application.
void stasis_message_router_unsubscribe(struct stasis_message_router *router)
Unsubscribe the router from the upstream topic.
void stasis_app_register_event_sources(void)
Register core event sources.
size_t ast_json_array_size(const struct ast_json *array)
Get the size of a JSON array.
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.
struct stasis_forward * sub
struct stasis_message_type * ast_endpoint_contact_state_type(void)
Message type for endpoint contact state changes.
static void sub_endpoint_update_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
Abstract JSON element (object, array, string, int, ...).
int app_subscribe_channel(struct stasis_app *app, struct ast_channel *chan)
Subscribes an application to a channel.
struct stasis_message_type * stasis_subscription_change_type(void)
Gets the message type for subscription change notices.
#define ao2_container_alloc_rbtree(ao2_options, container_options, sort_fn, cmp_fn)
struct stasis_message_type * ast_channel_dial_type(void)
Message type for when a channel dials another channel.
int app_is_subscribed_bridge_id(struct stasis_app *app, const char *bridge_id)
Test if an app is subscribed to a bridge.
Stasis Application API. See Stasis Application API for detailed documentation.
struct stasis_topic * ast_bridge_topic(struct ast_bridge *bridge)
A topic which publishes the events for a particular bridge.
static int filter(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
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.
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.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
enum stasis_app_subscription_model subscription_model
struct ast_json * ast_json_array_get(const struct ast_json *array, size_t index)
Get an element from an array.
#define AST_JSON_UTF8_VALIDATE(str)
Check str for UTF-8 and replace with an empty string if fails the check.
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
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.
static int app_event_filter_matched(struct ast_json *array, struct ast_json *event, int empty)
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.
Reject duplicate objects in container.
const char * ast_endpoint_get_id(const struct ast_endpoint *endpoint)
Gets the tech/resource id of the given endpoint.
void stasis_app_register_event_source(struct stasis_app_event_source *obj)
Register an application event source.
struct stasis_message_router * bridge_router
static struct app_forwards * forwards_create_channel(struct stasis_app *app, struct ast_channel *chan)
static void bridge_merge_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct ast_bridge_snapshot * to
static int app_events_disallowed_set(struct stasis_app *app, struct ast_json *filter)