2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 2013 Digium, Inc.
6 * Matt Jordan <mjordan@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.
21 * \brief Private Bridging Channel API
23 * \author Matt Jordan <mjordan@digium.com>
25 * A private API to manipulate channels in a bridge. These can be called on a channel in
26 * a bridge by the bridging API, but should not be called by external consumers of the
30 * \arg \ref AstCREDITS
33 #ifndef _ASTERISK_PRIVATE_BRIDGING_CHANNEL_H
34 #define _ASTERISK_PRIVATE_BRIDGING_CHANNEL_H
36 struct blind_transfer_data {
37 char exten[AST_MAX_EXTENSION];
38 char context[AST_MAX_CONTEXT];
42 * \brief Adjust the bridge_channel's bridge merge inhibit request count.
45 * \param bridge_channel What to operate on.
46 * \param request Inhibit request increment.
47 * (Positive to add requests. Negative to remove requests.)
49 * \note This API call is meant for internal bridging operations.
51 * \retval bridge adjusted merge inhibit with reference count.
53 struct ast_bridge *bridge_channel_merge_inhibit(struct ast_bridge_channel *bridge_channel, int request);
57 * \brief Pull the bridge channel out of its current bridge.
60 * \param bridge_channel Channel to pull.
62 * \note On entry, bridge_channel->bridge is already locked.
66 void bridge_channel_pull(struct ast_bridge_channel *bridge_channel);
70 * \brief Push the bridge channel into its specified bridge.
73 * \param bridge_channel Channel to push.
75 * \note On entry, bridge_channel->bridge is already locked.
77 * \retval 0 on success.
78 * \retval -1 on failure. The channel did not get pushed.
80 int bridge_channel_push(struct ast_bridge_channel *bridge_channel);
82 void bridge_channel_join(struct ast_bridge_channel *bridge_channel);
84 void bridge_channel_suspend_nolock(struct ast_bridge_channel *bridge_channel);
86 void bridge_channel_unsuspend_nolock(struct ast_bridge_channel *bridge_channel);
90 * \brief Update the linkedids for all channels in a bridge
93 * \param bridge_channel The channel joining the bridge
94 * \param swap The channel being swapped out of the bridge. May be NULL.
96 * \note The bridge must be locked prior to calling this function. This should be called
97 * during a \ref bridge_channel_push operation, typically by a sub-class of a bridge
99 void bridge_channel_update_linkedids(struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap);
103 * \brief Update the accountcodes for a channel entering a bridge
106 * This function updates the accountcode and peeraccount on channels in two-party
107 * bridges. In multi-party bridges, peeraccount is not set - it doesn't make much sense -
108 * however accountcode propagation will still occur if the channel joining has an
111 * \param bridge_channel The channel joining the bridge
112 * \param swap The channel being swapped out of the bridge. May be NULL.
114 * \note The bridge must be locked prior to calling this function. This should be called
115 * during a \ref bridge_channel_push operation, typically by a sub-class of a bridge
117 void bridge_channel_update_accountcodes(struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap);
121 * \brief Set bridge channel state to leave bridge (if not leaving already) with no lock.
123 * \param bridge_channel Channel to change the state on
124 * \param new_state The new state to place the channel into
126 * \note This API call is only meant to be used within the
127 * bridging module and hook callbacks to request the channel
130 * \note This function assumes the bridge_channel is locked.
132 void ast_bridge_change_state_nolock(struct ast_bridge_channel *bridge_channel, enum ast_bridge_channel_state new_state);
135 * \brief Set bridge channel state to leave bridge (if not leaving already).
137 * \param bridge_channel Channel to change the state on
138 * \param new_state The new state to place the channel into
143 * ast_bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_HANGUP);
146 * This places the channel pointed to by bridge_channel into the
147 * state AST_BRIDGE_CHANNEL_STATE_HANGUP if it was
148 * AST_BRIDGE_CHANNEL_STATE_WAIT before.
150 * \note This API call is only meant to be used within the
151 * bridging module and hook callbacks to request the channel
154 void ast_bridge_change_state(struct ast_bridge_channel *bridge_channel, enum ast_bridge_channel_state new_state);
156 #endif /* _ASTERISK_PRIVATE_BRIDGING_H */