| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
Stasis application command support. More...
#include "asterisk.h"#include "command.h"#include "asterisk/lock.h"#include "asterisk/stasis_app_impl.h"
Go to the source code of this file.
| Data Structures | |
| struct | stasis_app_command | 
| 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) | 
| static void | command_dtor (void *obj) | 
| 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. | |
| 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. | |
| static void | command_queue_prestart_destroy (void *obj) | 
| Variables | |
| static const struct ast_datastore_info | command_queue_prestart | 
Stasis application command support.
Definition in file command.c.
| 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, callback(), 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().
| 
 | static | 
Definition at line 43 of file command.c.
References ast_cond_destroy, ast_mutex_destroy, stasis_app_command::condition, stasis_app_command::data, stasis_app_command::data_destructor, and stasis_app_command::lock.
Referenced by command_create().
| 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(), command_queue_prestart, 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(), command_queue_prestart, ast_datastore::data, NULL, and RAII_VAR.
Referenced by bridge_stasis_queue_join_action().
| 
 | static | 
Definition at line 112 of file command.c.
References ao2_cleanup.
| 
 | static | 
Definition at line 118 of file command.c.
Referenced by command_prestart_get_container(), and command_prestart_queue_command().