Debian Codegraph @

res/stasis/command.h

raw symbols SCIP
1 /*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2013, Digium, Inc.
5 *
6 * David M. Lee, II <[email protected]>
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 <[email protected]>
27 * \since 12
28 */
29
30 #include "asterisk/stasis_app_impl.h"
31
32 struct stasis_app_command;
33
34 struct stasis_app_command *command_create(
35 stasis_app_command_cb callback, void *data,
36 command_data_destructor_fn data_destructor);
37
38 void command_complete(struct stasis_app_command *command, int retval);
39
40 void command_invoke(struct stasis_app_command *command,
41 struct stasis_app_control *control, struct ast_channel *chan);
42
43 int 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 */
60 int command_prestart_queue_command(struct ast_channel *chan,
61 stasis_app_command_cb command_fn, void *data,
62 command_data_destructor_fn data_destructor);
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 */
73 struct ao2_container *command_prestart_get_container(struct ast_channel *chan);
74
75
76 #endif /* _ASTERISK_RES_STASIS_CONTROL_H */