Can i change MOH on date based schedule

Hi All,
I have a client which wants to change moh automatically for each season i want to know if this is possible thank you?

Thank you All.

Unfortunately not. Unless you use a custom script to move the files.

There’s 1 or 2 feature requests for this on issues.freepbx.org, you can vote for these requests.

Cron job and cp the new MOH into the proper location, replacing the existing one?

thank you for respond how do i create a job on Cron so job run on the date thank you.

Here is my solution option. Go into extensions_custom.conf and do the following:

[seasons-moh]
exten => spring,1,NoOp(Spring Clean. Setting Spring Season MOH)
same => n,Set(CHANNEL(musicclass)=spring-moh)
same => n,Return()

exten => summer,1,NoOp(Summer Fun. Setting Summer Season MOH)
same => n,Set(CHANNEL(musicclass)=summer-moh)
same => n,Return()

exten => fall,1,NoOp(Fall is Here. Setting Fall Season MOH)
same => n,Set(CHANNEL(musicclass)=fall-moh)
same => n,Return()

exten => winter,1,NoOp(Winter is Coming. Setting Winter Season MOH)
same => n,Set(CHANNEL(musicclass)=winter-moh)
same => n,Return()

You then create a Custom Destination for each season. Call it what you want but when you set the target it would be seasons-moh,spring,1 if this was the spring destination. Set the Return option to Yes and select where the call should go from there. It should look like this:

You then create Time Conditions and Time Groups to match your seasonal needs. It will be a stacked chain of events for this to work. You will need to do the following:

  1. Set the Incoming Route destination to your first Time Condition, let’s say Spring.
  2. The Spring TC should have its Match go to the Custom Destination, its Unmatch go to Summer.
  3. Do the same for Summer and the rest. Summer’s Match goes to the Custom Destination for Summer and Unmatch goes to the next season’s TC (in this case fall). Repeat for Fall and Winter.

So now each DID will traverse through your seasons TC’s and if it’s the right season it will match to that season’s Custom Destination, set the proper MOH on the call going forward and send the call to the proper destination. If it’s not the proper season it will move to the next TC and repeat the process.

1 Like

Thank you so much i will give a try

What about outgoing calls?

Oddly enough, Outbound Routes use Time Conditions as well in current releases. So everything is already in place. Just use those TCs on your Outbound Routes.

Edit: Well actually, might need some additional custom destinations/TCs for outbound as they will have different destinations but the logic is still the same.

No, it uses time groups, not conditions. And it’s only whether to allow this route to be active, not to GoTo on a time based schedule

OK so then it will take a little more custom work. I’m going to say it again, the logic is the same. How they have to get it implemented for outbound, if needed, then that will need to be determined. How much outside of the GUI are they comfortable working with?

Honestly there are quite a few ways to skin this cat.

Right.

For incoming that is definitely the easiest, and can be done in the GUI.

But I think a script which will run via cron job that deletes the current files in the default folder, and copies from another folder the current season’s files would be a little cleaner. Just my opinion.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.