core_local.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 2013 Digium, Inc.
00005  *
00006  * Richard Mudgett <rmudgett@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 /*!
00020  * \file
00021  * \brief Local proxy channel special access.
00022  *
00023  * \author Richard Mudgett <rmudgett@digium.com>
00024  *
00025  * See Also:
00026  * \arg \ref AstCREDITS
00027  */
00028 
00029 #ifndef _ASTERISK_CORE_LOCAL_H
00030 #define _ASTERISK_CORE_LOCAL_H
00031 
00032 #if defined(__cplusplus) || defined(c_plusplus)
00033 extern "C" {
00034 #endif
00035 
00036 /* Forward declare some struct names */
00037 struct ast_channel;
00038 struct ast_bridge;
00039 struct ast_bridge_features;
00040 struct stasis_message_type;
00041 
00042 /* ------------------------------------------------------------------- */
00043 
00044 /*!
00045  * \brief Get the other local channel in the pair.
00046  * \since 12.0.0
00047  *
00048  * \param ast Local channel to get peer.
00049  *
00050  * \note On entry, ast must be locked.
00051  *
00052  * \retval peer reffed on success.
00053  * \retval NULL if no peer or error.
00054  */
00055 struct ast_channel *ast_local_get_peer(struct ast_channel *ast);
00056 
00057 /*!
00058  * \brief Setup the outgoing local channel to join a bridge on ast_call().
00059  * \since 12.0.0
00060  *
00061  * \param ast Either channel of a local channel pair.
00062  * \param bridge Bridge to join.
00063  * \param swap Channel to swap with when joining.
00064  * \param features Bridge features structure.
00065  *
00066  * \note The features parameter must be NULL or obtained by
00067  * ast_bridge_features_new().  You must not dereference features
00068  * after calling even if the call fails.
00069  *
00070  * \note Intended to be called after ast_request() and before
00071  * ast_call() on a local channel.
00072  *
00073  * \retval 0 on success.
00074  * \retval -1 on error.
00075  */
00076 int ast_local_setup_bridge(struct ast_channel *ast, struct ast_bridge *bridge, struct ast_channel *swap, struct ast_bridge_features *features);
00077 
00078 /*!
00079  * \brief Setup the outgoing local channel to masquerade into a channel on ast_call().
00080  * \since 12.0.0
00081  *
00082  * \param ast Either channel of a local channel pair.
00083  * \param masq Channel to masquerade into.
00084  *
00085  * \note Intended to be called after ast_request() and before
00086  * ast_call() on a local channel.
00087  *
00088  * \retval 0 on success.
00089  * \retval -1 on error.
00090  */
00091 int ast_local_setup_masquerade(struct ast_channel *ast, struct ast_channel *masq);
00092 
00093 /* ------------------------------------------------------------------- */
00094 
00095 /*!
00096  * \brief Message type for when two local channel halves are bridged together
00097  * \since 12.0.0
00098  *
00099  * \note Payloads for the \ref ast_local_bridge_type are a \ref ast_multi_channel_blob.
00100  * Roles for the channels in the \ref ast_multi_channel_blob are "1" and "2", reflecting
00101  * the two halves. Unlike most other bridges, the 'bridge' between two local channels is
00102  * not part of the bridge framework; as such, the message simply references the two local
00103  * channel halves that are now bridged.
00104  *
00105  * \retval A \ref stasis message type
00106  */
00107 struct stasis_message_type *ast_local_bridge_type(void);
00108 
00109 /*!
00110  * \brief Message type for when a local channel optimization begins
00111  * \since 12.0.0
00112  *
00113  * \note Payloads for the \ref ast_local_optimization_begin_type are a
00114  * \ref ast_multi_channel_blob. Roles for the channels in the \ref ast_multi_channel_blob
00115  * are "1" and "2", reflecting the two halves.
00116  *
00117  * \retval A \ref stasis message type
00118  */
00119 struct stasis_message_type *ast_local_optimization_begin_type(void);
00120 
00121 /*!
00122  * \brief Message type for when a local channel optimization completes
00123  * \since 12.0.0
00124  *
00125  * \note Payloads for the \ref ast_local_optimization_end_type are a
00126  * \ref ast_multi_channel_blob. Roles for the channels in the \ref ast_multi_channel_blob
00127  * are "1" and "2", reflecting the two halves.
00128  *
00129  * \retval A \ref stasis message type
00130  */
00131 struct stasis_message_type *ast_local_optimization_end_type(void);
00132 
00133 #if defined(__cplusplus) || defined(c_plusplus)
00134 }
00135 #endif
00136 
00137 #endif   /* _ASTERISK_CORE_LOCAL_H */

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