MOH not working

People… since upgrading to the latest version (stable) MOH is not working anymore.
System recordings work fine, but MOH is not playing anything. Not MP3 not WAV not anything…

Any suggestions for this?

check the error logs

/var/log/astersik/full

See if you get any errors when trying to use MOH

[Jan 15 18:15:34] DEBUG[22387] app_queue.c: Everyone is busy at this time
[Jan 15 18:15:34] WARNING[22387] file.c: File /var/lib/asterisk/mohmp3//music does not exist in any format
[Jan 15 18:15:34] WARNING[22387] res_musiconhold.c: Unable to open file ‘/var/lib/asterisk/mohmp3//music’: No such file or directory
[Jan 15 18:15:34] VERBOSE[22387] logger.c: – Stopped music on hold on SIP/997-b770ca28
[Jan 15 18:15:34] WARNING[2271] chan_sip.c: Bad request protocol Packet
[Jan 15 18:15:36] WARNING[2271] chan_sip.c: Bad request protocol Packet

//

It seems it strips of the extention… what could be the problem here?

can you post the content of /etc/asterisk/musiconhold.conf and of /etc/asterisk/musiconhold_additional.conf and any other files you may #include from your musiconhold.conf

But of course, thank you for your assistance.

/etc/asterisk/musiconhold.conf
;
; Music on hold class definitions
; This is using the new 1.2 config file format, and will not work with 1.0
; based Asterisk systems
;
#include musiconhold_custom.conf
#include musiconhold_additional.conf

/etc/asterisk/musiconhold_additional.conf
[default]
mode=files
directory=/var/lib/asterisk/mohmp3/
[none]
mode=files
directory=/dev/null

Do you have just one file you are trying to play? What is in /var/lib/asterisk/mohmp3/

For us we use random=yes in the [default] context and have a lot of files in /var/lib/asterisk/mohmp3/
And I guess for your [none] context you have a few extensions you dont want to have playing hold music or something?

the none context was already there after install.

There are mp3’s, and wav’s in the mohmp3. but nothing plays.

Strange thing, cause the wav’s when made anouncements do work :S

from asterisk cli what does:

show modules like format

return? If you dont have

