login | register
Sat 30 of Aug, 2008 [01:21 UTC]

voip-info.org

Discuss [0] History

Asterisk tips Music Player Daemon as Music on Hold

Created by: buzztiaan,Last modification on Sun 12 of Feb, 2006 [13:37 UTC]
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

#!/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 ..

Comments