summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2016-11-14 15:31:10 -0500
committerGeorge Joseph <gjoseph@digium.com>2016-11-14 13:44:43 -0700
commit88111da2356a8eab72c21b0db9968f9cd46d8889 (patch)
treef908595d2da92aec14e39e9f76f3c1f1f1f17f61 /include
parent2401e270238ef01cb6638ecf7f3520ddee6925a0 (diff)
Revert "Revert "Add API for channel frame deferral.""
This reverts commit b640f18a440e0b7438d836f04ca7146a4922e379. Change-Id: I4ad8e7f66b3e6457ac07e7965822ae39ac08464d
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/channel.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 78db878b3..cf8c5447b 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -967,6 +967,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 */
@@ -4661,4 +4666,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 */