I'd always known it was possible to do overhead paging with Asterisk. Now I've finally tackled it. I purchased a Bogen amp and speakers and installed 5 flushmount speakers and one bullhorn for the warehouse.
Configuring Asterisk was pretty easy. I had to add a sound card to the server, but that was easy enough.
What wasn't easy was the fact that my acpi settings were causing huge issues with the sound card. The audio would repeat the last 3 seconds of a page forever. It took me 3 days to figure out that it was caused by the acpi=ht setting in lilo.conf - I basically had an IRQ conflict. Things went much smoother after that.
I then added a second sound card to the system. I know what you're thinking 'What was he thinking?!?' but really there's a method to my madness. Configuring Alsa to work with both cards wasn't too awfully tough. I had to specify in the Asterisk alsa.conf for
input_device=hw:0,0
output_device=hw:0,0
That way it used sound card 1. I then installed a slimserver and configured a stream. I used mpg123 to connect to that stream and told it to use the second sound card with the option '-a hw:1,0 '
I then ran a patch cord from the audio out on the second sound card into the mic in on the first card and unmuted the mic using alsamixer. I was able to set different volumes for the PCM and MIC on that card, balancing a low background music against a louder paging volume.
In my Asterisk dial plan, I did:
[paging]
# When user hangs up, unmute the music:
exten => h,1,System(/usr/bin/amixer -c 1 sset PCM unmute)
# When user dials page, mute the music:
exten => *5,1,System(/usr/bin/amixer -c 1 sset PCM mute)
# Page, play a beep to get everyone's attention before allowing the voice through:
exten => *5,2,Dial(console/dsp,,gA(beep))
exten => *5,3,Hangup()
I then included the paging context into my internal dial plan. It was important to have a separate context for paging so I could specify the 'h' extension, and have an action when the user hangs up the phone.
What this does is let Asterisk mute the background music (outbound on the second card's PCM), provide paging, then unmute the music. A little tweaking of the volumes with alsamixer and I was done. The web interface to the slimserver software allows me to choose what streaming music or internal library of music to play on the speakers.
Pretty cool stuff!

Post new comment