ensure that the random number generator(s) are always seeded with a different value...
[asterisk/asterisk.git] / res / res_musiconhold.c
index ac6c0d5..6ba33b3 100755 (executable)
@@ -169,10 +169,9 @@ static int ast_moh_files_next(struct ast_channel *chan)
                                state->pos++;
                        }
 
-                       if (ast_test_flag(state->class, MOH_RANDOMIZE)) {
-                               srand(time(NULL)+getpid()+strlen(chan->name)-state->class->total_files);
+                       if (ast_test_flag(state->class, MOH_RANDOMIZE))
                                state->pos = rand();
-                       }
+
                        /* check to see if this file's format can be opened */
                        if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) != -1)
                                break;