# MOH - problem with mp3

**URL:** <https://community.freepbx.org/t/moh-problem-with-mp3/8129>\
**Category:** General Help\
**Created:** [April 7, 2010, 2:30pm UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129 "2010-04-07T14:30:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ste73](https://community.freepbx.org/letter_avatar_proxy/v4/letter/s/ac8455/32.png) [@Ste73](https://community.freepbx.org/u/Ste73)\
**Post date:** [April 7, 2010, 2:30pm UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/1 "2010-04-07T14:30:38Z")

</div>

Hi, in my last freepbx installation i have a brand new problem (fpbx last release as today)

if i upload an mp3 i have:

Error Processing: “sox failed to convert file and original could not be copied as a fall back” for prelude01.mp3!

file seems to be loaded, but … if i try to use it nothing is played and on log i have:

WARNING[14197] file.c: File /var/lib/asterisk//mohmp3//orig\_01-suite-prelude does not exist in any format  
WARNING[14197] res\_musiconhold.c: Unable to open file ‘/var/lib/asterisk//mohmp3//orig\_01-suite-prelude’: No such file or directory

obiouvsly file is there!

If i try using the default .ulaw file it works …

---

<div class="post-metadata">

**Author:** ![daled](https://community.freepbx.org/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@daled](https://community.freepbx.org/u/daled)\
**Post date:** [April 10, 2010, 2:44pm UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/2 "2010-04-10T14:44:08Z")

</div>

I am also observing the same problem.

---

<div class="post-metadata">

**Author:** ![tbagalini](https://community.freepbx.org/letter_avatar_proxy/v4/letter/t/3be4f8/32.png) [@tbagalini](https://community.freepbx.org/u/tbagalini)\
**Post date:** [April 13, 2010, 2:27am UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/3 "2010-04-13T02:27:11Z")

</div>

Anyone have a fix for this yet?  
Error Processing: “sox failed to convert file and original could not be copied as a fall back”

downloaded asterisk now then upgraded all modules.  
MOH doesnt work… running all updates.  
FreePBX 2.7.0.1

---

<div class="post-metadata">

**Author:** ![daled](https://community.freepbx.org/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@daled](https://community.freepbx.org/u/daled)\
**Post date:** [April 13, 2010, 10:19pm UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/4 "2010-04-13T22:19:57Z")

</div>

I ended up working around the problem by converting the mp3 files to .wav files that are encoded as 8Kbit/sec, mono, 16bits PCM and then uploading the wav file instead of the mp3 file.

You also need to first create the directory /var/lib/asterisk/mohmp3/ and chown and chgrp to asterisk (and mode 775). This is the diretory wher FreePBX tries to store the file and it is not created in the freebpx installation process.

---

<div class="post-metadata">

**Author:** ![askjoo](https://community.freepbx.org/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@askjoo](https://community.freepbx.org/u/askjoo)\
**Post date:** [April 15, 2010, 5:06am UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/5 "2010-04-15T05:06:33Z")

</div>

Hi,

I tried to upload a .wav but I still get:

Error Processing: “sox failed to convert file and original could not be copied as a fall back” for simple.wav!  
This is not a fatal error, your Music on Hold may still work.

I figured could be due to a upload limitation in php.ini so I changed the upload configuration to:

; Maximum allowed size for uploaded files.  
upload\_max\_filesize = 20M

That didn’t do it… kinda stuck. I installed my freepbx 2.7.0.1 using Yum on Centos 5.4 so I’m wondering if my build didn’t include/compile/install the MOH conversion setting properly… Any ideas would be much appreciated

---

<div class="post-metadata">

**Author:** ![daled](https://community.freepbx.org/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@daled](https://community.freepbx.org/u/daled)\
**Post date:** [April 15, 2010, 1:23pm UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/6 "2010-04-15T13:23:42Z")

</div>

Is your .wav file in the correct format? There is no conversion needed if the .wav file is 8Kbit/sec, 16 bits, mono, Microsoft PCM format. A stereo wav file ripped from a CD will not work.

---

<div class="post-metadata">

**Author:** ![askjoo](https://community.freepbx.org/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@askjoo](https://community.freepbx.org/u/askjoo)\
**Post date:** [April 16, 2010, 4:05am UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/7 "2010-04-16T04:05:31Z")

</div>

Thanks for the quick reply daled. The format is PCM 8.000 kHz, 16 Bit, Mono. I still got the error for a while.

I noticed were able to get warning messages… I installed the log modules but everytime I viewed it in the gui I could only scroll a few thousand lines and can’t find any warnings like the ones you put above…

I looked directly for the log and found…

[Apr 16 02:30:38] WARNING[14503] res\_musiconhold.c: Cannot open dir /var/lib/asterisk/moh/ or dir does not exist  
[Apr 16 02:30:38] WARNING[14503] res\_musiconhold.c: Cannot open dir /var/lib/asterisk/moh/.nomusic\_reserved or dir does not exist

I created mohmp3 instead of moh… doh! thanks a bunch!

---

<div class="post-metadata">

**Author:** ![tbagalini](https://community.freepbx.org/letter_avatar_proxy/v4/letter/t/3be4f8/32.png) [@tbagalini](https://community.freepbx.org/u/tbagalini)\
**Post date:** [April 17, 2010, 1:06am UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/8 "2010-04-17T01:06:18Z")

</div>

I tried to file a bug, because this used to work fine before I upgraded the core, this was the response I got on the bug tracker. Anyone know how to do this?

change apache to run as user asterisk

---

<div class="post-metadata">

**Author:** ![daled](https://community.freepbx.org/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@daled](https://community.freepbx.org/u/daled)\
**Post date:** [April 17, 2010, 1:20am UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/9 "2010-04-17T01:20:17Z")

</div>

changing apache to run as user asterisk does not fix the problem. There are at least two problems in the ISO distribution: the 1) mohmp3 directory does not exist and 2) even when apache is running as asterisk the sox error still occurs. There is something fundamentally wrong with the mp3 converson in the freebpx ISO.

By the way to change the apache user:

# cd /etc/httpd/conf

# cp httpd.conf httpd.conf.orig

# vi httpd.conf

Find the line User apache and change it to User asterisk. Save the file and exit.

# service httpd restart

---

<div class="post-metadata">

**Author:** ![tbagalini](https://community.freepbx.org/letter_avatar_proxy/v4/letter/t/3be4f8/32.png) [@tbagalini](https://community.freepbx.org/u/tbagalini)\
**Post date:** [April 17, 2010, 3:46am UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/10 "2010-04-17T03:46:00Z")

</div>

thanks!  
It’s interesting because I have used this ISO before and just had to create the mohmp3 folder and correct the permissions, I have never seen this error before.  
I suspect it’s related to:  
the only things that have changes since it stopped working was I upgraded the core to 2.7 and i used the 64 bit iso.  
before I was on the 32 bit iso and 2.6 modules.  
anyone else with same error on 2.7 or 2.6 and are you using the 64bit or 32bit?

---

<div class="post-metadata">

**Author:** ![tbagalini](https://community.freepbx.org/letter_avatar_proxy/v4/letter/t/3be4f8/32.png) [@tbagalini](https://community.freepbx.org/u/tbagalini)\
**Post date:** [April 17, 2010, 3:49am UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/11 "2010-04-17T03:49:59Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![jhabers](https://community.freepbx.org/letter_avatar_proxy/v4/letter/j/7cd45c/32.png) [@jhabers](https://community.freepbx.org/u/jhabers)\
**Post date:** [April 17, 2010, 7:22pm UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/12 "2010-04-17T19:22:22Z")

</div>

same problem, i was using 2.7 and 64bit, i am running 2.8 now and still the same problem

---

<div class="post-metadata">

**Author:** ![tbagalini](https://community.freepbx.org/letter_avatar_proxy/v4/letter/t/3be4f8/32.png) [@tbagalini](https://community.freepbx.org/u/tbagalini)\
**Post date:** [April 17, 2010, 9:27pm UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/13 "2010-04-17T21:27:09Z")

</div>

I loaded the 32 bit ISO (in a VM for testing) and its not an issue - its only with the 64 bit.  
Of course you have to do this:  
chown -vR asterisk.asterisk /var/lib/asterisk/mohmp3  
chmod -v 775 /var/lib/asterisk/mohmp3  
chmod -v 664 /var/lib/asterisk/mohmp3/\*  
In case you still want to use web interface and plan to upload larger mp3 music on hold files, change the “max filesize” from 2M to 20M in  
nano /etc/php.ini

But then it works fine, it seems to be an issue on he 64 bit only.

---

<div class="post-metadata">

**Author:** ![Ste73](https://community.freepbx.org/letter_avatar_proxy/v4/letter/s/ac8455/32.png) [@Ste73](https://community.freepbx.org/u/Ste73)\
**Post date:** [April 19, 2010, 10:10am UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/14 "2010-04-19T10:10:13Z")

</div>

Still have the same problem after doing everything you’ve suggested

Error Processing: “sox failed to convert file and original could not be copied as a fall back” for 14 Notte A Sorpresa.mp3!

---

<div class="post-metadata">

**Author:** ![eddie\_harari](https://community.freepbx.org/letter_avatar_proxy/v4/letter/e/59ef9b/32.png) [@eddie\_harari](https://community.freepbx.org/u/eddie_harari)\
**Post date:** [April 23, 2010, 12:58pm UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/15 "2010-04-23T12:58:00Z")

</div>

I had the same problem, ( I had upgraded free pbx, but not with complete ISO).  
I followed the trails of the php that uploads the files and found out that it  
is trying to use mpg123 program in order to convert the mp3 into a wav.

the only reason to do that is because the sox that is on the system was complied out with no support for mp3 format.

1. I searched for mpg123 software on my system and i did not have it.

takeing the source of mpg123, compiling it on my system solved the mp3 problem.

1. You can complile the sox to support mp3, and then convert directly to wav,  
I belive this will requiere to change the php that handles the upload but it is really str8 forward…

Hope this helps…

---

<div class="post-metadata">

**Author:** ![charles\_g\_moore](https://community.freepbx.org/letter_avatar_proxy/v4/letter/c/d26b3c/32.png) [@charles\_g\_moore](https://community.freepbx.org/u/charles_g_moore)\
**Post date:** [May 18, 2010, 5:59pm UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/16 "2010-05-18T17:59:40Z")

</div>

I too had the same issue.

cat /etc/asterisk/musiconhold\_additional.conf  
[default]  
mode=files  
directory=/var/lib/asterisk/moh/  
random=yes  
[none]  
mode=files  
directory=/var/lib/asterisk/moh/.nomusic\_reserved

I saw that the file was trying to access directory=/var/lib/asterisk/moh/ which did not exist on my box after the upgrade

I only had mohmp3.

Since the \_additional.conf file was changing upon reload I just stopped amportal, renamed my /var/lib/asterisk/mohmp3 to /var/lib/asterisk/moh, restarted amportal and it fired right up.

I didnt feel comfortable enough to change the php.

Hope this helps

---

<div class="post-metadata">

**Author:** ![witdirect](https://community.freepbx.org/letter_avatar_proxy/v4/letter/w/b2d939/32.png) [@witdirect](https://community.freepbx.org/u/witdirect)\
**Post date:** [August 24, 2010, 3:14am UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/17 "2010-08-24T03:14:02Z")

</div>

Charles thanks for tip mymusiconhold\_additional.conf file was missing  
this line

directory=/var/lib/asterisk/moh/

Put it back in and all good.

---

<div class="post-metadata">

**Author:** ![m\_andrew](https://community.freepbx.org/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@m\_andrew](https://community.freepbx.org/u/m_andrew)\
**Post date:** [May 11, 2011, 6:27pm UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/18 "2011-05-11T18:27:29Z")

</div>

Thanks for this tip. Was having issue uploading WAV files on a brand new 32bit install and this fixed the issue.

mymusiconhold\_additional.conf file was missing  
this line

directory=/var/lib/asterisk/moh/

Put it back in and all good.

---

<div class="post-metadata">

**Author:** ![andy102087](https://community.freepbx.org/letter_avatar_proxy/v4/letter/a/7ba0ec/32.png) [@andy102087](https://community.freepbx.org/u/andy102087)\
**Post date:** [December 18, 2010, 1:04pm UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/19 "2010-12-18T13:04:08Z")

</div>

Good Evening,  
I hate to reopen a thread.

I have tried all of the above and anything I can find but can not full resolve this issue. I even installed the 32bit ISO (AsteriskNOW) and set it up today.

I now am able to upload most file and can see them and everything looks happy. But it will not play them when I place someone on hold.

Any assistance would be great

Thanks

Andrew

---

<div class="post-metadata">

**Author:** ![rofz](https://community.freepbx.org/letter_avatar_proxy/v4/letter/r/ac8455/32.png) [@rofz](https://community.freepbx.org/u/rofz)\
**Post date:** [July 24, 2012, 3:25pm UTC](https://community.freepbx.org/t/moh-problem-with-mp3/8129/20 "2012-07-24T15:25:15Z")

</div>

Hey Andrew, you may be missing the ‘mpg123’ package. My guess is that due to the possibility of a patent infringement or any other commercial bul…it this package was intentionally left out from AsteriskNOW by Digium. Shamefully, this limitation was not documented (at least i could not find anything!).

Log in your pbx via ssh and issue the ‘mpg123’ command, if the command is not there, then just add the RPM Forge repository and install the ‘mpg123’ packages and its dependencies using yum.

After doing that, any mp3 file that is submitted using the FreePBX interface gets instantly converted to wav.

Good luck!

[Next page](https://community.freepbx.org/t/moh-problem-with-mp3/8129.md?page=2)