format_mp3.so MP3 format [Any rate but 8000hz mono is

then it wont be able to play the files. If this is infact missing you will need to install the asterisk-addons

I too am unable to get any moh uploads to play, any suggestions?

My MOH did work then stopped working for no apparent reason. In asterisk it shows a line that says music on hold started then the very next line is music on hold stopped…of course the caller only hears dead air. I tried changing .wav files to .gsm with file convert and then reloading moh to no avail. Is there a fix or a work around for this? Dead air encourages people to hang up instead of holding.

ghofferbert,

MOH failing is one of several issues. Bad recording (format, etc), the codec needed is damaged or removed, file permission issues, etc.

what else has has changed on the system since it was working? you run updates? install something else?

You’ve also not provided any details which could provide information for anybody to help?

This means something?

devasterCLI> moh show classes
Class: default
devasterMode: files
devasterDirectory: /var/lib/asterisk/mohmp3/
devasterUse Count: 0
devaster
CLI>

devaster*CLI> moh show files
Class: default
devasterFile: /var/lib/asterisk/mohmp3//QuajiroPromo
devasterFile: /var/lib/asterisk/mohmp3//TristeAlegriaPromo
devasterFile: /var/lib/asterisk/mohmp3//orig_As_I_Figure

Tried to change it in musiconhold_additional.conf
to:

devaster*CLI> moh show files
Class: default
devasterFile: /var/lib/asterisk/mohmp3/QuajiroPromo
devasterFile: /var/lib/asterisk/mohmp3/TristeAlegriaPromo
devasterFile: /var/lib/asterisk/mohmp3/orig_As_I_Figure

But still no music…anouncements work ok.

[[email protected] mohmp3]# ll
skupno 3388
-rw-rw-r-- 1 asterisk asterisk 1735488 dec 24 09:08 orig_As_I_Figure.mp3
-rw-rw-r-- 1 asterisk asterisk 882748 dec 22 10:50 QuajiroPromo.sln
-rw-rw-r-- 1 asterisk asterisk 834682 dec 22 10:50 TristeAlegriaPromo.sln
[[email protected] mohmp3]#

Anyone with a clue??

I figured it out.
When calling form internal phone it works.
It doesn’t work calling form outside (SIP trunk)
Must be some kind of a NAT problem?

Anyone with a similar problem?

In asterisk it shows a line that says music on hold started then the very next line is music on hold stopped…of course the caller only hears dead air.

Having the exact same problem :frowning: format_mp3 installed, asterisk-addons intalled, but silence.

log:
[Dec 18 10:49:14] DEBUG[20773] app_macro.c: Executed application: SetMusicOnHold
[Dec 18 10:49:14] VERBOSE[20773] logger.c: – Executing [[email protected]:3] AGI(“Local/[email protected],2”, “dialparties.agi”) in new stack
[Dec 18 10:49:14] VERBOSE[20773] logger.c: – Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
[Dec 18 10:49:14] VERBOSE[20773] logger.c: dialparties.agi: Starting New Dialparties.agi
[Dec 18 10:49:14] VERBOSE[20776] logger.c: == Parsing ‘/etc/asterisk/manager.conf’: [Dec 18 10:49:14] VERBOSE[20776] logger.c: Found
[Dec 18 10:49:14] VERBOSE[20776] logger.c: == Parsing ‘/etc/asterisk/manager_additional.conf’: [Dec 18 10:49:14] VERBOSE[20776] logger.c: Found
[Dec 18 10:49:14] VERBOSE[20776] logger.c: == Parsing ‘/etc/asterisk/manager_custom.conf’: [Dec 18 10:49:14] VERBOSE[20776] logger.c: Found
[Dec 18 10:49:14] VERBOSE[20776] logger.c: == Manager ‘admin’ logged on from 127.0.0.1
[Dec 18 10:49:14] VERBOSE[20773] logger.c: dialparties.agi: Caller ID name is ‘024216135’ number is ‘024216135’
[Dec 18 10:49:14] VERBOSE[20773] logger.c: dialparties.agi: Methodology of ring is ‘none’
[Dec 18 10:49:14] VERBOSE[20773] logger.c: – dialparties.agi: Added extension 77 to extension map
[Dec 18 10:49:14] VERBOSE[20773] logger.c: – dialparties.agi: Extension 77 cf is disabled
[Dec 18 10:49:14] VERBOSE[20773] logger.c: – dialparties.agi: Extension 77 do not disturb is disabled
[Dec 18 10:49:14] VERBOSE[20773] logger.c: – dialparties.agi: dbset CALLTRACE/77 to 024216135
[Dec 18 10:49:14] VERBOSE[20773] logger.c: – dialparties.agi: Filtered ARG3: 77
[Dec 18 10:49:14] VERBOSE[20776] logger.c: == Manager ‘admin’ logged off from 127.0.0.1
[Dec 18 10:49:14] VERBOSE[20773] logger.c: – AGI Script dialparties.agi completed, returning 0
[Dec 18 10:49:14] DEBUG[20773] app_macro.c: Executed application: AGI
[Dec 18 10:49:14] VERBOSE[20773] logger.c: – Executing [[email protected]:7] Dial(“Local/[email protected],2”, “SIP/77||trM(auto-blkvm)”) in new stack
[Dec 18 10:49:14] VERBOSE[20773] logger.c: – Called 77
[Dec 18 10:49:14] VERBOSE[20771] logger.c: – Local/[email protected],1 is ringing
[Dec 18 10:49:14] VERBOSE[20773] logger.c: – SIP/77-0910fdd0 is ringing
[Dec 18 10:49:26] VERBOSE[20771] logger.c: – Stopped music on hold on SIP/059690430-b7c03a40

When i upload file through FreePBX they are converted from mp3 to wav and located in /var/lib/asterisk/mohmp3/

I tried to move 3 default wav files from moh to mohmp3, but no luck.
Anouncements work ok…only MOH won’t play.

Using freepbx 2.5.1 with asterisk1.4.22

Anyone with a clue?

Thank you

I’ve got the same problem (I believe, haven’t tried the MOH internally, but have the same symptoms with ringing). Have you been able to find anything on this?

I had problems (unrelated) with uploaded recorded messages not playing because permissions were not set correctly after the message was uploaded. I thought that might be the case, but to no avail. A new install of the system isn’t creating the mohmp3 directory and sox reports that it doesn’t understand the mp3 format when it’s trying to convert the file. I’ve found that adding apache to the asterisk group and vice versa clears up some of these issues, but still having issues with MOH.

Jeremy

I had problems similar to this. The MOH upload page simply didn’t work and would throw a variety of errors. Some included not being able to actually upload the files because the directory didn’t exist, php max file upload size, codec not supported, and directory not found. This module simply is broken in my opinion :-). Here is how to do it manually –

1.) Login to the system as root via the terminal or SSH.
2.) Install SOX (if not installed) : ‘yum install sox’ (don’t actually type ')
3.) Change to the temp dir : 'cd /tmp’
4.) Get a free music file : 'wget http://upload.wikimedia.org/wikipedia/commons/6/62/Pachelbel’s_Canon.ogg
5.) Convert the audio to WAV : 'sox Pachelbel’s_Canon.ogg -r 8000 -c 1 -s -w moh1.wav resample -ql’
6.) Make a new MOH directory : 'mkdir /var/lib/asterisk/mohwav’
7.) Move the WAV file : 'mv *.wav /var/lib/asterisk/mohwav’
8.) Change to configs dir : 'cd /etc/asterisk’
9.) Backup old MOH config : 'mv musiconhold.conf musiconhold.conf.old’
10.) Create new MOH config : 'touch musiconhold.conf’
11.) Edit MOH config : ‘nano musiconhold.conf’ then add the following –

[default]
mode=files
directory=/var/lib/asterisk/mohwav
random=yes

12.) Save the file by pressing CTRL+O and then ENTER. Then exit by CTRL+X.
13.) Reboot the Asterisk box.

I hope this helps. MOH is an important feature. MP3 playback seems to be touch and go right now because of licensing issues etc. Another key reason not to use MP3 is the CPU cycles required to trans-code the MP3s on the fly for each user on hold. Also remember that your SIP phone simply will not have the fidelity to reproduce a broad frequency range anyway.

Any plans to fix this?

Is there any plans to make the MOH feature more user friendly? I have been using the Elastix distro for some years and this always crops up as an issue of unfriendliness.

I have also tried recreating the musiconhold.conf as described a couple posts back (i already had .wav files so I did not use sox to convert anything) and restarted my server and it still is not working. thanks for any updates on this problem.