Radio Station Contesting Setup

I need to setup a radio contest setup where the 7th caller wins a prize. I’ve though of setting up a queue/extension and just having them reject calls till its the proper number but that seems clunky to me.

Can anyone think of any better way to handle it?

Years ago, I wrote up complete dialplan to do this and posted on another forum. That thread has since been lost, either from incompetence (forum crash) or from maliciousness when my posts were purged.

I am pretty sure I could resurrect it from memory if you have budget for a few hours of support credit.

Actually, that sounds about right. Write a simple call counter with a quick “say digits” in the loop, and CF one of your extensions to it. Forward the 7th call to one of your other extensions, and you’re golden.

I bet you could cobble it together pretty quickly. Not trying to steal bread out of @lgaetz 's kids mouths, but it should be pretty trivial. Who knows - if you buy it, maybe Lorne will make it a permanent thing…

1 Like

Just adding a counter CID prefix would work great. Hit reject till the magic number. The question is how to reset the counter.

Lorne: Do you remember how it worked on the user side?

Notwithstanding Dave’s sincere concern for my kid’s nutrition, I found this page:

The module files are completely non-functional, but the readme should have everything you need, although I have neither touched nor tested it for years.

That looks far better than what I was thinking thanks! It looks simple enough that I should be able to get it working.

Obviously it would not work if you wanted the 30th caller…but if you had 10 lines and you wanted the 5th caller, have a Queue with MAX Members 4 and a fail over of the “Winner” destination of the Studio Phone - Bingo, you have the 5rh caller presented to the talent.

What if the callers are really slow to call in and quick to hang up?

Tough Luck - No one said Call-In Contests had to be fair… :wink:

Plus what happens with caller 6 and up as they would also be transferred to the you won destination.

I hope I never call into one of your contests.

Man - tough audience - Fail-Over destination could be a Queue with only 1 member and a failover of Whah-Whah-Whaaaahhhh.

Come on, it’s not exactly rocket science…

Your code worked except for a bug related to asterisk restarts that made everyone a winner. I fixed that bug and added a little to let the contest be put into a closed state by setting the winning number to 0, also fixed the bug.

Followed your instructions and it works using custom destinations.

[app-contester-reset-test1]
exten => s,1(reset),Set(GLOBAL(CONTESTER-TEST1-COUNTER)=0)
exten => s,n,Set(GLOBAL(CONTESTER-TEST1-WINNER)=0)
exten => s,n,Read(GLOBAL(CONTESTER-TEST1-WINNER),please-enter-the&count&then-press-pound,3,,,)
exten => s,n,Verbose(3,Contester: Contest counter reset to 0 winning number is set to ${CONTESTER-TEST1-WINNER})
exten => s,n,Playback(count&is-set-to)
exten => s,n,SayNumber(${CONTESTER-TEST1-WINNER},f)
exten => s,n,Playback(goodbye)
exten => s,n,Return


[app-contester-test1]
exten => s,1,GotoIf(${CONTESTER-TEST1-WINNER}?:contestover)
exten => s,n,Set(constester-call-number=${SET(GLOBAL(CONTESTER-TEST1-COUNTER)=${MATH(${CONTESTER-TEST1-COUNTER} + 1,i)})})
exten => s,n,Verbose(3,Contester: Contest caller number ${constester-call-number} of ${CONTESTER-TEST1-WINNER})
exten => s,n,Wait(1)
exten => s,n,GotoIf($["${constester-call-number}"="${CONTESTER-TEST1-WINNER}"]?winner:loser)
exten => s,n(contestover),Playback(im-sorry)
exten => s,n,Macro(hangupcall,)
exten => s,n(loser),Playback(im-sorry&you-are-caller-num)
exten => s,n,SayNumber(${constester-call-number},f)
exten => s,n,Playback(goodbye)
exten => s,n,Macro(hangupcall,)
exten => s,n(winner),Macro(user-callerid,)
exten => s,n,Verbose(3,Contester: Caller ${AMPUSER} is a winner!)
exten => s,n,Playback(you-are-caller-num)
exten => s,n,SayNumber(${constester-call-number},f)
exten => s,n,Playback(one-moment-please)
exten => s,n,Return
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.