Asterisk - The Open Source Telephony Project GIT-master-2de1a68
command.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2013, Digium, Inc.
5 *
6 * David M. Lee, II <dlee@digium.com>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19#ifndef _ASTERISK_RES_STASIS_COMMAND_H
20#define _ASTERISK_RES_STASIS_COMMAND_H
21
22/*! \file
23 *
24 * \brief Internal API for the Stasis application commands.
25 *
26 * \author David M. Lee, II <dlee@digium.com>
27 * \since 12
28 */
29
31
33
37
38void command_complete(struct stasis_app_command *command, int retval);
39
40void command_invoke(struct stasis_app_command *command,
41 struct stasis_app_control *control, struct ast_channel *chan);
42
43int command_join(struct stasis_app_command *command);
44
45/*!
46 * \brief Queue a Stasis() prestart command for a channel
47 *
48 * \pre chan must be locked
49 *
50 * \param chan The channel on which to queue the prestart command
51 * \param command_fn The callback to call for the command
52 * \param data The data to pass to the command callback
53 * \param data_destructor Optional function which will be called on
54 * the data in either the event of command completion or failure
55 * to schedule or complete the command
56 *
57 * \retval zero on success
58 * \retval non-zero on failure
59 */
61 stasis_app_command_cb command_fn, void *data,
63
64/*!
65 * \brief Get the Stasis() prestart commands for a channel
66 *
67 * \pre chan must be locked
68 *
69 * \param chan The channel from which to get prestart commands
70 *
71 * \return The command prestart container for chan (must be ao2_cleanup()'d)
72 */
74
75
76#endif /* _ASTERISK_RES_STASIS_CONTROL_H */
struct ao2_container * command_prestart_get_container(struct ast_channel *chan)
Get the Stasis() prestart commands for a channel.
Definition: command.c:160
struct stasis_app_command * command_create(stasis_app_command_cb callback, void *data, command_data_destructor_fn data_destructor)
Definition: command.c:55
void command_invoke(struct stasis_app_command *command, struct stasis_app_control *control, struct ast_channel *chan)
Definition: command.c:101
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.
Definition: command.c:123
void command_complete(struct stasis_app_command *command, int retval)
Definition: command.c:77
int command_join(struct stasis_app_command *command)
Definition: command.c:86
static ENTRY retval
Definition: hsearch.c:50
Backend API for implementing components of res_stasis.
void(* command_data_destructor_fn)(void *data)
Typedef for data destructor for stasis app commands.
int(* stasis_app_command_cb)(struct stasis_app_control *control, struct ast_channel *chan, void *data)
Generic container type.
Main Channel structure associated with a channel.
stasis_app_command_cb callback
Definition: command.c:36
command_data_destructor_fn data_destructor
Definition: command.c:38