[Help] MusicOnHold.conf

I have the musiconhold configured and I don’t hear anything when I’m put on hold. This are my settings:

;
; Music on hold class definitions
;
[classes]
default => quietMP3:/var/lib/asterisk/mohmp3
;loud => mp3:/var/lib/asterisk/mohmp3
;random => quietmp3:/var/lib/asterisk/mohmp3,-z
;unbuffered => mp3nb:/var/lib/asterisk/mohmp3
;quietunbuf => quietmp3nb:/var/lib/asterisk/mohmp3
; Note that the custom mode cannot handle escaped parameters (specifically embedded spaces)
;manual => custom:/var/lib/asterisk/mohmp3,/usr/bin/mpg123 -q -r 8000 -f 8192 -b 2048 --mono -s

Now this is what I get from Asterisk when is put on hold:

– Started music on hold, class ‘default’, on SIP/4281-1afd
– Stopped music on hold on SIP/4281-1afd
It is starting the music on hold but it is stopping it right of way.

Am i doing something wrong? Am i missing something in the configuration? Please help!!! :frowning:

PS: I tried this page voip-info.org/tiki-index.php … nhold.conf but I think I got it where is suppose to work. Again I might be wrong.

Did you remember to install the correct mp3 player on your Asterisk server?

users.pandora.be/Asterisk-PBX/MusicOnHold.htm

I don’t think that is the correct mp3 player.

This is what you find in the mpg123 website:
" Yes! The project is not maintained at the moment and there are some serious security problems in the latest player versions. It is highly recommended to not use the source code you can download from this site."
C.

[quote=“spyke”]I don’t think that is the correct mp3 player.

This is what you find in the mpg123 website:
" Yes! The project is not maintained at the moment and there are some serious security problems in the latest player versions. It is highly recommended to not use the source code you can download from this site."
C.[/quote]

Are you refering to the one that dufus is talking about? Because if that is the case, that is the one I have in my PBX system. What do you recommend me to do, 'cause is not working at all.

[quote=“dufus”]Did you remember to install the correct mp3 player on your Asterisk server?

users.pandora.be/Asterisk-PBX/MusicOnHold.htm[/quote]

I did not use this one specifically but I used the one in the Scratch Installation which it looks somewhat similar to the one the link you provided. So which one is right and which is wrong.

From http://www.voip-info.org/tiki-index.php?page=Asterisk+config+musiconhold.conf

[quote]Using madplay

If you want to keep the original distributed mpg321, you can use madplay to generate the mp3 in the same way that mpg123 does.

Just use a custom player like this one and you are done:
default => custom:/var/lib/asterisk/mohmp3/,/usr/bin/madplay --mono -R 8000 --output=raw:- [/quote]

And see http://www.voip-info.org/tiki-index.php?page=Asterisk+mpg123+faking+it (How to replace MPG123 with SOX for musiconhold)

This stuff really isn’t that hard to find on the voip-info site you know!

[quote=“WillKemp”]From http://www.voip-info.org/tiki-index.php?page=Asterisk+config+musiconhold.conf

[quote]Using madplay

If you want to keep the original distributed mpg321, you can use madplay to generate the mp3 in the same way that mpg123 does.

Just use a custom player like this one and you are done:
default => custom:/var/lib/asterisk/mohmp3/,/usr/bin/madplay --mono -R 8000 --output=raw:- [/quote][/quote]

And see http://www.voip-info.org/tiki-index.php?page=Asterisk+mpg123+faking+it (How to replace MPG123 with SOX for musiconhold)

I know this stuff is not hard to find because I have found a lot of info in that site, but I want you to understand that this is all new to me and honestly I’m learning as I go. I read sometimes and I feel like I’m reading chinese and other times I read and understand but don’t know how execute it. :cry: Very fustrating!!! I hope nobody feels that am asking for everybody to do my job all i’m doing is trying to understand this program and how to use it well.

