Victory 91.5 Takes Radio From Hardware Powered to Software Powered with Twilio

September 18, 2015
Written by

red-radio

There are certain tools of the trade all radio stations use. The most insufferable morning zoo drive-time duos and world’s best DJs (cough, cough Seattle’s KEXP) all drop radio station ID’s. You know how it goes, a famous musician or excited fan shouts out the radio station’s name and motto.

It seems simple enough, but getting audio from the phone to the airwaves is a tricky process. Most radio stations use school telecom hardware, called hybrids, to patch and record audio from listeners calling in.

Victory 91.5 FM had a problem that most radio stations would welcome. Their fans were so active calling in, requesting song information, recording IDs that Victory had to shop around for new solutions to keep up.

In an industry that’s heavily dominated by hardware, Victory 91.5 turned to software to build the solutions that helped their radio station and its staff run more smoothly. One single developer, Austin, made it all happen.

One Man, A Ton of Work, and a Few Lines of Code

Victory has different needs than most radio stations. First off, they’re a nonprofit (and part of Twilio.org). They rely heavily on listener donations. Secondly, they’re a Christian radio station whose missionaries are scattered around the world. Their listeners want to hear updates from the missionaries on the radio. But getting missionaries on the line from a remote region on the other side of the world wasn’t easy, and neither was getting that audio on the air – until Austin did some digging.

“Before Twilio, we patched the calls to the studio and recorded the calls using Adobe Audition. From there we exported them and then they could be used for playback,” says Austin.

Only a few people at the station knew how to do this. The admin staff weren’t comfortable with managing call patching, and navigating Adobe’s software. Recording calls typically fell to the DJ’s which gave them more work in addition to their on-air duties.

Austin used Twilio Voice to easily connect to and record status updates from missionaries. There’s no patching or complex software to navigate. All they have to do is dial a number, then Austin downloads the audio from the call in Victory’s Twilio account portal, and they’re done.

Victory
After building with Twilio Voice, Austin got busy with SMS.  He used Twilio SMS to let listeners to request song information, make donations, and send song requests. For example, listeners can text “live” to Victory’s Twilio-powered number and it’ll return the song information you’re looking for. Finally Austin built a custom dashboard for radio station admin staff to use Twilio programmatically without touching a line of code, or logging into a Twilio account portal.

Now, when listeners call in to drop a radio ID, admin staff can hit a pre-programmed transfer button which forwards the call to Twilio and records the audio. “[The admin staff] find it is very easy to use if they want to get a listener’s testimony,” says Austin.

So the next time you hear an ID drop on Victory 91.5, you’ll know who to thank.

A Snippet Of Austin’s Work

Here’s a sample of Austin’s code that allows listeners to text in asking for song information.

 

<?php
$servername = "{{DATABASE SERVER}}";
$username = "{{USERNAME}}";
$password = "{{PASSWORD}}";
$dbname = "{{DATABASE NAME}}";
$con = new mysqli($servername, $username, $password, $dbname);

if (mysqli_connect_errno())
$result = mysqli_query($con,"{{SQL where we do some searching in our databases to find out what is playing}}");
while($row = mysqli_fetch_array($result))
  {
  $trackid=$row['ID'];
  $tracktitle=$row['TITLE'];
  $trackartist=$row['ARTIST'];
  }

mysqli_close($con);

$OBMESSAGE="We're currently playing ";
$OBMESSAGE.=$tracktitle;
$OBMESSAGE.=' by ';
$OBMESSAGE.=$trackartist;
$OBMESSAGE.=' on your Victory 91.5.';

$sms = $client->account->sms_messages->create("+17707819150", $userPhoneNumber, $OBMESSAGE, array());
$obSMSID=$sms->sid;

$servername = "{{DATABASE SERVER}}";
$username = "{{USERNAME}}";
$password = "{{PASSWORD}}";
$dbname = "{{DATABASE NAME}}";

$conn = new mysqli($servername, $username, $password, $dbname);
$insertSanitizedPhone=mysqli_real_escape_string($conn, $userPhoneNumber);
$insertSanitizedOBM=mysqli_real_escape_string($conn, $OBMESSAGE);
$sql = "INSERT INTO V915SMS (FROMNUMBER, FROMCITY, FROMSTATE, MESSAGESID, TONUMBER, DIRECTION, NUMMEDIA, BODY, KEYWORD) VALUES ('+17707819150', 'CUMMING', 'GA', '$obSMSID', '$insertSanitizedPhone', '1', '0', '$insertSanitizedOBM', 'nokw')";
if ($conn->query($sql) === TRUE) {
} else {
}
$conn->close();