aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-26 21:25:52 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-26 21:25:52 +0000
commitf79a78a1e09b14b5ea3c257ed5c55348fa6ee0de (patch)
tree35bb6ac9297912c02568550b19da393868ac2451 /main
parent31eb051cdc79210006408ebf927b932eefda0a9e (diff)
Merged revisions 203802 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r203802 | russell | 2009-06-26 16:21:48 -0500 (Fri, 26 Jun 2009) | 22 lines Merged revisions 203785 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r203785 | russell | 2009-06-26 16:16:39 -0500 (Fri, 26 Jun 2009) | 15 lines Don't fast forward past the end of a message. This is nice change for users of the voicemail application. If someone gets a little carried away with fast forwarding through a message, they can easily get to the end and accidentally exit the voicemail application by hitting the fast forward key during the following prompt. This adds some safety by not allowing a fast forward past the end of a message. (closes issue #14554) Reported by: lacoursj Patches: 21761.patch uploaded by lacoursj (license 707) Tested by: lacoursj ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@203818 f38db490-d61c-443f-a65b-d21fe96a405b
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 67c8c77c5..8b4f1db63 100644
--- a/main/file.c
+++ b/main/file.c
@@ -1211,7 +1211,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(rewind, res)) {
ast_stream_rewind(c->stream, skip_ms);
} else if (strchr(breakon, res)) {