[asterisk-bugs] [Asterisk 0014831]: Music on Hold class loaded only after asterisk is restarted.

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Apr 22 15:07:21 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14831 
====================================================================== 
Reported By:                chris-mac
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   14831
Category:                   Resources/res_musiconhold
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): 1.6.1 
SVN Revision (number only!): 186527 
Request Review:              
====================================================================== 
Date Submitted:             2009-04-05 11:22 CDT
Last Modified:              2009-04-22 15:07 CDT
====================================================================== 
Summary:                    Music on Hold class loaded only after asterisk is
restarted.
Description: 
Just noticed strange behaviour of Music on Hold.

When I start asterisk for the first time (after the server was powered
on), and try to put a SIP call on hold, console shows:

DEBUG[5845]: res_musiconhold.c:726 get_mohbyname: Music on Hold class
'default' not found in memory

the following CLI command shows nothing:
asterisk -r -x "moh show classes"

Only after asterisk is restarted MoH works OK, and 'asterisk -r -x "moh
show classes"' shows:
--------------------
Class: default
	Mode: files
	Directory: /var/lib/asterisk/moh
--------------------

My musiconhold.conf:
----------------
[general]
cachertclasses=yes

[default]
mode=files
directory=/var/lib/asterisk/moh
----------------

Already tried with cachertclasses=yes/no with the same result.

Best regards,
Chris
====================================================================== 

---------------------------------------------------------------------- 
 (0103650) chris-mac (reporter) - 2009-04-22 15:07
 http://bugs.digium.com/view.php?id=14831#c103650 
---------------------------------------------------------------------- 
I changed line 957-960 of res_musiconhold.c to:

957: if (chdir(path) < 0) {
958:		ast_log(LOG_WARNING, "chdir() failed: %s - path: %s\n",
strerror(errno),path);
959:		return -1;
960: }

and now I am getting the following error, when starting Asterisk via HA:

[Apr 22 21:02:29] WARNING[5878]: res_musiconhold.c:958 moh_scan_files:
chdir() failed: Permission denied - path: /var/lib/heartbeat/cores/root

So looks like 'path' variable is somehow set to
'/var/lib/heartbeat/cores/root' but I have no idea why :-( 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-04-22 15:07 chris-mac      Note Added: 0103650                          
======================================================================




More information about the asterisk-bugs mailing list