SMS betting at Hot Radio Live

Hot Radio Live runs premium SMS jackpot campaigns. Listeners participate by sending a keyword to a short code, with each SMS costing approximately $1, forming the primary revenue source.

The platform runs entirely inside Auron SMS Server using two triggers and one SMPP channel, an Email channel and uses SQL Server Express for participant storage. No external application server is required. This allows licensees to reproduce the system themselves.

Configuration overview

ComponentDescription
SMS ChannelOne SMPP channel (SMPP1) handles all inbound / outbound messages.
Email ChannelE-mail channel (SMTP1) for the Hot Radio administrators to know if prices have been won.
Jackpot TriggerProcesses incoming messages for the jackpot game. (JACKPOT)
Stop SMS TriggerProcesses unsubscribe messages to remove participants from the database. (STOPSMS)
DatabaseSQL Server Express (AuIntegration.dbo.Participants) stores participant phone numbers, play counts, and timestamps. This database is in the same SQL Server Express instance that runs the Auron SMS Server.

Business Model

  • Listener sends the keyword “MILLION” via premium SMS (~$1)
  • The system tracks the message count and assigns prizes based on exact positions:
    • Primary Jackpot: 10.000th message
    • Secondary Prize: 1.777th message

The premium SMS revenue scales directly with the number of participants. Progress feedback and jackpot alerts keep participants engaged.

Jackpot trigger (Javascript)

const N_PRIMARY    = 9999;
const N_SECONDARY  = 1777;

if (nTotalMessages < 0) {
    nTotalMessages = objMessageDB.Count("SMS",
        "DirectionID = 'IN' AND ChannelID ='SMPP1' AND Body LIKE '%Million%'");
} else {
    nTotalMessages = nTotalMessages + 1;
}

let nPrimaryCount   = nTotalMessages % N_PRIMARY;
let nSecondaryCount = nTotalMessages % N_SECONDARY;

if (nPrimaryCount === 0) {
    SendSms(objMessageIn.FromAddress, "Congratulations! You won the MILLION!");
    SendEmail("admin@hotradio.com", "Winner Jackpot", "Primary Jackpot won!");
} else if (nSecondaryCount === 0) {
    SendSms(objMessageIn.FromAddress, "Congratulations! You won the SECONDARY prize!");
    SendEmail("admin@hotradio.com", "Winner Secondary Prize", "Secondary Prize won!");
}

This is the core logic for the jackpot trigger. As a clever optimization you can make the nTotalMessages variable a global variable so you don't need to count the number of messages in the database every time for every message.

Stop SMS trigger (Javascript)

Listeners can opt out by sending "STOPSMS" to the same short code. The STOPSMS trigger deletes them from the participant database:

const STR_DEBUGFILE    = "C:\\ProgramData\\Auron\\SMS Server\\Log\\STOPSMS.txt";
const B_ENABLE_DEBUG   = true;

function processMessageEx(objMessageIn, objMessageDB, dctContext) {
    Log(">> ProcessMessageEx (STOPSMS)");

    // Remove participant
    const sQ = "DELETE FROM AuIntegration.dbo.Participants WHERE FromAddress = '" + 
               objMessageIn.FromAddress + "'";

    objMessageDB.Execute(sQ);

    if (objMessageDB.LastError !== 0) {
        const sErrorDescription = objMessageDB.GetErrorDescription(objMessageDB.LastError);
        Log("Error while removing participant: [" + sErrorDescription + "]");
        objMessageIn.AddTrace("Error while removing: [" + sErrorDescription + "]");
    }

    Log("<< ProcessMessageEx (STOPSMS)");
}

Once removed, participants can rejoin by sending a new SMS, which adds them automatically back to the database.

Automated Jackpot Alerts (Javascript)

As jackpots approach, the jackpot trigger broadcasts alerts to all participants using bulk SQL inserts:

    // Escape single quotes (basic SQL injection prevention)
    sBody = sBody.replace(/'/g, "''");

    var sQ = "INSERT INTO InsertSms (StatusID, Priority, ToAddress, Body, ChannelID) " +
         "SELECT N'SCHEDULED', -1, P.FromAddress, N'" + sBody + "', N'" + S_BULKSMS_CHANNEL + "' " +
         "FROM AuIntegration.dbo.Participants P " +
         "WHERE LEN(P.FromAddress) >= 9";

    g_objMessageDB.Execute(sQ);

This boosts engagement and premium SMS revenue at critical moments.

Participant Tracking (Javascript)

The jackpot trigger keeps an up-to-date participant table:

    var oAdo = g_objMessageDB.AdoConnection;
    sFromAddress = sFromAddress.replace(/'/g, "''");

    var sQ = "UPDATE AuIntegration.dbo.Participants SET PlayCount = PlayCount + 1, Modified = SYSDATETIME() " +
             "WHERE FromAddress = '" + sFromAddress + "'";
    var nRowCount = 0;
    oAdo.Execute(sQ, nRowCount);
    if (nRowCount != 0) return;

    sQ = "INSERT INTO AuIntegration.dbo.Participants (FromAddress, PlayCount, Created, Modified) VALUES " +
         "('" + sFromAddress + "', 1, SYSDATETIME(), SYSDATETIME())";
    oAdo.Execute(sQ);

By tracking participants you can run retargeting campaigns, loyalty rewards, and analytics.

Try it for yourself

Download a fully functional, free, 30 day trial of the Auron SMS Server to implement and test this project for yourself.