compile mpg123 from source
Create MOH catagory either using the gui or in /etc/asterisk/musiconhold_custom.conf
application=/usr/local/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0 http://(radio stream)
Create the following extensions in extensions_custom.conf
exten => 300,1,Answer
exten => 300,2,MusicOnHold((name of MOH catagory))
exten => 300,3,Hangup
exten => 301,1,SoftHangup((tannoy extension eg DAHDI/1-1)|a)
exten => 301,2,Dial((tannoy extension eg DAHDI/1-1))
exten => 301,3,Hangup
exten => 303,1,Answer
exten => 303,2,playback(buzzer_x)
exten => 303,3,playback(buzzer_x)
exten => 303,4,playback(buzzer_x)
exten => 303,5,Hangup
Then create a manager in the gui (tools > asterisk API)
the following script when run ./script.sh|telnet will hang up the channel, originate a call from the tanoy to the beep extension. wait then origate a call back to music on hold
echo "open localhost 5038"
sleep 2
echo "Action: Login"
echo "Username: test"
echo "Secret: test"
echo
echo
echo "Action: Hangup"
echo "Channel: DAHDI/1-1"
echo
echo
echo "Action: Originate"
echo "Channel: DAHDI/1-1"
echo "Context: from-internal"
echo "Exten: 303"
echo "Priority: 1"
echo
echo
sleep 6
echo "Action: Originate"
echo "Channel: DAHDI/1-1"
echo "Context: from-internal"
echo "Exten: 300"
echo "Priority: 1"
echo
echo
#echo "Action: Logoff"
echo
echo
sleep 4
at start of day run script (plays tone + starts radio)
run script every time want tones
run a script without the last originate to hang up radio and play a final tone
to talk on tanoy dial 301 and when done transfer to 300. NOTE: the tones will override talking
Should the music stop & exten 300 is silent reloading if freepbx starts it up again
can start music using radio-only.sh | telnet
can play tone & start music using tone+radio.sh | telnet
can play tone & stop music using tone+noradio.sh | telnet