diff options
author | zuul <zuul@gerrit.asterisk.org> | 2016-11-08 07:58:25 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-11-08 07:58:25 -0600 |
commit | 7477c95749985a2c1320bde333b7a20b9b4815ed (patch) | |
tree | 05793fb85584959ff5e1306e197608bad7b3e50f /include/asterisk | |
parent | 093eadf46aa0b843d237e59aea7ec0b343ed52ab (diff) | |
parent | 9231a56cf3d6f5eca1bf2d37d827453400690773 (diff) |
Merge "Add API for channel frame deferral." into 13
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/channel.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index a76e606f9..a18591fb1 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -966,6 +966,11 @@ enum { * The channel is executing a subroutine or macro */ AST_FLAG_SUBROUTINE_EXEC = (1 << 27), + /*! + * The channel is currently in an operation where + * frames should be deferred. + */ + AST_FLAG_DEFER_FRAMES = (1 << 28), }; /*! \brief ast_bridge_config flags */ @@ -4681,4 +4686,37 @@ enum ast_channel_error { */ enum ast_channel_error ast_channel_errno(void); +/*! + * \brief Retrieve the deferred read queue. + */ +struct ast_readq_list *ast_channel_deferred_readq(struct ast_channel *chan); + +/*! + * \brief Start deferring deferrable frames on this channel + * + * Sometimes, a channel gets entered into a mode where a "main" application + * is tasked with servicing frames on the channel, but that application does + * not need to act on those frames. However, it would be imprudent to simply + * drop important frames. This function can be called so that important frames + * will be deferred, rather than placed in the channel frame queue as normal. + * + * \pre chan MUST be locked before calling + * + * \param chan The channel on which frames should be deferred + */ +void ast_channel_start_defer_frames(struct ast_channel *chan); + +/*! + * \brief Stop deferring deferrable frames on this channel + * + * When it is time to stop deferring frames on the channel, all deferred frames + * will be queued onto the channel's read queue so that the next servicer of + * the channel can handle those frames as necessary. + * + * \pre chan MUST be locked before calling + * + * \param chan The channel on which to stop deferring frames. + */ +void ast_channel_stop_defer_frames(struct ast_channel *chan); + #endif /* _ASTERISK_CHANNEL_H */ |