summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorBrett Bryant <bbryant@digium.com>2010-09-09 17:25:24 +0000
committerBrett Bryant <bbryant@digium.com>2010-09-09 17:25:24 +0000
commit49d3bdd14c7cffc439a93a18c78ed683041d23d0 (patch)
tree7297602c34c8f9015ac5003ef919bfe38c10b521 /res
parent83bc091ac3c72a816c87e9c8365dc7ac4f788cb2 (diff)
Merged revisions 285640 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r285640 | bbryant | 2010-09-09 13:23:28 -0400 (Thu, 09 Sep 2010) | 21 lines Merged revisions 285639 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r285639 | bbryant | 2010-09-09 13:22:25 -0400 (Thu, 09 Sep 2010) | 14 lines Merged revisions 285638 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r285638 | bbryant | 2010-09-09 13:20:17 -0400 (Thu, 09 Sep 2010) | 7 lines Fixes an issue with MOH where it doesn't recover cleanly when it can't play a file and would just stop, instead of continuing to find the next playable file in the MOH class. (closes issue #17807) Reported by: kshumard Review: https://reviewboard.asterisk.org/r/910/ ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@285641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_musiconhold.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index e4ea16479..6024e9da8 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -318,10 +318,17 @@ static int ast_moh_files_next(struct ast_channel *chan)
state->samples = 0;
}
- if (!ast_openstream_full(chan, state->class->filearray[state->pos], chan->language, 1)) {
+ for (tries = 0; tries < state->class->total_files; ++tries) {
+ if (ast_openstream_full(chan, state->class->filearray[state->pos], chan->language, 1)) {
+ break;
+ }
+
ast_log(LOG_WARNING, "Unable to open file '%s': %s\n", state->class->filearray[state->pos], strerror(errno));
state->pos++;
state->pos %= state->class->total_files;
+ }
+
+ if (tries == state->class->total_files) {
return -1;
}