Automate IVR message changes for doctor on call


We have a main IVR for the office which has the user push 9 to be connected to the “emergency IVR” which lists the contact information for the doctor on call. Right now the IVR audio prompt is what we are changing each week when the on call schedule changes. I’d like to automate this somehow. I have no problem writing the code to determine who is on call, but the missing piece for me is how I can have freepbx swap out the recording programatically… Perhaps doing the recording swap is not the best idea?

Other ideas include using time conditions and multiple IVRs one for each person on call, but I really don’t like that idea.

Is there a API where I can modify an IVR and have freepbx re-generate the configurations?


I wrote something like this for a local Catholic archdiocese - they needed to have a “pastoral care” tree that works kind of like what you are describing.

What I did was set up a bunch of custom sound files with names like Nun1-Monday, Nun2-Monday. I then wrote a PHP program that happens to run on the server that copied the “nun of choice” into the slots she was filling that week. That way, we recorded the Sisters’ names once and just copied them over the custom sound files.