Bug Fix for Music Upload for IVR and On Hold Audio Files

Recently in AsteriskNow and other centos based distro’s, the music on hold upload feature does not work. As we had a situation where it was a much needed feature for a customer. After some research we came up with the following fix for the issue. At line 217 in page.music.php we made the following change.

if (strtoupper(substr($origmohfile,-4)) == ‘.MP3’) {
$infile = $origmohfile;
$outfile = substr($origmohfile,0,strrpos($origmohfile,".")).".wav";
$mpg123cmd = “/usr/local/bin/mpg123 -w “”.$outfile.”" “”.$infile."" 2> /dev/null";
exec($mpg123cmd, $output, $returncode);
}

This has fixed the issue on trixbox, asterisk now, and installed from scratch on centos 5.5