[Asterisk-Users] Sound card Line-In as MOH source

Niksa Baldun niksa.baldun at lumiss.hr
Fri May 13 08:06:22 MST 2005


Hi,

this is a rather ugly solution I devised.

Create a script called 'ast-playlinein' (or whatever) in /usr/sbin, as
follows:

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

In musiconhold.conf:

[classes]
default => custom:/var/lib/asterisk/mohmp3,/usr/sbin/ast-playlinein

And that's it. Basically, the script takes input from line-in and sends
it to standard output in the format Asterisk expects. You also have to
select line-in as recording source using alsamixer utility. If you are
using a sound system other than ALSA, odds are that it has some tool
similar to arecord. Bear in mind that /var/lib/asterisk/mohmp3 directory
still has to contain at least one file with .mp3 extension (can be
whatever you like).

Hope this helps.

-- 
Niksa




More information about the asterisk-users mailing list