Music on Hold from a feed?

I hope I’m not missing something totally obvious, but I don’t see a way to setup Music on Hold from a feed like a CD player or radio or Media Center PC for that matter, running into the Line-In jack. Is this doable?

Yes, it’s possible. It takes some hacking around, and it depends on your hardware, but it can be done.

I added standard mp3’s to the default playlist and deleted the original files, but now the music wont play at all. I will settle for anything right now, can I download the original defaults? If so where?

Thanks!

Has anyone who’s done it got any pointers? or a how to?

There’s a huge thread over at the trixbox forums:

http://www.trixbox.org/forums/trixbox-forums/open-discussion/music-hold-soundcard

Start there. HTH.

I have implemented MOH from the sound card several times and this above instructions work just fine.

I have gone through everything, but it is still playing the other music in there. I made the change to musiconhold_additional.conf:

[default]
mode=files
directory=/var/lib/asterisk/mohmp3/
application=/usr/sbin/ast-playlinein
[none]
mode=files
directory=/dev/null

There are no mp3’s in the folder, but there are wav files that get played.

I created the /usr/sbin/ast-playlinein file:

#!/bin/bash
/usr/bin/arecord -q -c 1 -r 8000 --buffer-size=2048 -f S16_LE -t raw

I configured alsamixer to capture from the line-in

I changed the permissions via the /etc/security/console.perms.d/50-default.perms file and rebooted, which does change the /dev/snd files

There are no errors when I restart asterisk.

I am on a Trixbox 2.6 box with everything up-to-date.

I tried commenting out the directory= in the default music on hold, but that causes an error restarting asterisk and it won’t do music on hold at all.

Each time I have done this, I had to use the mic in input on the sound card and the Mic slider on alsamixer.

I’ve tried both and it just plays the sound files in the directory.

Try creating an empty directory and point the config file at that.

VVVVVV yeah that too.

On the ones that I have done, mode=custom.

I fixed the mode=custom, thank you for that.

Now however, when I do an amportal restart, in the /var/log/asterisk/full log I get this:

[Jun 25 22:25:07] WARNING[4793] res_musiconhold.c: Found no files in ‘/var/lib/asterisk/mohmp3’
[Jun 25 22:25:07] WARNING[4793] res_musiconhold.c: Unable to spawn mp3player

There are files in the directory, it’s the same directory it’s always been.

and then when I try it I get no moh and this from the asterisk cli:

-- Started music on hold, class 'default', on channel 'SIP/7502-0822fc90'
-- Stopped music on hold on SIP/7502-0822fc90