Asterisk - The Open Source Telephony Project
18.5.0
|
Internal API for the Stasis application commands. More...
#include "asterisk/stasis_app_impl.h"
Go to the source code of this file.
Functions | |
void | command_complete (struct stasis_app_command *command, int retval) |
struct stasis_app_command * | command_create (stasis_app_command_cb callback, void *data, command_data_destructor_fn data_destructor) |
void | command_invoke (struct stasis_app_command *command, struct stasis_app_control *control, struct ast_channel *chan) |
int | command_join (struct stasis_app_command *command) |
struct ao2_container * | command_prestart_get_container (struct ast_channel *chan) |
Get the Stasis() prestart commands for a channel. More... | |
int | command_prestart_queue_command (struct ast_channel *chan, stasis_app_command_cb command_fn, void *data, command_data_destructor_fn data_destructor) |
Queue a Stasis() prestart command for a channel. More... | |
void command_complete | ( | struct stasis_app_command * | command, |
int | retval | ||
) |
Definition at line 77 of file command.c.
References ast_cond_signal, ast_mutex_lock, ast_mutex_unlock, stasis_app_command::condition, stasis_app_command::is_done, stasis_app_command::lock, and stasis_app_command::retval.
Referenced by command_invoke(), control_flush_queue(), and exec_command_on_condition().
struct stasis_app_command* command_create | ( | stasis_app_command_cb | callback, |
void * | data, | ||
command_data_destructor_fn | data_destructor | ||
) |
Definition at line 55 of file command.c.
References ao2_alloc, ast_cond_init, ast_mutex_init, stasis_app_command::callback, command_dtor(), stasis_app_command::condition, stasis_app_command::data, stasis_app_command::data_destructor, stasis_app_command::lock, and NULL.
Referenced by command_prestart_queue_command(), and exec_command_on_condition().
void command_invoke | ( | struct stasis_app_command * | command, |
struct stasis_app_control * | control, | ||
struct ast_channel * | chan | ||
) |
Definition at line 101 of file command.c.
References stasis_app_command::callback, command_complete(), stasis_app_command::data, stasis_app_command::data_destructor, NULL, and stasis_app_command::retval.
Referenced by control_dispatch_all(), and control_prestart_dispatch_all().
int command_join | ( | struct stasis_app_command * | command | ) |
Definition at line 86 of file command.c.
References ast_cond_wait, ast_mutex_lock, ast_mutex_unlock, stasis_app_command::condition, stasis_app_command::is_done, stasis_app_command::lock, and stasis_app_command::retval.
Referenced by app_send_command_on_condition().
struct ao2_container* command_prestart_get_container | ( | struct ast_channel * | chan | ) |
Get the Stasis() prestart commands for a channel.
chan | The channel from which to get prestart commands |
Definition at line 160 of file command.c.
References ao2_bump, ast_channel_datastore_find(), ast_datastore::data, and NULL.
Referenced by control_prestart_dispatch_all().
int command_prestart_queue_command | ( | struct ast_channel * | chan, |
stasis_app_command_cb | command_fn, | ||
void * | data, | ||
command_data_destructor_fn | data_destructor | ||
) |
Queue a Stasis() prestart command for a channel.
chan | The channel on which to queue the prestart command |
command_fn | The callback to call for the command |
data | The data to pass to the command callback |
data_destructor | Optional function which will be called on the data in either the event of command completion or failure to schedule or complete the command |
zero | on success |
non-zero | on failure |
Definition at line 123 of file command.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_cleanup, ao2_container_alloc_list, ao2_link, ast_channel_datastore_add(), ast_channel_datastore_find(), ast_datastore_alloc, command_create(), ast_datastore::data, NULL, and RAII_VAR.
Referenced by bridge_stasis_queue_join_action().