Hang up if no moh streaming?

Update. Using madplay ended up solving one of my problems. Stream resumes with no issues.

So now I just need to figure out how to get asterisk to hang up when the stream ends. I get the warning res_musiconhold.c:809 monmp3thread: poll() failed: Interrupted system call when the stream ends, so maybe there is some way to build a script where if that warning comes up in asterisk console, asterisk hangs up?