Merged revisions 47239 via svnmerge from
[asterisk/asterisk.git] / res / res_musiconhold.c
index 72afed5..90bc47a 100644 (file)
@@ -311,6 +311,8 @@ static void *moh_files_alloc(struct ast_channel *chan, void *params)
                        /* initialize */
                        memset(state, 0, sizeof(*state));
                        state->class = class;
+                       if (ast_test_flag(state->class, MOH_RANDOMIZE))
+                               state->pos = ast_random() % class->total_files;
                }
 
                state->origwfmt = chan->writeformat;