No, that’s ok. I know how hard it is trying to work out how asterisk works - i had to do it myself once! :wink:

I also know it can be very hard trying to find things on the voip-info wiki - i get a bit frustrated at times myself, trying to find things that i know for sure are there! (I spend more time looking for things there so i can post the link here than i do looking for information there for myself.)

However, it does also get a bit frustrating at times trying to help people on this forum - with limited time to do it - and feeling like i spend most of my time pointing people at resources they could easily find themselves.

Don’t take that personally, because it wasn’t intended that way. It’s just a generalised sort of minor irritation. I try not to get to irritable about it, but there’s something about sitting in front of a computer that brings out my grumpy side! :wink:

Tell me about getting irritarated I been spending 8 hours a day for the past 3 weeks in front of this pc and you feel like your getting no where, and don’t worry I did not took it personally is just that I’m so frustated with this that I been feeling like giving up, but, I won’t. :wink:

Don’t give up, just have a day off (call in sick, if necessary!). You’ll probably find if you give your brain a bit of a break it will all make a bit more sense afterwards.

Either way, it will all start making a lot more sense quite soon. You’re probably getting towards the top of the initial steep learning curve. It can still be frustrating after that, but at least it all starts to make a little bit of sense!

I don’t know if this will help much, but i think you may have missed a step.

When i set up MoH to test, i had to add this line to zapata.conf:

[channels]
musiconhold=default

I hope this helps

[quote=“jssayers”]I don’t know if this will help much, but i think you may have missed a step.

When i set up MoH to test, i had to add this line to zapata.conf:

[channels]
musiconhold=default

I hope this helps[/quote]

I already had the line I just changed the class to default and still doing the same thing. I have a feeling that is has to do with musiconhold.conf and I’m probably overlooking or missing in the configuration.

Now I just notice something that when i go to the CLI> prompt and enter moh files show is suposse to list all the music on hold file-based classes and guess what, nothing. I guess this means that I have no music files and that is probably why my moh is not working. Maybe or maybe does not have anything to do with it.

Funny, moh files show for me does nothing, but I have a complete working madplay. Maybe this command is not implemented?

Funny, moh files show for me does nothing, but I have a complete working madplay. Maybe this command is not implemented?[/quote]

Well probably you can help me with my MOH 'cause I’ve done everything according this link voip-info.org/tiki-print.php … nhold.conf and what other people recommend it and is not working and even my boss is getting fustrated with this Asterisk. I don’t know what else to do and I know i’m definitly missing something, please help.

I’m running the 1.2 beta 1, now, but I’ll give you my exact setup from that. Note that if you are running 1.0.x, the settings are fairly different, and I’ve included my old 1.0.9 settings, as well.

I’m using madplay as installed from FreeBSD ports: madplay-esound-0.15.0b_2

Yes, I’m running FreeBSD 5.4-STABLE.

Here’s musiconhold.conf 1.2:

[default] mode=custom directory=/home/mp3/eighties application=/usr/local/bin/madplay --mono -Q -a -12 -R 8000 --output=raw:- random=yes

Here’s musiconhold.conf 1.0.9:

[classes] default => custom:/home/mp3/eighties/,/usr/local/bin/madplay --mono -Q -a -12 -R 8000 --output=raw:-

in zapata.conf:

[code][channels]
; Zap 1 - xxx xxxx
; Zap 2 - xxx xxxx
; Zap 3 - xxx xxxx
; Zap 4 - xxx xxxx
; Zap 5 - unused
; Zap 6 - unused
; Zap 7 - unused
; Zap 8 - xxx xxxx

language=en
signalling=fxs_ks
context=from_pstn
group=1
musiconhold=default
echocancel=yes
echotraining=yes
channel => 1,3,4

language=en
signalling=fxs_ks
context=from_pstn
musiconhold=default
echocancel=yes
echotraining=yes
channel => 2

