aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/file.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/file.c b/main/file.c
index 7e0e3d748..ac9c68681 100644
--- a/main/file.c
+++ b/main/file.c
@@ -1227,7 +1227,14 @@ static int waitstream_core(struct ast_channel *c, const char *breakon,
} else {
res = fr->subclass;
if (strchr(forward, res)) {
+ int eoftest;
ast_stream_fastforward(c->stream, skip_ms);
+ eoftest = fgetc(c->stream->f);
+ if (feof(c->stream->f)) {
+ ast_stream_rewind(c->stream, skip_ms);
+ } else {
+ ungetc(eoftest, c->stream->f);
+ }
} else if (strchr(reverse, res)) {
ast_stream_rewind(c->stream, skip_ms);
} else if (strchr(breakon, res)) {