features.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 1999 - 2005, Digium, Inc.
00005  *
00006  * Mark Spencer <markster@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 /*! \file
00020  * \brief Call Parking and Pickup API
00021  * Includes code and algorithms from the Zapata library.
00022  */
00023 
00024 #ifndef _AST_FEATURES_H
00025 #define _AST_FEATURES_H
00026 
00027 #include "asterisk/pbx.h"
00028 #include "asterisk/linkedlists.h"
00029 #include "asterisk/bridge.h"
00030 
00031 /*! \brief main call feature structure */
00032 
00033 enum {
00034    AST_FEATURE_FLAG_NEEDSDTMF = (1 << 0),
00035    AST_FEATURE_FLAG_ONPEER =    (1 << 1),
00036    AST_FEATURE_FLAG_ONSELF =    (1 << 2),
00037    AST_FEATURE_FLAG_BYCALLEE =  (1 << 3),
00038    AST_FEATURE_FLAG_BYCALLER =  (1 << 4),
00039    AST_FEATURE_FLAG_BYBOTH  =   (3 << 3),
00040 };
00041 
00042 /*!
00043  * \brief Bridge a call, optionally allowing redirection
00044  *
00045  * \note The function caller is assumed to have already done the
00046  * COLP exchange for the initial bridging of the two channels if
00047  * it was desired.
00048  */
00049 int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config);
00050 
00051 /*!
00052  * \brief Bridge a call, and add additional flags to the bridge
00053  *
00054  * This does the same thing as \ref ast_bridge_call, except that once the bridge
00055  * is created, the provided flags are set on the bridge. The provided flags are
00056  * added to the bridge's flags; they will not clear any flags already set.
00057  *
00058  * \param chan The calling channel
00059  * \param peer The called channel
00060  * \param config Bridge configuration for the channels
00061  * \param flags Additional flags to set on the created bridge
00062  *
00063  * \note The function caller is assumed to have already done the
00064  * COLP exchange for the initial bridging of the two channels if
00065  * it was desired.
00066  */
00067 int ast_bridge_call_with_flags(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, unsigned int flags);
00068 
00069 /*!
00070  * \brief Add an arbitrary channel to a bridge
00071  * \since 12.0.0
00072  *
00073  * The channel that is being added to the bridge can be in any state: unbridged,
00074  * bridged, answered, unanswered, etc. The channel will be added asynchronously,
00075  * meaning that when this function returns once the channel has been added to
00076  * the bridge, not once the channel has been removed from the bridge.
00077  *
00078  * In addition, a tone can optionally be played to the channel once the
00079  * channel is placed into the bridge.
00080  *
00081  * \note When this function returns, there is no guarantee that the channel that
00082  * was passed in is valid any longer. Do not attempt to operate on the channel
00083  * after this function returns.
00084  *
00085  * \param bridge Bridge to which the channel should be added
00086  * \param chan The channel to add to the bridge
00087  * \param features Features for this channel in the bridge
00088  * \param play_tone Indicates if a tone should be played to the channel
00089  * \param xfersound Sound that should be used to indicate transfer with play_tone
00090  * \retval 0 Success
00091  * \retval -1 Failure
00092  */
00093 int ast_bridge_add_channel(struct ast_bridge *bridge, struct ast_channel *chan,
00094       struct ast_bridge_features *features, int play_tone, const char *xfersound);
00095 
00096 
00097 
00098 /*!
00099  * \brief parse L option and read associated channel variables to set warning, warning frequency, and timelimit
00100  * \note caller must be aware of freeing memory for warning_sound, end_sound, and start_sound
00101 */
00102 int ast_bridge_timelimit(struct ast_channel *chan, struct ast_bridge_config *config, char *parse, struct timeval *calldurationlimit);
00103 
00104 #endif /* _AST_FEATURES_H */

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