[asterisk-commits] russell: branch 1.2 r47238 - /branches/1.2/res/res_musiconhold.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Nov 6 18:22:58 MST 2006


Author: russell
Date: Mon Nov  6 19:22:58 2006
New Revision: 47238

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

Modified:
    branches/1.2/res/res_musiconhold.c

Modified: branches/1.2/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/res/res_musiconhold.c?rev=47238&r1=47237&r2=47238&view=diff
==============================================================================
--- branches/1.2/res/res_musiconhold.c (original)
+++ branches/1.2/res/res_musiconhold.c Mon Nov  6 19:22:58 2006
@@ -297,6 +297,8 @@
 			/* initialize */
 			memset(state, 0, sizeof(struct moh_files_state));
 			state->class = class;
+			if (ast_test_flag(state->class, MOH_RANDOMIZE))
+				state->pos = rand() % class->total_files;
 		}
 
 		state->origwfmt = chan->writeformat;



More information about the asterisk-commits mailing list