Automatically Receive Call to Play Audio Livestream (MOH)?

I found these instructions and it works perfectly! I made sure that I first installed mplayer (apt install mplayer), and then when I created the moh.sh file, I made sure I typed chmod a+x moh.sh to make it executable. When I call, I hear whatever stream I put in there (whether Shoutcast, or my Icecast stream, which is local.

I don’t know enough about bash scripts. How would I change it so that when there is no stream detected from the url, that it defaults to /var/lib/asterisk/sounds/pleasecallback.wav? pleasecallback.wav is a wav file where I tell the person calling in to call back later when there is a live stream.

2 Likes