diff --git a/main/channel.c b/main/channel.c index 9da0c59935..4fa5ae7ead 100644 --- a/main/channel.c +++ b/main/channel.c @@ -2823,12 +2823,6 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio) usleep(1); } - if (chan->fdno == -1) { - ast_log(LOG_ERROR, "ast_read() called with no recorded file descriptor.\n"); - f = &ast_null_frame; - goto done; - } - if (chan->masq) { if (ast_do_masquerade(chan)) ast_log(LOG_WARNING, "Failed to perform masquerade\n"); @@ -2837,6 +2831,16 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio) goto done; } + if (chan->fdno == -1) { +#ifdef AST_DEVMODE + ast_log(LOG_ERROR, "ast_read() called with no recorded file descriptor.\n"); +#else + ast_debug(2, "ast_read() called with no recorded file descriptor.\n"); +#endif + 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)