diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-07 01:25:10 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-07 01:25:10 +0000 |
commit | c2a5807b69de446a3554e8e08835b92643f1d542 (patch) | |
tree | 1aa9e9ab0c1a2f3403361c47f4bb516930b48dd5 /res | |
parent | 1bb90f5c0ec19fd363814b2c2e2a5cad85725fba (diff) |
Merged revisions 47238 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r47238 | russell | 2006-11-06 20:22:58 -0500 (Mon, 06 Nov 2006) | 5 lines
If random order is enabled for files mode music on hold, set a random initial
position, instead of always starting at the first file, and doing the random
operation only when switching to the next file.
(bug reported by John Lange on the asterisk-dev mailing list)
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47239 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_musiconhold.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 56e8a1d28..ccdf9fa48 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; |