summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/channel.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/main/channel.c b/main/channel.c
index 91419a76f..5197a7e21 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2489,12 +2489,6 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
}
prestate = chan->_state;
- /*
- * Reset the recorded file descriptor that triggered this read so that we can
- * easily detect when ast_read() is called without properly using ast_waitfor().
- */
- chan->fdno = -1;
-
/* Read and ignore anything on the alertpipe, but read only
one sizeof(blah) per frame that we send from it */
if (chan->alertpipe[0] > -1) {
@@ -2615,6 +2609,12 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
ast_log(LOG_WARNING, "No read routine on channel %s\n", chan->name);
}
+ /*
+ * Reset the recorded file descriptor that triggered this read so that we can
+ * easily detect when ast_read() is called without properly using ast_waitfor().
+ */
+ chan->fdno = -1;
+
if (f) {
/* if the channel driver returned more than one frame, stuff the excess
into the readq for the next ast_read call (note that we can safely assume