Change Music-On-Hold on a Schedule

Hi,

I would like to have two MOH classes (normal and christmas). Normal plays most of the year and christmas plays during December. Is there a way to make this happen system wide either with a manual switch or a date based schedule?

Any ideas?

Thanks,
Kevin

Probably. I doubt it will be simple, but Iā€™d say probably.

My gut feeling on this is that currently it would either need custom code (think extensions_custom.conf) or a music on hold custom application/script that would check the dateā€¦

I am surprised there seems to be no way to do this currentlyā€¦ I remember years ago in one of my jobs someone would manually change the music on hold on our old PBX for Christmas, I would have assumed by now there would have been a way to automatize thisā€¦

Have a nice day!

Nick

Calendar control is coming to 14. Put in a feature request

In the interim, a cron job that ā€œlnā€™sā€ /var/lib/asterisk/mohchristmas to /var/lib/asterisk/moh on December 1st at 00:01 and another that ā€œlnā€™sā€ /var/lib/asterisk/mohnormal to /var/lib/asterisk/moh on Januuary 5th at 23:59 would work. Iā€™ll leave the population of those directories to you.

1 Like

Thanks for the ideas guys!

The cron job is probably best for now, though Iā€™d hoped to be able to do it in asterisk/freepbx. Iā€™ve been playing with using a global variable that holds the MOH class name. The idea is that I could set the variable either programatically or by calling an extension and then when music is played it would use the variable to set the class. This works well in basic testing, but I havenā€™t been able to figure out how I would use the variable in the parking config or maybe in a route.

Thanks,
Kevin

Ok, Iā€™m real close I thinkā€¦

For testing, Iā€™m setting the MOHCLASS variable in globals_custom.conf. When I make a call, I can see that MOH class is getting set to the value of MOHCLASS as expected. However, if the value of MOHCLASS is anything other than ā€˜defaultā€™, no music is played when on holdā€¦my ā€˜christmasā€™ class is present and working if I do MusicOnHold(christmas).

Thoughts?

Nevermind, it works, I donā€™t know what I had wrong the first time.

Next stepā€¦how to get parking to use the MOHCLASS variable, or honor the channelā€™s MOH classā€¦

Ok, so if I comment out the ā€˜parkedmusicclassā€™ setting in res_parking.conf then the music class is inherit therefore honoring my MOHCLASS value.

Is there a way to override settings in res_parking.conf with custom values that wonā€™t get overwritten by the GUI (which only lets me choose specific music classes)? I just need to completely remove the ā€˜parkedmusicclassā€™ setting.

Thanks,
Kevin