This does not fix the bug reported, but I believe it is correct.
(from issue #12446)
Patches:
bug_12446.diff uploaded by snuffy (license 35)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115418
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
} else if (ast_test_flag(state->class, MOH_RANDOMIZE)) {
/* Get a random file and ensure we can open it */
for (tries = 0; tries < 20; tries++) {
- state->pos = rand() % state->class->total_files;
+ state->pos = ast_random() % state->class->total_files;
if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) > 0)
break;
}