[Home]

Summary:ASTERISK-07445: MOH not starting sometimes in file mode
Reporter:Kaloyan Kovachev (knk)Labels:
Date Opened:2006-08-02 12:07:28Date Closed:2006-08-03 14:55:47
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_musiconhold
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) change.diff
Description:sometimes there is no music on hold and i get the folowing warnings:
WARNING[9073]: file.c:557 ast_openstream_full: File /var/lib/asterisk/moh/LICENSE does not exist in any format
WARNING[9073]: res_musiconhold.c:246 ast_moh_files_next: Unable to open file '/var/lib/asterisk/moh/LICENSE': No such file or directory
or
WARNING[29081]: file.c:557 ast_openstream_full: File /var/lib/asterisk/moh/ does not exist in any format
WARNING[29081]: res_musiconhold.c:246 ast_moh_files_next: Unable to open file '/var/lib/asterisk/moh/': No such file or directory

probably the files starting with "." are skipped, but not the folder "./" itself and LICENSE is not starting with "." at all.
Comments:By: Joshua C. Colp (jcolp) 2006-08-02 12:47:11

Here's my thoughts on this:

I don't know if it should be up to Asterisk to make sure that only audio files are in the MOH directory. HOWEVER - I don't believe it should just not play MOH when it reaches a file it can't read, so to that extent I'll see about changing it.

By: Kaloyan Kovachev (knk) 2006-08-02 14:40:56

not sure if i am right at all, as i am not C programmer, but looking at the code it looks for me that asterisk should try 20 times to open a valid audio file, which doesn't heppen when the random option is chosen as it is done afer the '20 times loop' instead of before.
if someone could confirm this, it should be enought to move the 'random' code few lines up.

By: Joshua C. Colp (jcolp) 2006-08-02 14:49:09

I just looked at trunk and it is in the 20 times loop, but I want to go through this code a bit more and learn exactly how it should behave. If you want to try though and post a patch, I'll certainly look at it.

By: Kaloyan Kovachev (knk) 2006-08-02 15:09:49

well, what i mean is having the attached diff, but can't test it right now, so not sure if it will fix the problem.

By: Kaloyan Kovachev (knk) 2006-08-02 16:39:57

and probably "if (ast_filexists(" (around line 233 in res_musiconhold.c) should be replaced with "if (ast_fileexists(...) >0" or even better - in moh_add_file or moh_scan_files, so it will be checked only once

By: Joshua C. Colp (jcolp) 2006-08-03 14:55:46

Fixed in 1.2 as of revision 38825 and trunk in revision 38826. Thanks!