Asterisk tannoy - using asterisk to play music over a tannoy system

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

 

IT Support Contracts

Support contracts to cover all your IT and Telecoms with UK wide free call-out. Our friendly support staff provide on-site, telephone, email and remote support for workstations, servers, network infrastructure and phone systems. We offer support and consultation for firewalls, VPN, Linux server and deskop, MS and Mac server and desktop.

 

Linux Business Servers

Linux servers to suit every requirement from drop-in Microsoft replacements to advanced firewalls, high availability, thin client servers and virtualisation. Our SME Business Server product provides your business with an IT solution taking care of networking, security, storage, email, backup, remote access and much more.

 

Distro Support Includes

  • FusionPBX / Issabel / FreePBX
  • RedHat / Rocky / Alma
  • Koozali / smeserver / SUSE
  • Pfsense / Unix / BSD
  • Debian / Ubuntu / Linux Mint
  • Arch / Archbang / Gentoo
  • Fedora / Kubuntu / Xubuntu
  • Raspbian / Embedded Systems

Ubuntu Server & Desktop

Pre-configured Linux server, desktop and thin client systems to suit your requirements. We offer drop-in Microsoft Server replacements and even migrate your existing Microsoft server including large AD forests or migrations from Entra/Azure to self hosted Linux auth.