diff options
author | Russell Bryant <russell@russellbryant.com> | 2006-11-07 01:28:08 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2006-11-07 01:28:08 +0000 |
commit | 89d48b53a2d13d4ae53a59cda18ac7e95b4dc13b (patch) | |
tree | 1690384cca80513eea094385b6b6dc5269bfde84 /res/res_musiconhold.c | |
parent | 0f621aa13e0523bd8af39ee5a513d8f7cd954775 (diff) |
Merged revisions 47239 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r47239 | russell | 2006-11-06 20:25:10 -0500 (Mon, 06 Nov 2006) | 13 lines
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: https://origsvn.digium.com/svn/asterisk/trunk@47240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_musiconhold.c')
-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 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; |