diff options
author | Mark Michelson <mmichelson@digium.com> | 2016-11-03 16:36:13 -0500 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2016-11-08 07:37:54 -0500 |
commit | f073f648b87d45e4729969fd2d83695c300757d1 (patch) | |
tree | ff98700292728dd43382244fdf88090604e4ebe0 /main/channel_internal_api.c | |
parent | 61af0e67047b0da758e8ad5f9705bc028ebb9d36 (diff) |
Add API for channel frame deferral.
There are several places in Asterisk that have duplicated logic
for deferring important frames until later.
This commit adds a couple of API calls to facilitate this automatically.
ast_channel_start_defer_frames(): Future reads of deferrable frames on
this channel will be deferred until later.
ast_channel_stop_defer_frames(): Any frames that have been deferred get
requeued onto the channel.
ASTERISK-26343
Change-Id: I3e1b87bc6796f222442fa6f7d1b6a4706fb33641
Diffstat (limited to 'main/channel_internal_api.c')
-rw-r--r-- | main/channel_internal_api.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/main/channel_internal_api.c b/main/channel_internal_api.c index 1cb91e7c3..50f6c5da9 100644 --- a/main/channel_internal_api.c +++ b/main/channel_internal_api.c @@ -221,6 +221,7 @@ struct ast_channel { struct stasis_cp_single *topics; /*!< Topic for all channel's events */ struct stasis_forward *endpoint_forward; /*!< Subscription for event forwarding to endpoint's topic */ struct stasis_forward *endpoint_cache_forward; /*!< Subscription for cache updates to endpoint's topic */ + struct ast_readq_list deferred_readq; }; /*! \brief The monotonically increasing integer counter for channel uniqueids */ @@ -1681,3 +1682,8 @@ enum ast_channel_error ast_channel_internal_errno(void) return *error_code; } + +struct ast_readq_list *ast_channel_deferred_readq(struct ast_channel *chan) +{ + return &chan->deferred_readq; +} |