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?
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ā¦
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.
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.
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).
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.