2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2005, Digium, Inc.
6 * Mark Spencer <markster@digium.com>
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.
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.
20 * \brief Call Parking and Pickup API
21 * Includes code and algorithms from the Zapata library.
24 #ifndef _AST_FEATURES_H
25 #define _AST_FEATURES_H
27 #include "asterisk/pbx.h"
28 #include "asterisk/linkedlists.h"
29 #include "asterisk/bridge.h"
31 /*! \brief main call feature structure */
34 AST_FEATURE_FLAG_NEEDSDTMF = (1 << 0),
35 AST_FEATURE_FLAG_ONPEER = (1 << 1),
36 AST_FEATURE_FLAG_ONSELF = (1 << 2),
37 AST_FEATURE_FLAG_BYCALLEE = (1 << 3),
38 AST_FEATURE_FLAG_BYCALLER = (1 << 4),
39 AST_FEATURE_FLAG_BYBOTH = (3 << 3),
43 * \brief Bridge a call, optionally allowing redirection
45 * \note The function caller is assumed to have already done the
46 * COLP exchange for the initial bridging of the two channels if
49 int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config);
52 * \brief Bridge a call, and add additional flags to the bridge
55 * This does the same thing as \ref ast_bridge_call, except that once the bridge
56 * is created, the provided flags are set on the bridge. The provided flags are
57 * added to the bridge's flags; they will not clear any flags already set.
59 * \param chan The calling channel
60 * \param peer The called channel
61 * \param config Bridge configuration for the channels
62 * \param flags Additional flags to set on the created bridge
64 * \note The function caller is assumed to have already done the
65 * COLP exchange for the initial bridging of the two channels if
68 int ast_bridge_call_with_flags(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, unsigned int flags);
71 * \brief Add an arbitrary channel to a bridge
75 * The channel that is being added to the bridge can be in any state: unbridged,
76 * bridged, answered, unanswered, etc. The channel will be added asynchronously,
77 * meaning that when this function returns once the channel has been added to
78 * the bridge, not once the channel has been removed from the bridge.
80 * In addition, a tone can optionally be played to the channel once the
81 * channel is placed into the bridge.
83 * \note When this function returns, there is no guarantee that the channel that
84 * was passed in is valid any longer. Do not attempt to operate on the channel
85 * after this function returns.
87 * \param bridge Bridge to which the channel should be added
88 * \param chan The channel to add to the bridge
89 * \param features Features for this channel in the bridge
90 * \param play_tone Indicates if a tone should be played to the channel
91 * \param xfersound Sound that should be used to indicate transfer with play_tone
93 * \note The features parameter must be NULL or obtained by
94 * ast_bridge_features_new(). You must not dereference features
95 * after calling even if the call fails.
100 int ast_bridge_add_channel(struct ast_bridge *bridge, struct ast_channel *chan,
101 struct ast_bridge_features *features, int play_tone, const char *xfersound);
106 * \brief parse L option and read associated channel variables to set warning, warning frequency, and timelimit
107 * \note caller must be aware of freeing memory for warning_sound, end_sound, and start_sound
109 int ast_bridge_timelimit(struct ast_channel *chan, struct ast_bridge_config *config, char *parse, struct timeval *calldurationlimit);
111 #endif /* _AST_FEATURES_H */