[asterisk-dev] Music on hold deafens in 1.4b3

Russell Bryant russell at digium.com
Sat Nov 4 10:14:29 MST 2006


John Lange wrote:
> But anyhow, assuming the meaning in C is the remainder, the code should
> work so thats not the problem.

I think I did find the problem, but I have not tested it.  By a quick look 
through the code, the randomize operation only occurs when switching to the next 
file, not when MOH is started.  So, adding it there as well should fix the issue 
you are seeing.

Please try the following patch:

Index: res/res_musiconhold.c
===================================================================
--- res/res_musiconhold.c       (revision 47191)
+++ res/res_musiconhold.c       (working copy)
@@ -313,6 +313,9 @@
                         state->class = class;
                 }

+               if (ast_test_flag(state->class, MOH_RANDOMIZE))
+                       state->pos = ast_random() % class->total_files;
+
                 state->origwfmt = chan->writeformat;

                 if (option_verbose > 2) 


-- 
Russell Bryant
Software Engineer
Digium, Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: russell.vcf
Type: text/x-vcard
Size: 266 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20061104/aa67680c/russell.vcf


More information about the asterisk-dev mailing list