diff options
author | Richard Mudgett <rmudgett@digium.com> | 2012-05-10 21:29:41 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2012-05-10 21:29:41 +0000 |
commit | 4ea636c7768bca2e2decb96f1b08bfdd9f32bca9 (patch) | |
tree | 3abc3aa14879d0e0f6d80218499a4f6b86f4d5ff /include/asterisk/channel.h | |
parent | dd81b047dbf15a501b81354db505daf50703a1a0 (diff) |
Run predial routine on local;2 channel where you would expect.
Before this patch, the predial routine executes on the ;1 channel of a
local channel pair. Executing predial on the ;1 channel of a local
channel pair is of limited utility. Any channel variables set by the
predial routine executing on the ;1 channel will not be available when the
local channel executes dialplan on the ;2 channel.
* Create ast_pre_call() and an associated pre_call() technology callback
to handle running the predial routine. If a channel technology does not
provide the callback, the predial routine is simply run on the channel.
Review: https://reviewboard.asterisk.org/r/1903/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/channel.h')
-rw-r--r-- | include/asterisk/channel.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index ab6c736ed..d71b7e512 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -676,6 +676,20 @@ struct ast_channel_tech { * parameters as a parameter. */ int (* cc_callback)(struct ast_channel *inbound, const char *dest, ast_cc_callback_fn callback); + + /*! + * \brief Execute a Gosub call on the channel in a technology specific way before a call is placed. + * \since 11.0 + * + * \param chan Channel to execute Gosub in a tech specific way. + * \param sub_args Gosub application parameter string. + * + * \note The chan is locked before calling. + * + * \retval 0 on success. + * \retval -1 on error. + */ + int (*pre_call)(struct ast_channel *chan, const char *sub_args); }; /*! Kill the channel channel driver technology descriptor. */ @@ -1527,6 +1541,24 @@ int ast_raw_answer(struct ast_channel *chan, int cdr_answer); int __ast_answer(struct ast_channel *chan, unsigned int delay, int cdr_answer); /*! + * \brief Execute a Gosub call on the channel before a call is placed. + * \since 11.0 + * + * \details + * This is called between ast_request() and ast_call() to + * execute a predial routine on the newly created channel. + * + * \param chan Channel to execute Gosub. + * \param sub_args Gosub application parameter string. + * + * \note Absolutely _NO_ channel locks should be held before calling this function. + * + * \retval 0 on success. + * \retval -1 on error. + */ +int ast_pre_call(struct ast_channel *chan, const char *sub_args); + +/*! * \brief Make a call * \note Absolutely _NO_ channel locks should be held before calling this function. * \param chan which channel to make the call on |