Moh - permissions & lame?

hello, i have a problem with music on hold.
when I attempt to upload a wav i get this message "Error Processing: “sh: lame: command not found” for fpm-sunshine.wav!"
and im left with the wav file prepended with “orig_” in the …/mohmp3/ dir with the permissions of 600.

what gives? any brilliant insights? ok i would take not so brilliant insigts as well…
regards, dutler

centos 5 final
freepbx 2.3.1

I’ve seen an issue similar to this before with trixbox. Have you searched there forum? - there is a fix posted.

I did and did not fine the fix, I will look more. Dont hesitate to post a link :smiley:

I’m answering only because no one else has (there are two ways to be the best - be the best or be the only one).
If I had no idea what to do, I would think I never had lame installed. Did you do the install yourself?
See this guide to an install from scratch that includes instructions for installing lame.
Make sure you back up your server as there is never a fix so simple that you can’t crash everything!

I have the same problem !
The MOH module script “” can’t find and execute “lame” !!!

So, I have edited “”:
vi /srv/www/html/admin/modules/music/

And, in the “process_mohfile” function :

function process_mohfile($mohfile)
global $path_to_dir;
$output = 0;
$returncode = 0;
$newname = strtr($mohfile,"&", “_”);
$newmohfile=$path_to_dir."/". ((strpos($newname,’.mp3’) === false) ? $newname.".mp3" : $newname);
#$lamecmd=“lame --cbr -m m -t -F “”.$origmohfile.”" “”.$newmohfile."" 2>&1 “;
$lamecmd=”/usr/local/bin/lame --cbr -m m -t -F “”.$origmohfile."" “”.$newmohfile."" 2>&1 “;
if (strpos($newmohfile,’.mp3’) !== false)
exec($lamecmd, $output, $returncode);
if ($returncode != 0) {
return join(”
\n", $output);
$rmcmd=“rm -f “”. $origmohfile.”"";
return null;

I have replaced the line :
$lamecmd=“lame --cbr -m m -t -F “”.$origmohfile.”" “”.$newmohfile."" 2>&1 “;
by :
$lamecmd=”/usr/local/bin/lame --cbr -m m -t -F “”.$origmohfile."" “”.$newmohfile."" 2>&1 ";

You can also set full rights on the mohmp3 directory if necessary :
chmod -R 777 /var/lib/asterisk/mohmp3/

And now it work fine :slight_smile:

try installing lame via rpm - worked for me
still, lame should not have been needed in my case.

Linking lame to a folder in my $PATH worked fine for me. ln -s /usr/local/lame/bin/lame /usr/bin/lame