I tried your suggestion, however after a day or so I had about 10 mohplay.sh scripts running. All appeared to be streaming audio to never never land. Should there not be a quit command or somthing to stop it from playing when not used anymore?
I’ve run into the same issue Rob, and hopefully this helps you.
I tested this a few times. I put myself on hold on a phone and ran “pkill mpg123”. There was no discernible audio skip as the process closed and asterisk restarted mpg123. Audio stayed up on the MOH the entire time.
The next step I took was to setup a Cron job that runs “pkill mpg123” every 10 minutes (about how long before mpg123 reaches 20% cpu usage for me). I’ve been running this way for a few days now and have not had any issues since.
I’m not saying its the most graceful solution, but it works for me.