Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
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... | |
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... | |
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... | |
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_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... | |
int | stasis_app_send (const char *app_name, struct ast_json *message) |
Send a message to the given Stasis application. 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_subscribe_channel (const char *app_name, struct ast_channel *chan) |
Directly subscribe an application to a channel. 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... | |
struct ast_json * | stasis_app_to_json (const char *app_name) |
Return the JSON representation of a Stasis application. More... | |
void | stasis_app_unregister (const char *app_name) |
Unregister a Stasis application. 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_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_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_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... | |
struct stasis_topic * | ast_app_get_topic (struct stasis_app *app) |
Returns the stasis topic for an app. 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... | |
void | stasis_app_bridge_destroy (const char *bridge_id) |
Destroy the bridge. 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... | |
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... | |
struct ast_channel * | stasis_app_bridge_playback_channel_find (struct ast_bridge *bridge) |
Finds an existing ARI playback channel in a bridge. 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_channel_is_internal (struct ast_channel *chan) |
Is this channel internal to Stasis? 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_set_internal (struct ast_channel *chan) |
Mark this channel as being internal to Stasis. 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_unreal_set_internal (struct ast_channel *chan) |
Mark this unreal channel and it's other half as being internal to Stasis. 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... | |
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_add_role (struct stasis_app_control *control, const char *role) |
Apply a bridge role to a channel controlled by a stasis app control. More... | |
int | stasis_app_control_answer (struct stasis_app_control *control) |
Answer the channel associated with this control. More... | |
int | stasis_app_control_bridge_features_init (struct stasis_app_control *control) |
Initialize bridge features into a channel control. 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_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... | |
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... | |
int | stasis_app_control_dial (struct stasis_app_control *control, const char *dialstring, unsigned int timeout) |
Dial a channel. 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... | |
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... | |
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... | |
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... | |
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_hold (struct stasis_app_control *control) |
Place the channel associated with the control on hold. 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... | |
int | stasis_app_control_is_done (struct stasis_app_control *control) |
Check if a control is marked as done. 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... | |
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_mute (struct stasis_app_control *control, unsigned int direction, enum ast_frame_type frametype) |
Mute the channel associated with this control. 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_publish (struct stasis_app_control *control, struct stasis_message *message) |
Publish a message to the control's channel's topic. 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... | |
int | stasis_app_control_redirect (struct stasis_app_control *control, const char *endpoint) |
Redirect a channel in res_stasis to a particular endpoint. 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_register_remove_rule (struct stasis_app_control *control, struct stasis_app_control_rule *rule) |
Registers a remove channel from bridge rule. 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_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_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_shutdown (void) |
Let Stasis app internals shut down. 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... | |
void | stasis_app_control_unhold (struct stasis_app_control *control) |
Remove the channel associated with the control from hold. 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... | |
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_unregister_remove_rule (struct stasis_app_control *control, struct stasis_app_control_rule *rule) |
Unregisters a remove channel from bridge rule. More... | |
int | stasis_app_event_allowed (const char *app_name, struct ast_json *event) |
Check if the given event should be filtered. More... | |
int | stasis_app_event_filter_set (struct stasis_app *app, struct ast_json *filter) |
Set the application's event type filter. 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... | |
struct ast_bridge * | stasis_app_get_bridge (struct stasis_app_control *control) |
Gets the bridge currently associated with a control object. 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... | |
struct stasis_message_sanitizer * | stasis_app_get_sanitizer (void) |
Get the Stasis message sanitizer for app_stasis applications. 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... | |
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... | |
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 776 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 app.
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 854 of file res_stasis.c.
References bridge_create_common(), name, and type.
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 859 of file res_stasis.c.
References bridge_create_common(), name, and type.
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 |
Definition at line 864 of file res_stasis.c.
References ao2_unlink, app_bridges, 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, app_bridges, 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, app_bridges_moh, 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, app_bridges_moh, AST_CAUSE_NORMAL_CLEARING, ast_channel_get_by_name(), ast_moh_stop(), ast_softhangup(), ast_channel::bridge, 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) |
control | The app control structure for the playback channel |
-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, app_bridges_playback, app_controls, ast_bridge_set_after_callback(), ast_channel_uniqueid(), ast_free, ast_strdup, ast_string_field_init, ast_string_field_set, stasis_app_control::bridge, 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, app_bridges_playback, ast_channel_get_by_name(), ast_channel::bridge, 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, app_bridges_playback, app_controls, stasis_app_bridge_channel_wrapper::bridge_id, 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 2325 of file res_stasis.c.
References ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, NULL, and stasis_internal_channel_info.
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 1302 of file res_stasis.c.
References ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, NULL, and set_end_published_info.
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 2314 of file res_stasis.c.
References ast_channel_lock, ast_channel_unlock, ast_unreal_pvt::chan, 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.
chan | The channel that is exiting Stasis. |
Definition at line 1290 of file res_stasis.c.
References ast_channel_datastore_add(), ast_channel_lock, ast_channel_unlock, ast_datastore_alloc, NULL, and set_end_published_info.
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 2291 of file res_stasis.c.
References ao2_ref, ao2_unlock, ast_channel_tech_pvt(), ast_channel_unlock, ast_channel_unref, ast_unreal_lock_all(), ast_unreal_pvt::chan, 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 1473 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 1392 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 325 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 1460 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 347 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 398 of file control.c.
References app_control_continue(), ast_calloc, ast_copy_string(), ast_free_ptr(), voicemailpwcheck::context, 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 1675 of file control.c.
References app_control_dial(), args, control_dial_args_alloc(), control_dial_args_destroy(), control_dial_args::dialstring, stasis_app_send_command_async(), and control_dial_args::timeout.
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 574 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 1253 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, app_controls, 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 1281 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 1439 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 869 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 757 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 |
inhibit_colp | Whether COLP frames should be generated (0) or not (1). |
Definition at line 1485 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 1276 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 789 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 807 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 460 of file control.c.
References stasis_app_control_move_data::app_args, app_control_move(), app_name(), 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 640 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 1479 of file control.c.
References stasis_app_control::bridge_features, 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 1445 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 1454 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_pause(), recording_stop(), recording_unpause(), and toggle_recording_mute().
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 509 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 219 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 233 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 1429 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 601 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 616 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 720 of file control.c.
References app_control_set_channel_var(), ast_calloc, ast_strdup, free_chanvar(), stasis_app_send_command_async(), 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 1689 of file control.c.
References ast_bridge_destroy(), ast_mutex_lock, ast_mutex_unlock, dial_bridge, 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 841 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 864 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 770 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 668 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 226 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 240 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 1734 of file res/stasis/app.c.
References ao2_lock, ao2_ref, ao2_unlock, app, app_event_filter_matched(), app_name(), 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 1708 of file res/stasis/app.c.
References app, app_events_allowed_set(), app_events_disallowed_set(), and filter().
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 1636 of file res/stasis/app.c.
References app, ast_json_array_create(), ast_json_object_set(), and ast_json_ref().
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 1711 of file res_stasis.c.
References ao2_callback, append_name(), apps, apps_registry, 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 940 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 1697 of file res_stasis.c.
References find_app_by_name(), and 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 app, 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, app_name(), 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 2267 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(), and simple_endpoint_event().
const char * stasis_app_name | ( | const struct stasis_app * | app | ) |
Retrieve an application's name.
app | An application |
Definition at line 1151 of file res/stasis/app.c.
References app.
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 1869 of file res_stasis.c.
References app, 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 1780 of file res_stasis.c.
References __stasis_app_register(), app_name(), and handler().
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 1785 of file res_stasis.c.
References __stasis_app_register(), app_name(), and handler().
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 1819 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 1622 of file res/stasis/app.c.
References bridge_event_source, channel_event_source, endpoint_event_source, and 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 1659 of file res_stasis.c.
References ao2_find, ao2_ref, app, app_name(), app_send(), apps_registry, 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.
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, app_name(), 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(), 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 2048 of file res_stasis.c.
References app_handle_subscriptions(), app_name(), 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 1987 of file res_stasis.c.
References ao2_ref, app, app_name(), 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 1168 of file res/stasis/app.c.
References a, ao2_callback, ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_next, ao2_ref, app, ast_cli(), bridges, channels, endpoints, FORWARD_BRIDGE, FORWARD_CHANNEL, FORWARD_ENDPOINT, forwards_filter_by_type(), app_forwards::id, app_forwards::interested, OBJ_MULTIPLE, and STASIS_APP_SUBSCRIBE_ALL.
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 1879 of file res_stasis.c.
References ao2_cleanup, app, app_name(), 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 1790 of file res_stasis.c.
References ao2_find, ao2_ref, app, app_deactivate(), app_name(), apps_registry, 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 1826 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 1629 of file res/stasis/app.c.
References bridge_event_source, channel_event_source, endpoint_event_source, and 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 2089 of file res_stasis.c.
References app_handle_subscriptions(), app_name(), 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 2098 of file res_stasis.c.
References ao2_cleanup, ao2_ref, app, app_name(), 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(), 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().