Thursday, June 18, 2009

Moh-fo

Music on hold (moh) has been put on hold...

In FreePBX webgui you can upload a sound file for moh. It ask for a wav or an mp3, but apparently mp3s don't work out of the box on Trixbox. There is some kind of converter that is not installed by default, and so it doesn't work. We may update that some day, but for a quick solution, we'll use a wav file with the same properties as the IVR (8bit mono etc).

So, going through the webgui, I tried to upload the wav, and go the following error(s):

1. Orgingally it said that the upload limit size was 2M. So, I edited /etc/php.ini so that

max_upload_size = 10M instead of 2M.

2.
Error Processing: "sox: Can't open input file '/var/lib/asterisk/mohmp3/orig_studyno3.wav': No such file or directory" for studyno3.wav!
This is not a fatal error, your Music on Hold may still work.
...but probably not. For one thing the directory /var/lib/asterisk/mohmp3 didn't even exist, so I did:

mkdir /var/lib/asterisk/mohmp3

Then set the permission as before chown -R asterisk:asterisk /var/lib/asterisk/mohmp3

Then, we need to change the permissions on the folder so that the user:group (ie asterisk:asterisk) can read, write, and execute files (7) in mohmp3, and others can read and extecute (5):

chmod 775 /var/lib/asterisk/mohmp3

I uploaded the file again... success! Sort of:

Error Processing: "sox: Input and Output rates must be different to use resample effect" for studyno3.wav!
This is not a fatal error, your Music on Hold may still work.
Yes, it may, and probably does still work. That error can be more or less ignored. I think it basically is saying that my file was already in the same format to which it would have been converted... had the converter been installed.

Moh for your money.

DJ@Paris

EDIT:

As per MT's comment, the moh still didn't work. That is because all of the uploaded files seem to still have the apache:apache ownership. We must be uploading them incorrectly. I chown-ed them to asterisk:asterisk, so they should work now. I guess the IVR might need re-chown-ing everytime we upload as well.

DJ@Paris

1 comment:

  1. Hi DJ,

    Good attempt but it still appears that MOH=X

    Maybe I need Moh Info...

    Anyways, what's happening is basically the same thing. I go to MOH and then browse for the PBX-ready file. The file is a 2.1MB .wav file. So, we don't need to convert it. As mentioned in my other post i have successfully uploaded it to the "System Recordings" area so the file seems fine. I will zip up and email you that file so that you can mess around with it. My idea, as mentioned in another email, was that we try to test the file in the system a different way by somehow making it the voice mail of a test extension. Probblem is that I couldn't figure out how to assign a custom audio file as the VM of an extension...that must be for another post.

    So, good luck with them there permissions, CodeBoy.

    I like that command 'chown'. Every time I read it I think its either a short form of 'chow down' or or some cool new term for 'harsh'... like "That movie is chown, dude. Totally chown."

    ReplyDelete