language=en
signalling=fxs_ks
context=DSLLine
group=2
musiconhold=default
echocancel=yes
echotraining=yes
channel => 8
[/code]

Output of file * in /home/mp3/eighties

0x26120914.1.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.10.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.11.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.12.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.13.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.14.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.15.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.16.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.17.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.18.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.19.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.2.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.20.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.3.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.4.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.5.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.6.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.7.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.8.mp3: MP3 file with ID3 version 2.3.0 tag 0x26120914.9.mp3: MP3 file with ID3 version 2.3.0 tag 0x6f08e609.1.mp3: MP3 file with ID3 version 2.3.0 tag 0x6f08e609.2.mp3: MP3 file with ID3 version 2.3.0 tag 0x6f08e609.3.mp3: MP3 file with ID3 version 2.3.0 tag 0x6f08e609.4.mp3: MP3 file with ID3 version 2.3.0 tag 0x6f08e609.5.mp3: MP3 file with ID3 version 2.3.0 tag 0x6f08e609.6.mp3: MP3 file with ID3 version 2.3.0 tag 0x6f08e609.7.mp3: MP3 file with ID3 version 2.3.0 tag 0x6f08e609.8.mp3: MP3 file with ID3 version 2.3.0 tag 0x6f08e609.9.mp3: MP3 file with ID3 version 2.3.0 tag 0x9f0b960c.1.mp3: MP3 file with ID3 version 2.3.0 tag 0x9f0b960c.10.mp3: MP3 file with ID3 version 2.3.0 tag 0x9f0b960c.11.mp3: MP3 file with ID3 version 2.3.0 tag 0x9f0b960c.12.mp3: MP3 file with ID3 version 2.3.0 tag 0x9f0b960c.2.mp3: MP3 file with ID3 version 2.3.0 tag 0x9f0b960c.3.mp3: MP3 file with ID3 version 2.3.0 tag 0x9f0b960c.4.mp3: MP3 file with ID3 version 2.3.0 tag 0x9f0b960c.5.mp3: MP3 file with ID3 version 2.3.0 tag 0x9f0b960c.6.mp3: MP3 file with ID3 version 2.3.0 tag 0x9f0b960c.7.mp3: MP3 file with ID3 version 2.3.0 tag 0x9f0b960c.8.mp3: MP3 file with ID3 version 2.3.0 tag 0x9f0b960c.9.mp3: MP3 file with ID3 version 2.3.0 tag

The MP3’s I ripped from CDs using dd and tagged them using id3tag; they are in a Samba share which people in the office also play on their desktops. I say this only because some directions on the Wiki point out that you need to strip id3 tags in some instances. That is not the case in my setup.

Last thing is to set up an extension to test with. I use 8002. Snippit from my extensions.conf:

[miscellaneous] exten => 8002,1,MusicOnHold(default)

I can see the madplay process: output from ps ax | grep mad

gemini:/home/asterisk/etc/asterisk/$ ps ax | grep mad
23785  p0  S+     0:00.00 grep mad
18385  p2  S+     0:19.85 [madplay]
gemini:/home/asterisk/etc/asterisk/$

Let me ask this. Is this for Asterisk @ Home or the business edition, because am using the business edition and I don’t know if there is a difference in configurations between both of them.

Hrm… good question. I don’t think what I’m using is classified as business edition. I am running the 1.2 beta, built from source code, in production. As far as I know, there’s no difference in zapata.conf. The extensions.conf snippet I posted should be valid in all (recent) versions. The only real significant change between versions is in musiconhold.conf, which is why I posted both versions. I’m not sure what the business edition is, but I’m guessing if you’re running A@H, it’s a 1.0.x derivative.

Well i think is very similar because I compare your config againts mine and they looked very similar. Now I think I don’t any music files in mine and I’m trying to download some mp3 files but since am not a Linux expert am having problem in that arena.

Asterisk comes with three elevator-music mp3s - you should find them in /var/lib/asterisk/mohmp3/