aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/channel.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/main/channel.c b/main/channel.c
index 1df51e8ee..8fa01ffb5 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2548,6 +2548,13 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
goto done;
}
+ /* Stop if we're a zombie or need a soft hangup */
+ if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan)) {
+ if (chan->generator)
+ ast_deactivate_generator(chan);
+ goto done;
+ }
+
if (chan->fdno == -1) {
#ifdef AST_DEVMODE
ast_log(LOG_ERROR, "ast_read() called with no recorded file descriptor.\n");
@@ -2557,13 +2564,6 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
f = &ast_null_frame;
goto done;
}
-
- /* Stop if we're a zombie or need a soft hangup */
- if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan)) {
- if (chan->generator)
- ast_deactivate_generator(chan);
- goto done;
- }
prestate = chan->_state;
/* Read and ignore anything on the alertpipe, but read only