diff options
-rw-r--r-- | res/res_musiconhold.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index ccc618257..c7f1fff6a 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -227,6 +227,7 @@ static int ast_moh_files_next(struct ast_channel *chan) if (!ast_openstream_full(chan, state->class->filearray[state->pos], chan->language, 1)) { 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; return -1; } |