Upgrade 3CX to v18 and get it hosted free!

Asterisk tips Music Player Daemon as Music on Hold

Author image

Music Player Daemon is a centralized music player that i’ve falling in love with over the past weeks.
I listen to it all the time , at home , at work , and now , on asterisk aswell 🙂
This way , i never need to move mp3s around if i want to listen to some music i have, i can just connect to my stream , and continue listening where i left off.

These are just the config file changes i had to make to get this working ..

First some changes to asterisk :

musiconhold.conf

default => custom:/var/lib/asterisk/mohmp3/,/usr/bin/speelraw.sh

/usr/bin/speelraw.sh

  1. !/bin/sh

/usr/bin/ogg123 -b 512 -p 50 -q -d raw -f – http://192.168.1.100:8000/mpd.ogg \
| /usr/bin/sox -w -s -t raw -r 44100 -c 2 – -b -c 2 -s -t raw -r 8000 – vol 0.25

extensions.conf

exten => 4666,1,Answer
exten => 4666,2,Playback(pls-hold-while-try)
exten => 4666,3,SetMusicOnHold,default
exten => 4666,4,WaitMusicOnHold,300
exten => 4666,5,Hangup

Then some changes to music player daemon :

mpd.conf

audio_output {
type “shout”
name “buZz”
host “localhost”
port “8000”
mount “/mpd.ogg”
password “xxxxxxxx”
quality “4.0”
format “44100:16:2”
}

icecast.xml

<authentication>
<source-password>xxxxxxxx</source-password>
</authentication>

Always remember to hardkill asterisk when making changes to this (just ‘reload’ on CLI wont work) , and killall -9 ogg123 when asterisk is not running ..


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.
Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.