[svn-commits] bbryant: branch 1.4 r285638 - /branches/1.4/res/res_musiconhold.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Sep 9 12:20:22 CDT 2010


Author: bbryant
Date: Thu Sep  9 12:20:17 2010
New Revision: 285638

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=285638
Log:
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/

Modified:
    branches/1.4/res/res_musiconhold.c

Modified: branches/1.4/res/res_musiconhold.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/res/res_musiconhold.c?view=diff&rev=285638&r1=285637&r2=285638
==============================================================================
--- branches/1.4/res/res_musiconhold.c (original)
+++ branches/1.4/res/res_musiconhold.c Thu Sep  9 12:20:17 2010
@@ -250,10 +250,17 @@
 		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;
 	}
 




More information about the svn-commits mailing list