Asterisk - The Open Source Telephony Project
18.5.0
|
Stasis Application API. See Stasis Application API for detailed documentation. More...
#include "asterisk/channel.h"
Go to the source code of this file.
Data Structures | |
struct | stasis_app_control_rule |
Rule to check to see if an operation is allowed. More... | |
struct | stasis_app_event_source |
Event source information and callbacks. More... | |
enum | stasis_app_user_event_res { STASIS_APP_USER_OK, STASIS_APP_USER_APP_NOT_FOUND, STASIS_APP_USER_EVENT_SOURCE_NOT_FOUND, STASIS_APP_USER_EVENT_SOURCE_BAD_SCHEME, STASIS_APP_USER_USEREVENT_INVALID, STASIS_APP_USER_INTERNAL_ERROR } |
Return code for stasis_app_user_event. More... | |
enum | stasis_app_subscribe_res { STASIS_ASR_OK, STASIS_ASR_APP_NOT_FOUND, STASIS_ASR_EVENT_SOURCE_NOT_FOUND, STASIS_ASR_EVENT_SOURCE_BAD_SCHEME, STASIS_ASR_INTERNAL_ERROR } |
Return code for stasis_app_[un]subscribe. More... | |
typedef void(* | stasis_app_cb) (void *data, const char *app_name, struct ast_json *message) |
Callback for Stasis application handler. More... | |
struct ao2_container * | stasis_app_get_all (void) |
Gets the names of all registered Stasis applications. More... | |
struct stasis_app * | stasis_app_get_by_name (const char *name) |
Retrieve a handle to a Stasis application by its name. More... | |
int | stasis_app_register (const char *app_name, stasis_app_cb handler, void *data) |
Register a new Stasis application. More... | |
int | stasis_app_register_all (const char *app_name, stasis_app_cb handler, void *data) |
Register a new Stasis application that receives all Asterisk events. More... | |
void | stasis_app_unregister (const char *app_name) |
Unregister a Stasis application. More... | |
int | stasis_app_send (const char *app_name, struct ast_json *message) |
Send a message to the given Stasis application. More... | |
const char * | stasis_app_name (const struct stasis_app *app) |
Retrieve an application's name. More... | |
struct ast_json * | stasis_app_object_to_json (struct stasis_app *app) |
Return the JSON representation of a Stasis application. More... | |
struct ast_json * | stasis_app_to_json (const char *app_name) |
Return the JSON representation of a Stasis application. More... | |
void | stasis_app_register_event_source (struct stasis_app_event_source *obj) |
Register an application event source. More... | |
void | stasis_app_register_event_sources (void) |
Register core event sources. More... | |
void | stasis_app_unregister_event_source (struct stasis_app_event_source *obj) |
Unregister an application event source. More... | |
void | stasis_app_unregister_event_sources (void) |
Unregister core event sources. More... | |
enum stasis_app_user_event_res | stasis_app_user_event (const char *app_name, const char *event_name, const char **source_uris, int sources_count, struct ast_json *json_variables) |
Generate a Userevent for stasis app (echo to AMI) More... | |
enum stasis_app_subscribe_res | stasis_app_subscribe (const char *app_name, const char **event_source_uris, int event_sources_count, struct ast_json **json) |
Subscribes an application to a list of event sources. More... | |
enum stasis_app_subscribe_res | stasis_app_unsubscribe (const char *app_name, const char **event_source_uris, int event_sources_count, struct ast_json **json) |
Unsubscribes an application from a list of event sources. More... | |
enum stasis_app_subscribe_res | stasis_app_subscribe_channel (const char *app_name, struct ast_channel *chan) |
Directly subscribe an application to a channel. More... | |
enum | stasis_app_control_channel_result { STASIS_APP_CHANNEL_OKAY = 0, STASIS_APP_CHANNEL_RECORDING } |
Result codes used when adding/removing channels to/from bridges. More... | |
void | stasis_app_control_register_add_rule (struct stasis_app_control *control, struct stasis_app_control_rule *rule) |
Registers an add channel to bridge rule. More... | |
void | stasis_app_control_unregister_add_rule (struct stasis_app_control *control, struct stasis_app_control_rule *rule) |
UnRegister an add channel to bridge rule. More... | |
void | stasis_app_control_register_remove_rule (struct stasis_app_control *control, struct stasis_app_control_rule *rule) |
Registers a remove channel from bridge rule. More... | |
void | stasis_app_control_unregister_remove_rule (struct stasis_app_control *control, struct stasis_app_control_rule *rule) |
Unregisters a remove channel from bridge rule. More... | |
struct stasis_app_control * | stasis_app_control_find_by_channel (const struct ast_channel *chan) |
Returns the handler for the given channel. More... | |
struct stasis_app_control * | stasis_app_control_find_by_channel_id (const char *channel_id) |
Returns the handler for the channel with the given id. More... | |
struct stasis_app_control * | stasis_app_control_create (struct ast_channel *chan) |
Creates a control handler for a channel that isn't in a stasis app. More... | |
void | stasis_app_control_execute_until_exhausted (struct ast_channel *chan, struct stasis_app_control *control) |
Act on a stasis app control queue until it is empty. More... | |
int | stasis_app_control_is_done (struct stasis_app_control *control) |
Check if a control is marked as done. More... | |
void | stasis_app_control_flush_queue (struct stasis_app_control *control) |
Flush the control command queue. More... | |
const char * | stasis_app_control_get_channel_id (const struct stasis_app_control *control) |
Returns the uniqueid of the channel associated with this control. More... | |
int | stasis_app_control_add_role (struct stasis_app_control *control, const char *role) |
Apply a bridge role to a channel controlled by a stasis app control. More... | |
void | stasis_app_control_clear_roles (struct stasis_app_control *control) |
Clear bridge roles currently applied to a channel controlled by a stasis app control. More... | |
int | stasis_app_control_continue (struct stasis_app_control *control, const char *context, const char *extension, int priority) |
Exit res_stasis and continue execution in the dialplan. More... | |
int | stasis_app_control_move (struct stasis_app_control *control, const char *app_name, const char *app_args) |
Exit res_stasis and move to another Stasis application. More... | |
int | stasis_app_control_redirect (struct stasis_app_control *control, const char *endpoint) |
Redirect a channel in res_stasis to a particular endpoint. More... | |
int | stasis_app_control_ring (struct stasis_app_control *control) |
Indicate ringing to the channel associated with this control. More... | |
int | stasis_app_control_ring_stop (struct stasis_app_control *control) |
Stop locally generated ringing on the channel associated with this control. More... | |
int | stasis_app_control_dtmf (struct stasis_app_control *control, const char *dtmf, int before, int between, unsigned int duration, int after) |
Send DTMF to the channel associated with this control. More... | |
int | stasis_app_control_mute (struct stasis_app_control *control, unsigned int direction, enum ast_frame_type frametype) |
Mute the channel associated with this control. More... | |
int | stasis_app_control_unmute (struct stasis_app_control *control, unsigned int direction, enum ast_frame_type frametype) |
Unmute the channel associated with this control. More... | |
int | stasis_app_control_answer (struct stasis_app_control *control) |
Answer the channel associated with this control. More... | |
int | stasis_app_control_set_channel_var (struct stasis_app_control *control, const char *variable, const char *value) |
Set a variable on the channel associated with this control to value. More... | |
void | stasis_app_control_hold (struct stasis_app_control *control) |
Place the channel associated with the control on hold. More... | |
void | stasis_app_control_unhold (struct stasis_app_control *control) |
Remove the channel associated with the control from hold. More... | |
void | stasis_app_control_moh_start (struct stasis_app_control *control, const char *moh_class) |
Play music on hold to a channel (does not affect hold status) More... | |
void | stasis_app_control_moh_stop (struct stasis_app_control *control) |
Stop playing music on hold to a channel (does not affect hold status) More... | |
void | stasis_app_control_silence_start (struct stasis_app_control *control) |
Start playing silence to a channel. More... | |
void | stasis_app_control_silence_stop (struct stasis_app_control *control) |
Stop playing silence to a channel. More... | |
struct ast_channel_snapshot * | stasis_app_control_get_snapshot (const struct stasis_app_control *control) |
Returns the most recent snapshot for the associated channel. More... | |
void | stasis_app_control_publish (struct stasis_app_control *control, struct stasis_message *message) |
Publish a message to the control's channel's topic. More... | |
struct stasis_topic * | ast_app_get_topic (struct stasis_app *app) |
Returns the stasis topic for an app. More... | |
int | stasis_app_control_queue_control (struct stasis_app_control *control, enum ast_control_frame_type frame_type) |
Queue a control frame without payload. More... | |
struct ast_bridge * | stasis_app_bridge_create (const char *type, const char *name, const char *id) |
Create a bridge of the specified type. More... | |
struct ast_bridge * | stasis_app_bridge_create_invisible (const char *type, const char *name, const char *id) |
Create an invisible bridge of the specified type. More... | |
struct ast_bridge * | stasis_app_bridge_find_by_id (const char *bridge_id) |
Returns the bridge with the given id. More... | |
struct ast_channel * | stasis_app_bridge_moh_channel (struct ast_bridge *bridge) |
Finds or creates an announcer channel in a bridge that can play music on hold. More... | |
int | stasis_app_bridge_moh_stop (struct ast_bridge *bridge) |
Breaks down MOH channels playing on the bridge created by stasis_app_bridge_moh_channel. More... | |
struct ast_channel * | stasis_app_bridge_playback_channel_find (struct ast_bridge *bridge) |
Finds an existing ARI playback channel in a bridge. More... | |
int | stasis_app_bridge_playback_channel_add (struct ast_bridge *bridge, struct ast_channel *chan, struct stasis_app_control *control) |
Adds a channel to the list of ARI playback channels for bridges. More... | |
void | stasis_app_bridge_playback_channel_remove (char *bridge_id, struct stasis_app_control *control) |
remove channel from list of ARI playback channels for bridges. More... | |
int | stasis_app_control_add_channel_to_bridge (struct stasis_app_control *control, struct ast_bridge *bridge) |
Add a channel to the bridge. More... | |
int | stasis_app_control_remove_channel_from_bridge (struct stasis_app_control *control, struct ast_bridge *bridge) |
Remove a channel from the bridge. More... | |
int | stasis_app_control_bridge_features_init (struct stasis_app_control *control) |
Initialize bridge features into a channel control. More... | |
void | stasis_app_control_absorb_dtmf_in_bridge (struct stasis_app_control *control, int absorb) |
Set whether DTMF from the channel is absorbed instead of passing through to the bridge. More... | |
void | stasis_app_control_mute_in_bridge (struct stasis_app_control *control, int mute) |
Set whether audio from the channel is muted instead of passing through to the bridge. More... | |
void | stasis_app_control_inhibit_colp_in_bridge (struct stasis_app_control *control, int inhibit_colp) |
Set whether COLP frames should be generated when joining the bridge. More... | |
struct ast_bridge * | stasis_app_get_bridge (struct stasis_app_control *control) |
Gets the bridge currently associated with a control object. More... | |
void | stasis_app_bridge_destroy (const char *bridge_id) |
Destroy the bridge. More... | |
struct stasis_message_sanitizer * | stasis_app_get_sanitizer (void) |
Get the Stasis message sanitizer for app_stasis applications. More... | |
void | stasis_app_channel_set_stasis_end_published (struct ast_channel *chan) |
Indicate that this channel has had a StasisEnd published for it. More... | |
int | stasis_app_channel_is_stasis_end_published (struct ast_channel *chan) |
Has this channel had a StasisEnd published on it? More... | |
int | stasis_app_channel_is_internal (struct ast_channel *chan) |
Is this channel internal to Stasis? More... | |
int | stasis_app_channel_unreal_set_internal (struct ast_channel *chan) |
Mark this unreal channel and it's other half as being internal to Stasis. More... | |
int | stasis_app_channel_set_internal (struct ast_channel *chan) |
Mark this channel as being internal to Stasis. More... | |
int | stasis_app_control_dial (struct stasis_app_control *control, const char *dialstring, unsigned int timeout) |
Dial a channel. More... | |
void | stasis_app_control_shutdown (void) |
Let Stasis app internals shut down. More... | |
void | stasis_app_set_debug (struct stasis_app *app, int debug) |
Enable/disable request/response and event logging on an application. More... | |
void | stasis_app_set_debug_by_name (const char *app_name, int debug) |
Enable/disable request/response and event logging on an application. More... | |
int | stasis_app_get_debug (struct stasis_app *app) |
Get debug status of an application. More... | |
int | stasis_app_get_debug_by_name (const char *app_name) |
Get debug status of an application. More... | |
void | stasis_app_set_global_debug (int debug) |
Enable/disable request/response and event logging on all applications. More... | |
void | stasis_app_to_cli (const struct stasis_app *app, struct ast_cli_args *a) |
Dump properties of a stasis_app to the CLI. More... | |
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. More... | |
int | stasis_app_event_filter_set (struct stasis_app *app, struct ast_json *filter) |
Set the application's event type filter. More... | |
int | stasis_app_event_allowed (const char *app_name, struct ast_json *event) |
Check if the given event should be filtered. More... | |
Stasis Application API. See Stasis Application API for detailed documentation.
Definition in file stasis_app.h.
Callback for Stasis application handler.
The message given to the handler is a borrowed copy. If you want to keep a reference to it, you should use ao2_ref()
to keep it around.
data | Data ptr given when registered. |
app_name | Name of the application being dispatched to. |
message | Message to handle. (borrowed copy) |
Definition at line 67 of file stasis_app.h.
Result codes used when adding/removing channels to/from bridges.
Enumerator | |
---|---|
STASIS_APP_CHANNEL_OKAY | The channel is okay to be added/removed |
STASIS_APP_CHANNEL_RECORDING | The channel is currently recording |
Definition at line 777 of file stasis_app.h.
Return code for stasis_app_[un]subscribe.
Enumerator | |
---|---|
STASIS_ASR_OK | |
STASIS_ASR_APP_NOT_FOUND | |
STASIS_ASR_EVENT_SOURCE_NOT_FOUND | |
STASIS_ASR_EVENT_SOURCE_BAD_SCHEME | |
STASIS_ASR_INTERNAL_ERROR |
Definition at line 282 of file stasis_app.h.
Return code for stasis_app_user_event.
Definition at line 255 of file stasis_app.h.
struct stasis_topic* ast_app_get_topic | ( | struct stasis_app * | app | ) |
Returns the stasis topic for an app.
app | Stasis app to get topic of |
Definition at line 1028 of file res/stasis/app.c.
References stasis_app::topic.
Referenced by app_send_end_msg(), send_start_msg_snapshots(), and stasis_app_user_event().
struct ast_bridge* stasis_app_bridge_create | ( | const char * | type, |
const char * | name, | ||
const char * | id | ||
) |
Create a bridge of the specified type.
type | The type of bridge to be created |
name | Optional name to give to the bridge |
id | Optional Unique ID to give to the bridge |
NULL
on error. Definition at line 851 of file res_stasis.c.
References bridge_create_common().
Referenced by ast_ari_bridges_create(), and ast_ari_bridges_create_with_id().
struct ast_bridge* stasis_app_bridge_create_invisible | ( | const char * | type, |
const char * | name, | ||
const char * | id | ||
) |
Create an invisible bridge of the specified type.
type | The type of bridge to be created |
name | Optional name to give to the bridge |
id | Optional Unique ID to give to the bridge |
NULL
on error. Definition at line 856 of file res_stasis.c.
References bridge_create_common().
Referenced by get_dial_bridge().
void stasis_app_bridge_destroy | ( | const char * | bridge_id | ) |
Destroy the bridge.
bridge_id | Uniqueid of bridge to be destroyed |
non-zero | on failure |
zero | on success |
Definition at line 861 of file res_stasis.c.
References ao2_unlink, ast_bridge_destroy(), and stasis_app_bridge_find_by_id().
Referenced by ast_ari_bridges_destroy().
struct ast_bridge* stasis_app_bridge_find_by_id | ( | const char * | bridge_id | ) |
Returns the bridge with the given id.
bridge_id | Uniqueid of the bridge. |
Definition at line 774 of file res_stasis.c.
References ao2_find, and OBJ_SEARCH_KEY.
Referenced by bridge_find(), find_bridge(), and stasis_app_bridge_destroy().
struct ast_channel* stasis_app_bridge_moh_channel | ( | struct ast_bridge * | bridge | ) |
Finds or creates an announcer channel in a bridge that can play music on hold.
bridge | Bridge we want an MOH channel for |
Definition at line 629 of file res_stasis.c.
References ao2_find, ao2_lock, ao2_ref, ao2_unlock, ast_channel_get_by_name(), bridge_moh_create(), stasis_app_bridge_channel_wrapper::channel_id, OBJ_NOLOCK, OBJ_SEARCH_KEY, and ast_bridge::uniqueid.
Referenced by ast_ari_bridges_start_moh().
int stasis_app_bridge_moh_stop | ( | struct ast_bridge * | bridge | ) |
Breaks down MOH channels playing on the bridge created by stasis_app_bridge_moh_channel.
bridge | Bridge we want to stop the MOH on |
Definition at line 649 of file res_stasis.c.
References ao2_cleanup, ao2_find, ao2_ref, AST_CAUSE_NORMAL_CLEARING, ast_channel_get_by_name(), ast_moh_stop(), ast_softhangup(), stasis_app_bridge_channel_wrapper::channel_id, OBJ_SEARCH_KEY, OBJ_UNLINK, and ast_bridge::uniqueid.
Referenced by ast_ari_bridges_stop_moh().
int stasis_app_bridge_playback_channel_add | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan, | ||
struct stasis_app_control * | control | ||
) |
Adds a channel to the list of ARI playback channels for bridges.
bridge | Bridge we are adding the playback channel for |
chan | Channel being added as a playback channel (must be ;1) |
-1 | failed to add channel for any reason |
0 | on success |
Definition at line 705 of file res_stasis.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ao2_link, ast_bridge_set_after_callback(), ast_channel_uniqueid(), ast_free, ast_strdup, ast_string_field_init, ast_string_field_set, NULL, playback_after_bridge_cb(), playback_after_bridge_cb_failed(), RAII_VAR, stasis_app_bridge_channel_wrapper_destructor(), and ast_bridge::uniqueid.
Referenced by ari_bridges_play_new().
struct ast_channel* stasis_app_bridge_playback_channel_find | ( | struct ast_bridge * | bridge | ) |
Finds an existing ARI playback channel in a bridge.
bridge | Bridge we want to find the playback channel for |
Definition at line 759 of file res_stasis.c.
References ao2_find, ao2_ref, ast_channel_get_by_name(), stasis_app_bridge_channel_wrapper::channel_id, NULL, OBJ_SEARCH_KEY, and ast_bridge::uniqueid.
Referenced by ari_bridges_handle_play().
void stasis_app_bridge_playback_channel_remove | ( | char * | bridge_id, |
struct stasis_app_control * | control | ||
) |
remove channel from list of ARI playback channels for bridges.
bridge_id | The unique ID of the bridge the playback channel is in. |
control | The app control structure for the playback channel |
Definition at line 743 of file res_stasis.c.
References ao2_find, ao2_ref, ao2_unlink, OBJ_SEARCH_KEY, and OBJ_UNLINK.
Referenced by ari_bridges_play_new(), and bridge_channel_control_thread().
int stasis_app_channel_is_internal | ( | struct ast_channel * | chan | ) |
Is this channel internal to Stasis?
chan | The channel to check. |
0 | No |
1 | Yes |
Definition at line 2322 of file res_stasis.c.
References ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, and NULL.
Referenced by bridge_stasis_push().
int stasis_app_channel_is_stasis_end_published | ( | struct ast_channel * | chan | ) |
Has this channel had a StasisEnd published on it?
chan | The channel upon which the query rests. |
0 | No |
1 | Yes |
Definition at line 1299 of file res_stasis.c.
References ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, and NULL.
Referenced by internal_bridge_after_cb(), and stasis_app_exec().
int stasis_app_channel_set_internal | ( | struct ast_channel * | chan | ) |
Mark this channel as being internal to Stasis.
chan | The channel to mark. |
zero | Success |
non-zero | Failure |
Definition at line 2311 of file res_stasis.c.
References ast_channel_lock, ast_channel_unlock, and set_internal_datastore().
void stasis_app_channel_set_stasis_end_published | ( | struct ast_channel * | chan | ) |
Indicate that this channel has had a StasisEnd published for it.
The | channel that is exiting Stasis. |
Definition at line 1287 of file res_stasis.c.
References ast_channel_datastore_add(), ast_channel_lock, ast_channel_unlock, ast_datastore_alloc, and NULL.
Referenced by bridge_stasis_moving(), and channel_stolen_cb().
int stasis_app_channel_unreal_set_internal | ( | struct ast_channel * | chan | ) |
Mark this unreal channel and it's other half as being internal to Stasis.
chan | The channel to mark. |
zero | Success |
non-zero | Failure |
Definition at line 2288 of file res_stasis.c.
References ao2_ref, ao2_unlock, ast_channel_tech_pvt(), ast_channel_unlock, ast_channel_unref, ast_unreal_lock_all(), NULL, and set_internal_datastore().
Referenced by bridge_moh_create(), and prepare_bridge_media_channel().
void stasis_app_control_absorb_dtmf_in_bridge | ( | struct stasis_app_control * | control, |
int | absorb | ||
) |
Set whether DTMF from the channel is absorbed instead of passing through to the bridge.
control | Control whose channel should have its DTMF absorbed when bridged |
absorb | Whether DTMF should be absorbed (1) instead of passed through (0). |
Definition at line 1464 of file control.c.
References stasis_app_control::bridge_features, and ast_bridge_features::dtmf_passthrough.
Referenced by ast_ari_bridges_add_channel().
int stasis_app_control_add_channel_to_bridge | ( | struct stasis_app_control * | control, |
struct ast_bridge * | bridge | ||
) |
Add a channel to the bridge.
control | Control whose channel should be added to the bridge |
bridge | Pointer to the bridge |
Definition at line 1383 of file control.c.
References app_control_can_add_channel_to_bridge(), app_send_command_on_condition(), ast_debug, control_add_channel_to_bridge(), NULL, and stasis_app_control_get_channel_id().
Referenced by ast_ari_bridges_add_channel().
int stasis_app_control_add_role | ( | struct stasis_app_control * | control, |
const char * | role | ||
) |
Apply a bridge role to a channel controlled by a stasis app control.
control | Control for res_stasis |
role | Role to apply |
Definition at line 316 of file control.c.
References app_control_add_role(), ast_free_ptr(), ast_strdup, and stasis_app_send_command_async().
Referenced by ast_ari_bridges_add_channel().
int stasis_app_control_answer | ( | struct stasis_app_control * | control | ) |
Answer the channel associated with this control.
control | Control for res_stasis . |
Definition at line 44 of file res_stasis_answer.c.
References app_control_answer(), ast_debug, ast_log, LOG_WARNING, NULL, retval, stasis_app_control_get_channel_id(), and stasis_app_send_command().
Referenced by ast_ari_channels_answer().
int stasis_app_control_bridge_features_init | ( | struct stasis_app_control * | control | ) |
Initialize bridge features into a channel control.
control | Control in which to store the features |
Definition at line 1451 of file control.c.
References ast_bridge_features_new(), and stasis_app_control::bridge_features.
Referenced by ast_ari_bridges_add_channel().
void stasis_app_control_clear_roles | ( | struct stasis_app_control * | control | ) |
Clear bridge roles currently applied to a channel controlled by a stasis app control.
control | Control for res_stasis |
Definition at line 338 of file control.c.
References app_control_clear_roles(), NULL, and stasis_app_send_command_async().
Referenced by ast_ari_bridges_add_channel().
int stasis_app_control_continue | ( | struct stasis_app_control * | control, |
const char * | context, | ||
const char * | extension, | ||
int | priority | ||
) |
Exit res_stasis
and continue execution in the dialplan.
If the channel is no longer in res_stasis
, this function does nothing.
control | Control for res_stasis |
context | An optional context to continue to |
extension | An optional extension to continue to |
priority | An optional priority to continue to |
Definition at line 389 of file control.c.
References app_control_continue(), ast_calloc, ast_copy_string(), ast_free_ptr(), stasis_app_control_continue_data::context, stasis_app_control_continue_data::extension, priority, stasis_app_control_continue_data::priority, S_OR, and stasis_app_send_command_async().
Referenced by ast_ari_channels_continue_in_dialplan().
struct stasis_app_control* stasis_app_control_create | ( | struct ast_channel * | chan | ) |
Creates a control handler for a channel that isn't in a stasis app.
chan | Channel to create controller handle for |
res_stasis
handler. Definition at line 333 of file res_stasis.c.
References control_create(), and NULL.
Referenced by ari_bridges_play_new(), and ast_ari_bridges_record().
int stasis_app_control_dial | ( | struct stasis_app_control * | control, |
const char * | dialstring, | ||
unsigned int | timeout | ||
) |
Dial a channel.
control | Control for res_stasis . |
dialstring | The dialstring to pass to the channel driver |
timeout | Optional timeout in milliseconds |
Definition at line 1666 of file control.c.
References app_control_dial(), args, control_dial_args_alloc(), control_dial_args_destroy(), and stasis_app_send_command_async().
Referenced by ast_ari_channels_dial().
int stasis_app_control_dtmf | ( | struct stasis_app_control * | control, |
const char * | dtmf, | ||
int | before, | ||
int | between, | ||
unsigned int | duration, | ||
int | after | ||
) |
Send DTMF to the channel associated with this control.
control | Control for res_stasis . |
dtmf | DTMF string. |
before | Amount of time to wait before sending DTMF digits. |
between | Amount of time between each DTMF digit. |
duration | Amount of time each DTMF digit lasts for. |
after | Amount of time to wait after sending DTMF digits. |
Definition at line 565 of file control.c.
References stasis_app_control_dtmf_data::after, app_control_dtmf(), ast_calloc, ast_free_ptr(), stasis_app_control_dtmf_data::before, stasis_app_control_dtmf_data::between, stasis_app_control_dtmf_data::dtmf, stasis_app_control_dtmf_data::duration, and stasis_app_send_command_async().
Referenced by ast_ari_channels_send_dtmf().
void stasis_app_control_execute_until_exhausted | ( | struct ast_channel * | chan, |
struct stasis_app_control * | control | ||
) |
Act on a stasis app control queue until it is empty.
chan | Channel to handle |
control | Control object to execute |
Definition at line 1250 of file res_stasis.c.
References ao2_lock, ao2_unlock, ast_channel_fdno(), control_command_count(), control_dispatch_all(), control_is_done(), and control_mark_done().
Referenced by bridge_channel_control_thread().
struct stasis_app_control* stasis_app_control_find_by_channel | ( | const struct ast_channel * | chan | ) |
Returns the handler for the given channel.
chan | Channel to handle. |
res_stasis
handler. Definition at line 338 of file res_stasis.c.
References ast_channel_uniqueid(), NULL, and stasis_app_control_find_by_channel_id().
Referenced by ari_bridges_play_found(), bridge_stasis_moving(), bridge_stasis_push(), bridge_stasis_push_peek(), and bridge_timeout().
struct stasis_app_control* stasis_app_control_find_by_channel_id | ( | const char * | channel_id | ) |
Returns the handler for the channel with the given id.
channel_id | Uniqueid of the channel. |
res_stasis
handler. Definition at line 349 of file res_stasis.c.
References ao2_find, and OBJ_SEARCH_KEY.
Referenced by find_channel_control(), find_control(), remove_bridge_playback(), and stasis_app_control_find_by_channel().
void stasis_app_control_flush_queue | ( | struct stasis_app_control * | control | ) |
Flush the control command queue.
control | Control object to flush command queue. |
Definition at line 1278 of file res_stasis.c.
References control_flush_queue().
Referenced by bridge_channel_control_thread().
const char* stasis_app_control_get_channel_id | ( | const struct stasis_app_control * | control | ) |
Returns the uniqueid of the channel associated with this control.
control | Control object. |
NULL
if control is NULL
. Definition at line 1430 of file control.c.
References ast_channel_uniqueid(), and stasis_app_control::channel.
Referenced by app_control_answer(), app_control_remove_channel_from_bridge(), app_control_silence_start(), check_add_remove_channel(), control_compare(), control_hash(), control_silence_stop_now(), control_swap_channel_in_bridge(), masq_match_cb(), playback_publish(), recording_publish(), stasis_app_control_add_channel_to_bridge(), stasis_app_control_answer(), stasis_app_control_get_snapshot(), stasis_app_control_play_uri(), stasis_app_control_record(), and stasis_app_control_remove_channel_from_bridge().
struct ast_channel_snapshot* stasis_app_control_get_snapshot | ( | const struct stasis_app_control * | control | ) |
Returns the most recent snapshot for the associated channel.
The returned pointer is AO2 managed, so ao2_cleanup() when you're done.
control | Control for res_stasis . |
NULL
if channel isn't in cache. Definition at line 860 of file control.c.
References ast_channel_snapshot_get_latest(), and stasis_app_control_get_channel_id().
Referenced by ari_bridges_play_helper(), ari_channels_handle_play(), ast_ari_channels_continue_in_dialplan(), and channel_state_invalid().
void stasis_app_control_hold | ( | struct stasis_app_control * | control | ) |
Place the channel associated with the control on hold.
control | Control for res_stasis . |
Definition at line 748 of file control.c.
References app_control_hold(), NULL, and stasis_app_send_command_async().
Referenced by ast_ari_channels_hold().
void stasis_app_control_inhibit_colp_in_bridge | ( | struct stasis_app_control * | control, |
int | inhibit_colp | ||
) |
Set whether COLP frames should be generated when joining the bridge.
control | Control whose channel should have its COLP frames inhibited when bridged |
mute | Whether COLP frames should be generated (0) or not (1). |
Definition at line 1476 of file control.c.
References stasis_app_control::bridge_features, and ast_bridge_features::inhibit_colp.
Referenced by ast_ari_bridges_add_channel().
int stasis_app_control_is_done | ( | struct stasis_app_control * | control | ) |
Check if a control is marked as done.
control | Which control object is being evaluated |
Definition at line 1273 of file res_stasis.c.
References control_is_done().
Referenced by ari_bridges_play_found().
void stasis_app_control_moh_start | ( | struct stasis_app_control * | control, |
const char * | moh_class | ||
) |
Play music on hold to a channel (does not affect hold status)
control | Control for res_stasis . |
moh_class | class of music on hold to play (NULL allowed) |
Definition at line 780 of file control.c.
References app_control_moh_start(), ast_free_ptr(), ast_strdup, ast_strlen_zero, NULL, and stasis_app_send_command_async().
Referenced by ast_ari_channels_start_moh().
void stasis_app_control_moh_stop | ( | struct stasis_app_control * | control | ) |
Stop playing music on hold to a channel (does not affect hold status)
control | Control for res_stasis . |
Definition at line 798 of file control.c.
References app_control_moh_stop(), NULL, and stasis_app_send_command_async().
Referenced by ast_ari_channels_stop_moh().
int stasis_app_control_move | ( | struct stasis_app_control * | control, |
const char * | app_name, | ||
const char * | app_args | ||
) |
Exit res_stasis
and move to another Stasis application.
If the channel is no longer in res_stasis
, this function does nothing.
control | Control for res_stasis |
app_name | The name of the application to switch to |
app_args | The list of arguments to pass to the application |
Definition at line 451 of file control.c.
References stasis_app_control_move_data::app_args, app_control_move(), stasis_app_control_move_data::app_name, ast_calloc, ast_free_ptr(), NULL, and stasis_app_send_command_async().
Referenced by ast_ari_channels_move().
int stasis_app_control_mute | ( | struct stasis_app_control * | control, |
unsigned int | direction, | ||
enum ast_frame_type | frametype | ||
) |
Mute the channel associated with this control.
control | Control for res_stasis . |
direction | The direction in which the audio should be muted. |
frametype | The type of stream that should be muted. |
Definition at line 631 of file control.c.
References app_control_mute(), ast_calloc, ast_free_ptr(), stasis_app_control_mute_data::direction, stasis_app_control_mute_data::frametype, and stasis_app_send_command_async().
Referenced by ast_ari_channels_mute().
void stasis_app_control_mute_in_bridge | ( | struct stasis_app_control * | control, |
int | mute | ||
) |
Set whether audio from the channel is muted instead of passing through to the bridge.
control | Control whose channel should have its audio muted when bridged |
mute | Whether audio should be muted (1) instead of passed through (0). |
Definition at line 1470 of file control.c.
References stasis_app_control::bridge_features, mute, and ast_bridge_features::mute.
Referenced by ast_ari_bridges_add_channel().
void stasis_app_control_publish | ( | struct stasis_app_control * | control, |
struct stasis_message * | message | ||
) |
Publish a message to the control's channel's topic.
control | Control to publish to |
message | Message to publish |
Definition at line 1436 of file control.c.
References ast_channel_topic(), stasis_app_control::channel, and stasis_publish().
Referenced by playback_publish(), and recording_publish().
int stasis_app_control_queue_control | ( | struct stasis_app_control * | control, |
enum ast_control_frame_type | frame_type | ||
) |
Queue a control frame without payload.
control | Control to publish to. |
frame_type | type of control frame. |
Definition at line 1445 of file control.c.
References ast_queue_control(), and stasis_app_control::channel.
Referenced by playback_forward(), playback_pause(), playback_restart(), playback_reverse(), playback_stop(), playback_unpause(), recording_cancel(), recording_mute(), recording_pause(), recording_stop(), recording_unmute(), and recording_unpause().
int stasis_app_control_redirect | ( | struct stasis_app_control * | control, |
const char * | endpoint | ||
) |
Redirect a channel in res_stasis
to a particular endpoint.
control | Control for res_stasis |
endpoint | The endpoint transfer string where the channel should be sent to |
Definition at line 500 of file control.c.
References app_control_redirect(), ast_free_ptr(), ast_strdup, and stasis_app_send_command_async().
Referenced by ast_ari_channels_redirect().
void stasis_app_control_register_add_rule | ( | struct stasis_app_control * | control, |
struct stasis_app_control_rule * | rule | ||
) |
Registers an add channel to bridge rule.
control | Control object |
rule | The rule to register |
Definition at line 217 of file control.c.
References stasis_app_control::add_rules, and app_control_register_rule().
Referenced by stasis_app_control_record().
void stasis_app_control_register_remove_rule | ( | struct stasis_app_control * | control, |
struct stasis_app_control_rule * | rule | ||
) |
Registers a remove channel from bridge rule.
control | Control object |
rule | The rule to register |
Definition at line 231 of file control.c.
References app_control_register_rule(), and stasis_app_control::remove_rules.
int stasis_app_control_remove_channel_from_bridge | ( | struct stasis_app_control * | control, |
struct ast_bridge * | bridge | ||
) |
Remove a channel from the bridge.
control | Control whose channel should be removed from the bridge |
bridge | Pointer to the bridge |
Definition at line 1420 of file control.c.
References app_control_can_remove_channel_from_bridge(), app_control_remove_channel_from_bridge(), app_send_command_on_condition(), ast_debug, NULL, and stasis_app_control_get_channel_id().
Referenced by ast_ari_bridges_remove_channel().
int stasis_app_control_ring | ( | struct stasis_app_control * | control | ) |
Indicate ringing to the channel associated with this control.
control | Control for res_stasis . |
Definition at line 592 of file control.c.
References app_control_ring(), NULL, and stasis_app_send_command_async().
Referenced by ast_ari_channels_ring().
int stasis_app_control_ring_stop | ( | struct stasis_app_control * | control | ) |
Stop locally generated ringing on the channel associated with this control.
control | Control for res_stasis . |
Definition at line 607 of file control.c.
References app_control_ring_stop(), NULL, and stasis_app_send_command_async().
Referenced by ast_ari_channels_ring_stop().
int stasis_app_control_set_channel_var | ( | struct stasis_app_control * | control, |
const char * | variable, | ||
const char * | value | ||
) |
Set a variable on the channel associated with this control to value.
control | Control for res_stasis . |
variable | The name of the variable |
value | The value to set the variable to |
Definition at line 711 of file control.c.
References app_control_set_channel_var(), ast_calloc, ast_strdup, free_chanvar(), chanvar::name, stasis_app_send_command_async(), chanvar::value, and var.
Referenced by ast_ari_channels_set_channel_var().
void stasis_app_control_shutdown | ( | void | ) |
Let Stasis app internals shut down.
This is called when res_stasis is unloaded. It ensures that the Stasis app internals can free any resources they may have allocated during the time that res_stasis was loaded.
Definition at line 1680 of file control.c.
References ast_bridge_destroy(), ast_mutex_lock, ast_mutex_unlock, dial_bridge_lock, NULL, and shutting_down.
Referenced by unload_module().
void stasis_app_control_silence_start | ( | struct stasis_app_control * | control | ) |
Start playing silence to a channel.
control | Control for res_stasis . |
Definition at line 832 of file control.c.
References app_control_silence_start(), NULL, and stasis_app_send_command_async().
Referenced by ast_ari_channels_start_silence().
void stasis_app_control_silence_stop | ( | struct stasis_app_control * | control | ) |
Stop playing silence to a channel.
control | Control for res_stasis . |
Definition at line 855 of file control.c.
References app_control_silence_stop(), NULL, and stasis_app_send_command_async().
Referenced by ast_ari_channels_stop_silence().
void stasis_app_control_unhold | ( | struct stasis_app_control * | control | ) |
Remove the channel associated with the control from hold.
control | Control for res_stasis . |
Definition at line 761 of file control.c.
References app_control_unhold(), NULL, and stasis_app_send_command_async().
Referenced by ast_ari_channels_unhold().
int stasis_app_control_unmute | ( | struct stasis_app_control * | control, |
unsigned int | direction, | ||
enum ast_frame_type | frametype | ||
) |
Unmute the channel associated with this control.
control | Control for res_stasis . |
direction | The direction in which the audio should be unmuted. |
frametype | The type of stream that should be unmuted. |
Definition at line 659 of file control.c.
References app_control_unmute(), ast_calloc, ast_free_ptr(), stasis_app_control_mute_data::direction, stasis_app_control_mute_data::frametype, and stasis_app_send_command_async().
Referenced by ast_ari_channels_unmute().
void stasis_app_control_unregister_add_rule | ( | struct stasis_app_control * | control, |
struct stasis_app_control_rule * | rule | ||
) |
UnRegister an add channel to bridge rule.
control | Control object |
rule | The rule to unregister |
Definition at line 224 of file control.c.
References stasis_app_control::add_rules, and app_control_unregister_rule().
Referenced by record_file(), and recording_fail().
void stasis_app_control_unregister_remove_rule | ( | struct stasis_app_control * | control, |
struct stasis_app_control_rule * | rule | ||
) |
Unregisters a remove channel from bridge rule.
control | Control object |
rule | The rule to unregister |
Definition at line 238 of file control.c.
References app_control_unregister_rule(), and stasis_app_control::remove_rules.
int stasis_app_event_allowed | ( | const char * | app_name, |
struct ast_json * | event | ||
) |
Check if the given event should be filtered.
Attempts first to find the event in the application's disallowed events list. If found then the event won't be sent to the remote. If not found in the disallowed list then a search is done to see if it can be found in the allowed list. If found the event message is sent, otherwise it is not sent.
app_name | The application name |
event | The event to check |
Definition at line 1739 of file res/stasis/app.c.
References ao2_lock, ao2_ref, ao2_unlock, app, app_event_filter_matched(), stasis_app::events_allowed, stasis_app::events_disallowed, and stasis_app_get_by_name().
Referenced by stasis_app_message_handler().
int stasis_app_event_filter_set | ( | struct stasis_app * | app, |
struct ast_json * | filter | ||
) |
Set the application's event type filter.
app | The application |
filter | The allowed and/or disallowed event filter |
Definition at line 1713 of file res/stasis/app.c.
References app_events_allowed_set(), and app_events_disallowed_set().
Referenced by ast_ari_applications_filter().
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.
app | The application |
json | The json object to add the filter data to |
Definition at line 1641 of file res/stasis/app.c.
References ast_json_array_create(), ast_json_object_set(), ast_json_ref(), stasis_app::events_allowed, and stasis_app::events_disallowed.
Referenced by stasis_app_object_to_json().
struct ao2_container* stasis_app_get_all | ( | void | ) |
Gets the names of all registered Stasis applications.
ast_str_container
of container names. NULL
on error. Definition at line 1708 of file res_stasis.c.
References ao2_callback, append_name(), apps, ast_str_container_alloc, NULL, and OBJ_NODATA.
Referenced by ari_show_apps(), ast_ari_applications_list(), complete_ari_app(), and stasis_app_set_global_debug().
struct ast_bridge* stasis_app_get_bridge | ( | struct stasis_app_control * | control | ) |
Gets the bridge currently associated with a control object.
control | Control object for the channel to query. |
NULL
if not associated with a bridge. Definition at line 931 of file control.c.
References ao2_lock, ao2_unlock, stasis_app_control::bridge, and NULL.
Referenced by app_control_continue(), app_control_dtmf(), app_control_remove_channel_from_bridge(), ast_ari_bridges_remove_channel(), ast_ari_bridges_set_video_source(), control_swap_channel_in_bridge(), play_uri(), record_file(), and stasis_app_exec().
struct stasis_app* stasis_app_get_by_name | ( | const char * | name | ) |
Retrieve a handle to a Stasis application by its name.
name | The name of the registered Stasis application |
stasis_app
on success. NULL
on error. Definition at line 1694 of file res_stasis.c.
References find_app_by_name().
Referenced by ari_set_debug(), ari_show_app(), ast_ari_applications_filter(), stasis_app_event_allowed(), stasis_app_get_debug_by_name(), stasis_app_set_debug_by_name(), and stasis_app_set_global_debug().
int stasis_app_get_debug | ( | struct stasis_app * | app | ) |
Get debug status of an application.
app | The app to check |
Definition at line 863 of file res/stasis/app.c.
References stasis_app::debug, and global_debug.
int stasis_app_get_debug_by_name | ( | const char * | app_name | ) |
Get debug status of an application.
app_name | The app_name to check |
Definition at line 868 of file res/stasis/app.c.
References ao2_ref, app, stasis_app::debug, global_debug, and stasis_app_get_by_name().
Referenced by ast_ari_callback(), and stasis_app_message_handler().
struct stasis_message_sanitizer* stasis_app_get_sanitizer | ( | void | ) |
Get the Stasis message sanitizer for app_stasis applications.
The | stasis message sanitizer |
Definition at line 2264 of file res_stasis.c.
References app_sanitizer.
Referenced by app_send_end_msg(), ast_ari_bridges_create(), ast_ari_bridges_create_with_id(), ast_ari_bridges_get(), ast_ari_bridges_list(), ast_ari_channels_list(), ast_ari_endpoints_get(), ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), channel_callerid(), channel_connected_line(), channel_destroyed_event(), channel_dialplan(), message_received_handler(), simple_bridge_event(), simple_channel_event(), simple_endpoint_event(), and sub_default_handler().
const char* stasis_app_name | ( | const struct stasis_app * | app | ) |
Retrieve an application's name.
app | An application |
Definition at line 1156 of file res/stasis/app.c.
References stasis_app::name.
Referenced by app_compare(), app_hash(), app_send_end_msg(), app_subscribe(), app_unsubscribe(), append_name(), ari_set_debug(), bridge_stasis_push_peek(), cleanup_cb(), device_state_subscription_create(), devices_to_json(), find_device_state_subscription(), send_start_msg_snapshots(), stasis_app_exec(), and subscribe_device_state().
struct ast_json* stasis_app_object_to_json | ( | struct stasis_app * | app | ) |
Return the JSON representation of a Stasis application.
app | The application. |
NULL
on error. Definition at line 1866 of file res_stasis.c.
References app_event_sources_to_json(), app_to_json(), NULL, and stasis_app_event_filter_to_json().
Referenced by app_handle_subscriptions(), ast_ari_applications_filter(), and stasis_app_to_json().
int stasis_app_register | ( | const char * | app_name, |
stasis_app_cb | handler, | ||
void * | data | ||
) |
Register a new Stasis application.
If an application is already registered with the given name, the old application is sent a 'replaced' message and unregistered.
app_name | Name of this application. |
handler | Callback for application messages. |
data | Data blob to pass to the callback. Must be AO2 managed. |
Definition at line 1777 of file res_stasis.c.
References __stasis_app_register().
Referenced by AST_TEST_DEFINE(), and event_session_alloc().
int stasis_app_register_all | ( | const char * | app_name, |
stasis_app_cb | handler, | ||
void * | data | ||
) |
Register a new Stasis application that receives all Asterisk events.
If an application is already registered with the given name, the old application is sent a 'replaced' message and unregistered.
app_name | Name of this application. |
handler | Callback for application messages. |
data | Data blob to pass to the callback. Must be AO2 managed. |
Definition at line 1782 of file res_stasis.c.
References __stasis_app_register().
Referenced by event_session_alloc().
void stasis_app_register_event_source | ( | struct stasis_app_event_source * | obj | ) |
Register an application event source.
obj | the event source to register |
Definition at line 1816 of file res_stasis.c.
References AST_LIST_INSERT_TAIL, AST_RWLIST_UNLOCK, and AST_RWLIST_WRLOCK.
Referenced by load_module(), and stasis_app_register_event_sources().
void stasis_app_register_event_sources | ( | void | ) |
Register core event sources.
Definition at line 1627 of file res/stasis/app.c.
References stasis_app_register_event_source().
Referenced by load_module().
int stasis_app_send | ( | const char * | app_name, |
struct ast_json * | message | ||
) |
Send a message to the given Stasis application.
The message given to the handler is a borrowed copy. If you want to keep a reference to it, you should use ao2_ref()
to keep it around.
app_name | Name of the application to invoke. |
message | Message to send (borrowed reference) |
Definition at line 1656 of file res_stasis.c.
References ao2_find, ao2_ref, app, app_send(), ast_log, LOG_WARNING, and OBJ_SEARCH_KEY.
Referenced by AST_TEST_DEFINE(), and send_device_state().
void stasis_app_set_debug | ( | struct stasis_app * | app, |
int | debug | ||
) |
Enable/disable request/response and event logging on an application.
app | The app to debug |
debug | If non-zero, enable debugging. If zero, disable. |
Definition at line 842 of file res/stasis/app.c.
References stasis_app::debug.
Referenced by ari_set_debug(), and stasis_app_set_global_debug().
void stasis_app_set_debug_by_name | ( | const char * | app_name, |
int | debug | ||
) |
Enable/disable request/response and event logging on an application.
app_name | The app name to debug |
debug | If non-zero, enable debugging. If zero, disable. |
Definition at line 851 of file res/stasis/app.c.
References ao2_cleanup, app, stasis_app::debug, and stasis_app_get_by_name().
void stasis_app_set_global_debug | ( | int | debug | ) |
Enable/disable request/response and event logging on all applications.
debug | If non-zero, enable debugging. If zero, disable. |
Definition at line 887 of file res/stasis/app.c.
References ao2_cleanup, ao2_container_count(), ao2_iterator_cleanup(), ao2_iterator_init(), ao2_iterator_next, app, app_name(), stasis_app::debug, global_debug, stasis_app_get_all(), stasis_app_get_by_name(), and stasis_app_set_debug().
Referenced by ari_set_debug().
enum stasis_app_subscribe_res stasis_app_subscribe | ( | const char * | app_name, |
const char ** | event_source_uris, | ||
int | event_sources_count, | ||
struct ast_json ** | json | ||
) |
Subscribes an application to a list of event sources.
app_name | Name of the application to subscribe. |
event_source_uris | URIs for the event sources to subscribe to. |
event_sources_count | Array size of event_source_uris. |
json | Optional output pointer for JSON representation of the app after adding the subscription. |
Definition at line 2045 of file res_stasis.c.
References app_handle_subscriptions(), and app_subscribe().
Referenced by ast_ari_applications_subscribe().
enum stasis_app_subscribe_res stasis_app_subscribe_channel | ( | const char * | app_name, |
struct ast_channel * | chan | ||
) |
Directly subscribe an application to a channel.
app_name | Name of the application to subscribe. |
chan | The channel to subscribe to |
Definition at line 1984 of file res_stasis.c.
References ao2_ref, app_subscribe_channel(), ast_channel_uniqueid(), ast_debug, ast_log, find_app_by_name(), LOG_ERROR, STASIS_ASR_APP_NOT_FOUND, STASIS_ASR_INTERNAL_ERROR, and STASIS_ASR_OK.
Referenced by ari_channels_handle_originate_with_id(), and ast_ari_channels_create().
void stasis_app_to_cli | ( | const struct stasis_app * | app, |
struct ast_cli_args * | a | ||
) |
Dump properties of a stasis_app
to the CLI.
app | The application |
a | The CLI arguments |
Definition at line 1173 of file res/stasis/app.c.
References ao2_callback, ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_next, ao2_ref, ast_cli(), bridges, channels, stasis_app::debug, endpoints, ast_cli_args::fd, FORWARD_BRIDGE, FORWARD_CHANNEL, FORWARD_ENDPOINT, stasis_app::forwards, forwards_filter_by_type(), app_forwards::id, app_forwards::interested, stasis_app::name, OBJ_MULTIPLE, STASIS_APP_SUBSCRIBE_ALL, and stasis_app::subscription_model.
Referenced by ari_show_app().
struct ast_json* stasis_app_to_json | ( | const char * | app_name | ) |
Return the JSON representation of a Stasis application.
app_name | Name of the application. |
NULL
on error. Definition at line 1876 of file res_stasis.c.
References ao2_cleanup, app, find_app_by_name(), and stasis_app_object_to_json().
Referenced by append_json(), and ast_ari_applications_get().
void stasis_app_unregister | ( | const char * | app_name | ) |
Unregister a Stasis application.
app_name | Name of the application to unregister. |
Definition at line 1787 of file res_stasis.c.
References ao2_find, ao2_ref, app, app_deactivate(), ast_log, cleanup(), LOG_ERROR, and OBJ_SEARCH_KEY.
Referenced by AST_TEST_DEFINE(), and event_session_shutdown().
void stasis_app_unregister_event_source | ( | struct stasis_app_event_source * | obj | ) |
Unregister an application event source.
obj | the event source to unregister |
Definition at line 1823 of file res_stasis.c.
References AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, and stasis_app_event_source::next.
Referenced by stasis_app_unregister_event_sources(), and unload_module().
void stasis_app_unregister_event_sources | ( | void | ) |
Unregister core event sources.
Definition at line 1634 of file res/stasis/app.c.
References stasis_app_unregister_event_source().
Referenced by unload_module().
enum stasis_app_subscribe_res stasis_app_unsubscribe | ( | const char * | app_name, |
const char ** | event_source_uris, | ||
int | event_sources_count, | ||
struct ast_json ** | json | ||
) |
Unsubscribes an application from a list of event sources.
app_name | Name of the application to subscribe. |
event_source_uris | URIs for the event sources to subscribe to. |
event_sources_count | Array size of event_source_uris. |
json | Optional output pointer for JSON representation of the app after adding the subscription. |
Definition at line 2086 of file res_stasis.c.
References app_handle_subscriptions(), and app_unsubscribe().
Referenced by ast_ari_applications_unsubscribe().
enum stasis_app_user_event_res stasis_app_user_event | ( | const char * | app_name, |
const char * | event_name, | ||
const char ** | source_uris, | ||
int | sources_count, | ||
struct ast_json * | json_variables | ||
) |
Generate a Userevent for stasis app (echo to AMI)
app_name | Name of the application to generate event for/to. |
event_name | Name of the Userevent. |
source_uris | URIs for the source objects to attach to event. |
sources_count | Array size of source_uris. |
json_variables | event blob variables. |
Definition at line 2095 of file res_stasis.c.
References ao2_cleanup, ao2_ref, ast_app_get_topic(), ast_begins_with(), ast_bridge_get_snapshot_by_uniqueid(), ast_channel_snapshot_get_latest(), ast_endpoint_latest_snapshot(), ast_json_object_set(), ast_json_pack(), ast_json_ref(), ast_json_string_create(), ast_json_unref(), ast_log, ast_manager_get_topic(), ast_multi_object_blob_add(), ast_multi_object_blob_create(), ast_multi_user_event_type(), start_message_blob::blob, find_app_by_name(), LOG_ERROR, LOG_WARNING, NULL, RAII_VAR, STASIS_APP_USER_APP_NOT_FOUND, STASIS_APP_USER_EVENT_SOURCE_BAD_SCHEME, STASIS_APP_USER_EVENT_SOURCE_NOT_FOUND, STASIS_APP_USER_INTERNAL_ERROR, STASIS_APP_USER_OK, stasis_message_create(), stasis_publish(), STASIS_UMOS_BRIDGE, STASIS_UMOS_CHANNEL, STASIS_UMOS_ENDPOINT, and type.
Referenced by ast_ari_events_user_event().