Summary:ASTERISK-17875: Asterisk "forgets" default music on hold files
Reporter:David Cunningham (dcunningham)Labels:
Date Opened:2011-05-17 21:33:38Date Closed:2011-07-20 11:18:08
Versions: Frequency of
Environment:Attachments:( 0) res_musiconhold.c.mohrt17875_v1
Description:I have multiple Asterisk systems giving the same behaviour. They load the "default" MoH class and "moh show files" shows the files as expected. Then some time (hours) later Asterisk forgets these files, gives an error when playing the default class, "moh show files" gives no results, and an Asterisk restart is needed. "moh reload" does not fix it. I don't see anything in Asterisk's logging to indicate when it was forgotten.

Please note realtime musiconhold is also enabled.
I'm happy to give other information as required.


Error given:
[May 13 17:19:45] WARNING[25144]: res_musiconhold.c:783 start_moh_exec: Unable to start music on hold class 'default' on channel SIP/enswitch-local-00000140

cachertclasses = no

mode = files
directory = /var/lib/asterisk/moh
random = yes

"moh show files" when working:
Class: default
File: /var/lib/asterisk/moh/reno_project-system
File: /var/lib/asterisk/moh/macroform-the_simplicity
File: /var/lib/asterisk/moh/macroform-robot_dity
File: /var/lib/asterisk/moh/macroform-cold_day
File: /var/lib/asterisk/moh/manolo_camp-morning_coffee
Comments:By: Leif Madsen (lmadsen) 2011-05-18 15:16:47

Are you able to reproduce this on the latest Asterisk 1.8 version?


Per the Asterisk maintenance timeline page at http://www.asterisk.org/asterisk-versions maintenance (bug) support for the 1.4 and 1.6.x branches has ended. For continued maintenance support please move to the 1.8 branch which is a long term support (LTS) branch.

For more information about branch support, please see https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions

By: David Cunningham (dcunningham) 2011-05-18 18:47:37

No, I don't have any Asterisk 1.8 systems at this time. I guess we will have to wait until we do.

By: David Cunningham (dcunningham) 2011-06-07 20:53:33.476-0500

I have just tested this on Asterisk and it's the same. I can reproduce it at will by running "moh reload" or "module reload", and from then "moh show files" returns no results. Please let me know if you need any more information.

By: David Cunningham (dcunningham) 2011-06-08 21:13:11.960-0500

Same on

By: Igor Goncharovsky (igorg) 2011-06-21 10:51:38.574-0500

That issue was introduced in #16982, so when config reloaded and unchanged, all music classes marked for deletion. Patch exclude CONFIG_STATUS_FILEUNCHANGED from case when cached realtime records deleted.

By: Mark Murawski (kobaz) 2011-06-21 13:16:38.776-0500

What is the output of 'moh show classes' when music classes are no longer available.

By: David Cunningham (dcunningham) 2011-06-21 17:45:54.070-0500

"moh show classes" also returns no results.

I will try the patch supplied by Igor and get back to you.

By: Alistair Cunningham (acunningham) 2011-06-28 07:57:56.048-0500

Our customer reports that this fixes the problem! Can we please have this included in the next Asterisk 1.6.2.X and 1.8.X?

By: Jonathan Rose (jrose) 2011-06-28 14:36:54.857-0500

I'd like to get some feedback from David Cunningham to make sure this is a complete fix before we ship it.  Asterisk 1.6.2 is no longer supported though except for security issues, and while I'll acknowledge that losing all of your realtime music classes is doubtlessly very annoying, a security issue, it is not.  It's a pretty small patch though, and the stuff around it is rather unlikely to change from a security release any time in the near future, so you can always just keep the patch handy.  It's significantly easier to keep a set of patches on hand when you don't need to worry as much about the developer changing the program constantly and causing them to stop working as collateral damage I think.

I don't know if it'll be in the next 1.8 release since I think that might be going out like... today, but pretty soon seems fairly likely.

By: David Cunningham (dcunningham) 2011-06-28 19:32:58.637-0500

This fix seems to do it, thanks for your assistance!

By: Jonathan Rose (jrose) 2011-07-20 11:18:08.217-0500

This issue was fixed in a patch committed some time ago.