diff options
author | George Joseph <gjoseph@digium.com> | 2016-11-10 08:41:55 -0500 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2016-11-10 08:41:55 -0500 |
commit | 6b5a7ced136b7178ae0b2ba39221eba1cd2e37c9 (patch) | |
tree | 67b934f0d73ff74fddad4bb7fd1e06a5eb928eaa /main | |
parent | 9231a56cf3d6f5eca1bf2d37d827453400690773 (diff) |
Revert "Add API for channel frame deferral."
This reverts commit 9231a56cf3d6f5eca1bf2d37d827453400690773.
Multiple testsuite failures were detected after the fact.
Change-Id: I3bac8d7c3ddb69a4ddf6c5d6de0ffa5ff7ff3af7
Diffstat (limited to 'main')
-rw-r--r-- | main/channel.c | 45 | ||||
-rw-r--r-- | main/channel_internal_api.c | 6 |
2 files changed, 0 insertions, 51 deletions
diff --git a/main/channel.c b/main/channel.c index e85208b46..278104cc9 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1061,25 +1061,6 @@ struct ast_channel *ast_dummy_channel_alloc(void) return tmp; } -void ast_channel_start_defer_frames(struct ast_channel *chan) -{ - ast_set_flag(ast_channel_flags(chan), AST_FLAG_DEFER_FRAMES); -} - -void ast_channel_stop_defer_frames(struct ast_channel *chan) -{ - ast_clear_flag(ast_channel_flags(chan), AST_FLAG_DEFER_FRAMES); - - /* Move the deferred frames onto the channel read queue, ahead of other queued frames */ - ast_queue_frame_head(chan, AST_LIST_FIRST(ast_channel_deferred_readq(chan))); - /* ast_frfree will mosey down the list and free them all */ - if (!AST_LIST_EMPTY(ast_channel_deferred_readq(chan))) { - ast_frfree(AST_LIST_FIRST(ast_channel_deferred_readq(chan))); - } - /* Reset the list to be empty */ - AST_LIST_HEAD_INIT_NOLOCK(ast_channel_deferred_readq(chan)); -} - static int __ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin, int head, struct ast_frame *after) { struct ast_frame *f; @@ -3904,32 +3885,6 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio) if (!AST_LIST_EMPTY(ast_channel_readq(chan))) { int skip_dtmf = should_skip_dtmf(chan); - if (ast_test_flag(ast_channel_flags(chan), AST_FLAG_DEFER_FRAMES)) { - AST_LIST_TRAVERSE_SAFE_BEGIN(ast_channel_readq(chan), f, frame_list) { - if (ast_is_deferrable_frame(f)) { - if (f->frametype == AST_FRAME_CONTROL && f->subclass.integer == AST_CONTROL_HANGUP) { - struct ast_frame *dup; - - /* Hangup is a special case. We want to defer the frame, but we also do not - * want to remove it from the frame queue. So rather than just moving the frame - * over, we duplicate it and move the copy to the deferred readq. - * - * The reason for this? This way, whoever calls ast_read() will get a NULL return - * immediately and can tell the channel has hung up and do what it needs to. Also, - * when frame deferral finishes, then whoever calls ast_read() next will also get - * the hangup. - */ - dup = ast_frdup(f); - AST_LIST_INSERT_TAIL(ast_channel_deferred_readq(chan), dup, frame_list); - } else { - AST_LIST_INSERT_TAIL(ast_channel_deferred_readq(chan), f, frame_list); - AST_LIST_REMOVE_CURRENT(frame_list); - } - } - } - AST_LIST_TRAVERSE_SAFE_END; - } - AST_LIST_TRAVERSE_SAFE_BEGIN(ast_channel_readq(chan), f, frame_list) { /* We have to be picky about which frame we pull off of the readq because * there are cases where we want to leave DTMF frames on the queue until diff --git a/main/channel_internal_api.c b/main/channel_internal_api.c index 4bc770d3b..90f59d64a 100644 --- a/main/channel_internal_api.c +++ b/main/channel_internal_api.c @@ -223,7 +223,6 @@ 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 */ @@ -1699,8 +1698,3 @@ 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; -} |