2013-07-24 15:38:18 +00:00
|
|
|
/*
|
|
|
|
* Asterisk -- An open source telephony toolkit.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013 Digium, Inc.
|
|
|
|
*
|
|
|
|
* Matt Jordan <mjordan@digium.com>
|
|
|
|
*
|
|
|
|
* See http://www.asterisk.org for more information about
|
|
|
|
* the Asterisk project. Please do not directly contact
|
|
|
|
* any of the maintainers of this project for assistance;
|
|
|
|
* the project provides a web site, mailing lists and IRC
|
|
|
|
* channels for your use.
|
|
|
|
*
|
|
|
|
* This program is free software, distributed under the terms of
|
|
|
|
* the GNU General Public License Version 2. See the LICENSE file
|
|
|
|
* at the top of the source tree.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \file
|
|
|
|
* \brief Private Bridging Channel API
|
|
|
|
*
|
|
|
|
* \author Matt Jordan <mjordan@digium.com>
|
|
|
|
*
|
|
|
|
* A private API to manipulate channels in a bridge. These can be called on a channel in
|
|
|
|
* a bridge by the bridging API, but should not be called by external consumers of the
|
|
|
|
* Bridging API.
|
|
|
|
*
|
|
|
|
* See Also:
|
|
|
|
* \arg \ref AstCREDITS
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ASTERISK_PRIVATE_BRIDGING_CHANNEL_H
|
|
|
|
#define _ASTERISK_PRIVATE_BRIDGING_CHANNEL_H
|
|
|
|
|
2013-07-24 19:24:09 +00:00
|
|
|
/*!
|
|
|
|
* \internal
|
|
|
|
* \brief Actions that can be taken on a channel in a bridge
|
|
|
|
*/
|
|
|
|
enum bridge_channel_action_type {
|
|
|
|
/*! Bridged channel is to detect a feature hook */
|
|
|
|
BRIDGE_CHANNEL_ACTION_FEATURE,
|
|
|
|
/*! Bridged channel is to send a DTMF stream out */
|
|
|
|
BRIDGE_CHANNEL_ACTION_DTMF_STREAM,
|
|
|
|
/*! Bridged channel is to indicate talking start */
|
|
|
|
BRIDGE_CHANNEL_ACTION_TALKING_START,
|
|
|
|
/*! Bridged channel is to indicate talking stop */
|
|
|
|
BRIDGE_CHANNEL_ACTION_TALKING_STOP,
|
|
|
|
/*! Bridge channel is to play the indicated sound file. */
|
|
|
|
BRIDGE_CHANNEL_ACTION_PLAY_FILE,
|
|
|
|
/*! Bridge channel is to run the indicated application. */
|
|
|
|
BRIDGE_CHANNEL_ACTION_RUN_APP,
|
|
|
|
/*! Bridge channel is to run the custom callback routine. */
|
|
|
|
BRIDGE_CHANNEL_ACTION_CALLBACK,
|
|
|
|
/*! Bridge channel is to get parked. */
|
|
|
|
BRIDGE_CHANNEL_ACTION_PARK,
|
|
|
|
/*! Bridge channel is to execute a blind transfer. */
|
|
|
|
BRIDGE_CHANNEL_ACTION_BLIND_TRANSFER,
|
|
|
|
/*! Bridge channel is to execute an attended transfer */
|
|
|
|
BRIDGE_CHANNEL_ACTION_ATTENDED_TRANSFER,
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Bridge actions put after this comment must never be put onto
|
|
|
|
* the bridge_channel wr_queue because they have other resources
|
|
|
|
* that must be freed.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*! Bridge reconfiguration deferred technology destruction. */
|
|
|
|
BRIDGE_CHANNEL_ACTION_DEFERRED_TECH_DESTROY = 1000,
|
|
|
|
/*! Bridge deferred dissolving. */
|
|
|
|
BRIDGE_CHANNEL_ACTION_DEFERRED_DISSOLVING,
|
2013-07-24 15:38:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*!
|
2013-07-24 19:24:09 +00:00
|
|
|
* \internal
|
|
|
|
* \brief Push the bridge channel into its specified bridge.
|
2013-07-24 15:38:18 +00:00
|
|
|
* \since 12.0.0
|
|
|
|
*
|
2013-07-24 19:24:09 +00:00
|
|
|
* \param bridge_channel Channel to push.
|
2013-07-24 15:38:18 +00:00
|
|
|
*
|
2013-07-24 19:24:09 +00:00
|
|
|
* \note On entry, bridge_channel->bridge is already locked.
|
2013-07-24 15:38:18 +00:00
|
|
|
*
|
2013-07-24 19:24:09 +00:00
|
|
|
* \retval 0 on success.
|
|
|
|
* \retval -1 on failure. The channel did not get pushed.
|
2013-07-24 15:38:18 +00:00
|
|
|
*/
|
2013-07-24 19:24:09 +00:00
|
|
|
int bridge_channel_push(struct ast_bridge_channel *bridge_channel);
|
2013-07-24 15:38:18 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \internal
|
|
|
|
* \brief Pull the bridge channel out of its current bridge.
|
|
|
|
* \since 12.0.0
|
|
|
|
*
|
|
|
|
* \param bridge_channel Channel to pull.
|
|
|
|
*
|
|
|
|
* \note On entry, bridge_channel->bridge is already locked.
|
|
|
|
*
|
|
|
|
* \return Nothing
|
|
|
|
*/
|
|
|
|
void bridge_channel_pull(struct ast_bridge_channel *bridge_channel);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \internal
|
2013-07-24 19:24:09 +00:00
|
|
|
* \brief Join the bridge_channel to the bridge
|
2013-07-24 15:38:18 +00:00
|
|
|
*
|
2013-07-24 19:24:09 +00:00
|
|
|
* \param bridge_channel The Channel in the bridge
|
2013-07-24 15:38:18 +00:00
|
|
|
*
|
2013-07-24 19:24:09 +00:00
|
|
|
* \note This API call starts the bridge_channel's processing of events while
|
|
|
|
* it is in the bridge. It will return when the channel has been instructed to
|
|
|
|
* leave the bridge.
|
2013-07-24 15:38:18 +00:00
|
|
|
*/
|
|
|
|
void bridge_channel_join(struct ast_bridge_channel *bridge_channel);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \internal
|
2013-07-24 19:24:09 +00:00
|
|
|
* \brief Temporarily suspend a channel from a bridge, handing control over to some
|
|
|
|
* other system
|
2013-07-24 15:38:18 +00:00
|
|
|
*
|
2013-07-24 19:24:09 +00:00
|
|
|
* \param bridge_channel The channel in the bridge
|
|
|
|
* \note This function assumes that \ref bridge_channel is already locked
|
2013-07-24 15:38:18 +00:00
|
|
|
*/
|
2013-07-24 19:24:09 +00:00
|
|
|
void bridge_channel_suspend_nolock(struct ast_bridge_channel *bridge_channel);
|
2013-07-24 15:38:18 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \internal
|
2013-07-24 19:24:09 +00:00
|
|
|
* \brief Unsuspend a channel that was previously suspended
|
2013-07-24 15:38:18 +00:00
|
|
|
*
|
2013-07-24 19:24:09 +00:00
|
|
|
* \param bridge_channel The channel in the bridge
|
|
|
|
* \note This function assumes that \ref bridge_channel is already locked
|
2013-07-24 15:38:18 +00:00
|
|
|
*/
|
2013-07-24 19:24:09 +00:00
|
|
|
void bridge_channel_unsuspend_nolock(struct ast_bridge_channel *bridge_channel);
|
2013-07-24 15:38:18 +00:00
|
|
|
|
|
|
|
/*!
|
2013-07-24 19:24:09 +00:00
|
|
|
* \internal
|
|
|
|
* \brief Queue a blind transfer action on a transferee bridge channel
|
2013-07-24 15:38:18 +00:00
|
|
|
*
|
2013-07-24 19:24:09 +00:00
|
|
|
* This is only relevant for when a blind transfer is performed on a two-party
|
|
|
|
* bridge. The transferee's bridge channel will have a blind transfer bridge
|
|
|
|
* action queued onto it, resulting in the party being redirected to a new
|
|
|
|
* destination
|
2013-07-24 15:38:18 +00:00
|
|
|
*
|
2013-07-24 19:24:09 +00:00
|
|
|
* \param transferee The channel to have the action queued on
|
|
|
|
* \param exten The destination extension for the transferee
|
|
|
|
* \param context The destination context for the transferee
|
|
|
|
* \param hook Frame hook to attach to transferee
|
2013-07-24 15:38:18 +00:00
|
|
|
*
|
2013-07-24 19:24:09 +00:00
|
|
|
* \retval 0 on success.
|
|
|
|
* \retval -1 on error.
|
2013-07-24 15:38:18 +00:00
|
|
|
*/
|
2013-07-24 19:24:09 +00:00
|
|
|
int bridge_channel_queue_blind_transfer(struct ast_channel *transferee,
|
|
|
|
const char *exten, const char *context,
|
|
|
|
transfer_channel_cb new_channel_cb, void *user_data);
|
2013-07-24 15:38:18 +00:00
|
|
|
|
2013-07-24 19:24:09 +00:00
|
|
|
int bridge_channel_queue_attended_transfer(struct ast_channel *transferee,
|
|
|
|
struct ast_channel *unbridged_chan);
|
2013-07-24 15:38:18 +00:00
|
|
|
|
2013-07-24 16:01:20 +00:00
|
|
|
#endif /* _ASTERISK_PRIVATE_BRIDGING_H */
|