(closes issue #17807)
Reported by: kshumard
Review: https://reviewboard.asterisk.org/r/910/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@285638
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
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;
}