summaryrefslogtreecommitdiff
path: root/res/res_musiconhold.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r--res/res_musiconhold.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 72afed5d7..90bc47a62 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -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;