Using Asterisk to screen political phone calls

This entry might find a lot of you swimming in the deep end of the geek pool – it’ll use terms you haven’t heard before, and concepts that may be foreign to a lot of you.

But here we go anyway:

Yesterday, while listening to my home phone ring for the Nth time that day with yet another judge advocating I vote for someone else, I came up with a simple, yet very functional method of filtering out machine-generated phone calls.

It’s rather simple, actually. As soon as the phone rings, answer, and play back a message prompting the caller to do something (generally, press a button.) In response to this “something” the caller is then connected through to let my actual phone ring.

Failing a response, the caller is hung up on after a predetermined number of seconds.

This is all rather simple if you have already played with the opensource PBX system Asterisk.

Edit the incoming context for your VoIP provider’s SIP/IAX connection, and drop in the following snippet of magic:

[incoming]
exten => _X.,1,NoOp(Incoming Call from ${CALLERID} for ${EXTEN}@${SIPDOMAIN})
exten => _X.,2,Answer()
exten => _X.,3,Wait(1)
exten => _X.,4,Playback(continue-english-press)
exten => _X.,5,Playback(digits/1)
exten => _X.,6,WaitExten(10)

exten => 1,1,Goto(default|inbound|1) //or do whatever you want to "continue"

exten => t,1,Playback(i-grow-bored)
exten => t,2,Hangup()

exten => i,1,Playback(invalid)
exten => i,2,Wait(1)
exten => i,3,Hangup()

I see some of your eyes have glazed over – I understand, and apologise for the level of uber-geekery. On the other hand, I did want to get this information out there for others to enjoy the next 8 months. 🙂

2 thoughts on “Using Asterisk to screen political phone calls

Comments are closed.