command.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 2013, Digium, Inc.
00005  *
00006  * David M. Lee, II <dlee@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  */
00018 
00019 #ifndef _ASTERISK_RES_STASIS_COMMAND_H
00020 #define _ASTERISK_RES_STASIS_COMMAND_H
00021 
00022 /*! \file
00023  *
00024  * \brief Internal API for the Stasis application commands.
00025  *
00026  * \author David M. Lee, II <dlee@digium.com>
00027  * \since 12
00028  */
00029 
00030 #include "asterisk/stasis_app_impl.h"
00031 
00032 struct stasis_app_command;
00033 
00034 struct stasis_app_command *command_create(
00035    stasis_app_command_cb callback, void *data,
00036    command_data_destructor_fn data_destructor);
00037 
00038 void command_complete(struct stasis_app_command *command, int retval);
00039 
00040 void command_invoke(struct stasis_app_command *command,
00041    struct stasis_app_control *control, struct ast_channel *chan);
00042 
00043 int command_join(struct stasis_app_command *command);
00044 
00045 /*!
00046  * \brief Queue a Stasis() prestart command for a channel
00047  *
00048  * \pre chan must be locked
00049  *
00050  * \param chan The channel on which to queue the prestart command
00051  * \param command_fn The callback to call for the command
00052  * \param data The data to pass to the command callback
00053  * \param data_destructor Optional function which will be called on
00054  *        the data in either the event of command completion or failure
00055  *        to schedule or complete the command
00056  *
00057  * \retval zero on success
00058  * \retval non-zero on failure
00059  */
00060 int command_prestart_queue_command(struct ast_channel *chan,
00061    stasis_app_command_cb command_fn, void *data,
00062    command_data_destructor_fn data_destructor);
00063 
00064 /*!
00065  * \brief Get the Stasis() prestart commands for a channel
00066  *
00067  * \pre chan must be locked
00068  *
00069  * \param chan The channel from which to get prestart commands
00070  *
00071  * \return The command prestart container for chan (must be ao2_cleanup()'d)
00072  */
00073 struct ao2_container *command_prestart_get_container(struct ast_channel *chan);
00074 
00075 
00076 #endif /* _ASTERISK_RES_STASIS_CONTROL_H */

Generated on Thu Apr 16 06:27:30 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6