For a long time, I’ve used and recommended the Pira CZ Silence Detector software for radio dead-air, off-air, and program fail monitoring. When everything else fails, this tool can be a massive life-saver! However, it’s always been a little tricky to trigger automatic phone calls. Thankfully, I’ve now got an easy solution!
Firstly… why would you want a phone call? Isn’t email and/or SMS sufficient in this day and age? It mostly is, except the notification sound of an SMS won’t necessarily wake you up in the middle of the night when you go off air. Phone calls are loud, obnoxious, and can bypass your do-not-disturb mode.
This script uses Twilio’s Programmable Voice service as an inexpensive way of triggering phone calls via an API. Twilio allows us to place a call to most countries in the world from only US$0.013. It’s pay-as-you-go, with a $10 free trial balance.
Obviously this requires a reliable internet connection (you can’t trigger an alarm if the internet connection has gone down). These days, most radio stations should already have decent redundancy in this area so I think it’s a reasonable dependancy for off-air monitoring.
We also still rely on the amazing Pira CZ software to do the silence detection.
You could also use this utility with other programs such as PathfinderPC, although you’ll need to change some of the steps in these instructions.
The software I’ve created to do this is a small EXE which can be triggered by Pira, and send a command to Twilio to place a call. That’s it. No bells and whistles. Just some basic config and an API call. The code is even on GitHub!
(Don’t worry, it’s easy!)
- Sign up for a Twilio account
- Fil out your details
- Put in your phone number to receive a verification SMS
- You will receive $10 free credit to help you get started
- ‘Buy’ a phone number in Twilio. This will become your outgoing phone number for alarms.
- In some countries, you need to verify you are located nearby to purchase a number.
- Phone numbers are very cheap ($2.50/month in Australia, so don’t worry about blowing your budget on telecomm services)
- Find your Twilio Account SID and Auth Token
- These are found on the Account Settings page in the console
- Take note of these two values – you’ll need them in Step 8
- Download and install Pira CZ Silence Detector
- Download the file off the website
- Install it on a Windows PC
- Setup an audio input to the computer
- Configure and test the basic functionality in the program (you may wish to trigger an email to yourself to test it)
- Download the latest version of the Twilio Caller app
- Extract the ZIP to a simple location on your local hard drive (e.g. C:TwilioCaller)
- Open ‘config.json‘ in a Text Editor (e.g. Wordpad) and fill in the values
- Insert the Account SID and Auth Token (found in Step 3)
- Insert your Outgoing Caller ID number (created in Step 2)
This should be in the international format (e.g. +61288063416)
- Save your changes to the file
- Back in the Pira software, create an Open/Play Alarm Task and add it to the list of tasks
- Set “File 1” to the EXE path (e.g. C:TwilioCallerTwilioCaller.exe)
- Set “Parameters” to ‘–call=”+614111222″ –message=”Your radio station is of the air”‘
- You will need to substitute in your own phone number (international numbering format) and message to be read out by the robot voice
- Test the software by simulating some silence
- Either mute the input or drag the threshold slider all the way up to 0dB
At this point, you should either receive a phone call – or receive an error message. The black command line box which flashes up on the screen is normal. All errors and debug messages are logged to the file TwilioCaller.log, found in the same folder as TwilioCaller.exe.
If the log file doesn’t exist, it means either:
- the program hasn’t started, or
- your permissions in the folder are wrong
That’s it! Hopefully you are now receiving dead-air alarms directly to your phone.
- Multiple destination phone numbers in the –call option can be separated by a comma. Every phone number will be triggered simultaneously.
- You can also specify the option –from=”+61288063416″, allowing you to call out from multiple numbers based on the type of alarm. For instance, you may wish to have one number per radio station).