Index: main/channel.c =================================================================== --- main/channel.c (revision 188734) +++ main/channel.c (working copy) @@ -2047,6 +2047,13 @@ 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"); @@ -2059,12 +2066,6 @@ 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