diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-03-17 14:40:44 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-03-17 14:40:44 +0000 |
commit | 5fca5537305707415670af5ba7277353bd4a7e9f (patch) | |
tree | cb3260a83dc0ce644eafdbb8777bd60cb24ff136 /include | |
parent | cb09365667c0bbaea57a84ef4803ee05c9e811fd (diff) |
Merged revisions 182525 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r182525 | kpfleming | 2009-03-17 09:38:11 -0500 (Tue, 17 Mar 2009) | 11 lines
Improve behavior of ast_answer() to not lose incoming frames
ast_answer(), when supplied a delay before returning to the caller, use ast_safe_sleep() to implement the delay. Unfortunately during this time any incoming frames are discarded, which is problematic for T.38 re-INVITES and other sorts of channel operations.
When a delay is not passed to ast_answer(), it still delays for up to 500 milliseconds, waiting for media to arrive. Again, though, it discards any control frames, or non-voice media frames.
This patch rectifies this situation, by storing all incoming frames during the delay period on a list, and then requeuing them onto the channel before returning to the caller.
http://reviewboard.digium.com/r/196/
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@182528 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/channel.h | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 0f30ea1bc..eff55ca35 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -1008,12 +1008,61 @@ void ast_channel_setwhentohangup_tv(struct ast_channel *chan, struct timeval off * This function answers a channel and handles all necessary call * setup functions. * - * \note The channel passed does not need to be locked. + * \note The channel passed does not need to be locked, but is locked + * by the function when needed. + * + * \note This function will wait up to 500 milliseconds for media to + * arrive on the channel before returning to the caller, so that the + * caller can properly assume the channel is 'ready' for media flow. * * \retval 0 on success * \retval non-zero on failure */ int ast_answer(struct ast_channel *chan); + +/*! + * \brief Answer a channel + * + * \param chan channel to answer + * \param cdr_answer flag to control whether any associated CDR should be marked as 'answered' + * + * This function answers a channel and handles all necessary call + * setup functions. + * + * \note The channel passed does not need to be locked, but is locked + * by the function when needed. + * + * \note Unlike ast_answer(), this function will not wait for media + * flow to begin. The caller should be careful before sending media + * to the channel before incoming media arrives, as the outgoing + * media may be lost. + * + * \retval 0 on success + * \retval non-zero on failure + */ +int ast_raw_answer(struct ast_channel *chan, int cdr_answer); + +/*! + * \brief Answer a channel, with a selectable delay before returning + * + * \param chan channel to answer + * \param delay maximum amount of time to wait for incoming media + * \param cdr_answer flag to control whether any associated CDR should be marked as 'answered' + * + * This function answers a channel and handles all necessary call + * setup functions. + * + * \note The channel passed does not need to be locked, but is locked + * by the function when needed. + * + * \note This function will wait up to 'delay' milliseconds for media to + * arrive on the channel before returning to the caller, so that the + * caller can properly assume the channel is 'ready' for media flow. If + * 'delay' is less than 500, the function will wait up to 500 milliseconds. + * + * \retval 0 on success + * \retval non-zero on failure + */ int __ast_answer(struct ast_channel *chan, unsigned int delay, int cdr_answer); /*! \brief Make a call |