Asterisk - The Open Source Telephony Project GIT-master-f36a736
features.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 1999 - 2005, Digium, Inc.
5 *
6 * Mark Spencer <markster@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/*! \file
20 * \brief Call Parking and Pickup API
21 * Includes code and algorithms from the Zapata library.
22 */
23
24#ifndef _AST_FEATURES_H
25#define _AST_FEATURES_H
26
27#include "asterisk/pbx.h"
29#include "asterisk/bridge.h"
30
31/*! \brief main call feature structure */
32
33enum {
40};
41
42/*!
43 * \brief Bridge a call, optionally allowing redirection
44 *
45 * \note The function caller is assumed to have already done the
46 * COLP exchange for the initial bridging of the two channels if
47 * it was desired.
48 */
49int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config);
50
51/*!
52 * \brief Bridge a call, and add additional flags to the bridge
53 *
54 * \details
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.
58 *
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
63 *
64 * \note The function caller is assumed to have already done the
65 * COLP exchange for the initial bridging of the two channels if
66 * it was desired.
67 */
68int ast_bridge_call_with_flags(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, unsigned int flags);
69
70/*!
71 * \brief Add an arbitrary channel to a bridge
72 * \since 12.0.0
73 *
74 * \details
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.
79 *
80 * In addition, a tone can optionally be played to the channel once the
81 * channel is placed into the bridge.
82 *
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.
86 *
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
92 *
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.
96 *
97 * \retval 0 Success
98 * \retval -1 Failure
99 */
100int ast_bridge_add_channel(struct ast_bridge *bridge, struct ast_channel *chan,
101 struct ast_bridge_features *features, int play_tone, const char *xfersound);
102
103
104
105/*!
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
108*/
109int ast_bridge_timelimit(struct ast_channel *chan, struct ast_bridge_config *config, char *parse, struct timeval *calldurationlimit);
110
111#endif /* _AST_FEATURES_H */
Bridging API.
static const char config[]
Definition: chan_ooh323.c:111
int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config)
Bridge a call, optionally allowing redirection.
Definition: features.c:685
@ AST_FEATURE_FLAG_ONPEER
Definition: features.h:35
@ AST_FEATURE_FLAG_ONSELF
Definition: features.h:36
@ AST_FEATURE_FLAG_BYBOTH
Definition: features.h:39
@ AST_FEATURE_FLAG_BYCALLER
Definition: features.h:38
@ AST_FEATURE_FLAG_NEEDSDTMF
Definition: features.h:34
@ AST_FEATURE_FLAG_BYCALLEE
Definition: features.h:37
int ast_bridge_call_with_flags(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, unsigned int flags)
Bridge a call, and add additional flags to the bridge.
Definition: features.c:595
int ast_bridge_timelimit(struct ast_channel *chan, struct ast_bridge_config *config, char *parse, struct timeval *calldurationlimit)
parse L option and read associated channel variables to set warning, warning frequency,...
Definition: features.c:857
int ast_bridge_add_channel(struct ast_bridge *bridge, struct ast_channel *chan, struct ast_bridge_features *features, int play_tone, const char *xfersound)
Add an arbitrary channel to a bridge.
Definition: bridge.c:2471
A set of macros to manage forward-linked lists.
Core PBX routines and definitions.
bridge configuration
Definition: channel.h:1096
Structure that contains features information.
Structure that contains information about a bridge.
Definition: bridge.h:349
Main Channel structure associated with a channel.