chrishowells.co.uk

June 2, 2010

Making telemarketers go away with Asterisk

I run my own private Asterisk system for the house. This is in conjunction with a Linksys PAP2T (which is cheap, supports SIP, and you can plug two normal BT phones into), and Sipdroid running on my Android phone.

Although, this might sound a little over the top for a house, it does have a number of nice features. Like being able to make persistent nuisance callers go away.

As an example:

I edited /etc/asterisk/extensions.conf and found the section relating to my incoming call provider.


[draytel]
exten => xxx,1,Dial(SIP/chris&SIP/mobile&SIP/flat,25)
exten => xxx,n,Answer()
exten => xxx,n,Wait(1)
exten => xxx,n,VoiceMail(1001&1002)
exten => xxx,n,PlayBack(vm-goodbye)
exten => xxx,n,HangUp()

This code rings the two SIP extensions for 25 seconds, if there is no answer, answers the call, waits a second, before leaving the message in mailbox 1001 and 1002.

I modified it as follows:


[draytel]
exten => xxx,1,GotoIf($["${CALLERID(num)}" = "01252555029"]?monkeys,s,1)
exten => xxx,n,Dial(SIP/chris&SIP/mobile&SIP/flat,25)
exten => xxx,n,Answer()
exten => xxx,n,Wait(1)
exten => xxx,n,VoiceMail(1001&1002)
exten => xxx,n,PlayBack(vm-goodbye)
exten => xxx,n,HangUp()

You’ll also need to add the monkeys section:


[monkeys]
exten => s,1,ringing
exten => s,n,Wait(10)
exten => s,n,Playback(tt-monkeysintro)
exten => s,n,Playback(tt-monkeys)
exten => s,n,Playback(tt-monkeys)
exten => s,n,Playback(tt-monkeys)
exten => s,n,Playback(tt-monkeys)
exten => s,n,Playback(tt-monkeys)
exten => s,n,Playback(tt-monkeys)
exten => s,n,Playback(tt-monkeys)
exten => s,n,Playback(tt-monkeys)
exten => s,n,Playback(tt-monkeys)
exten => s,n,Playback(tt-monkeys)
exten => s,n,Playback(tt-monkeys)
exten => s,n,Playback(tt-monkeys)
exten => s,n,HangUp

This will ring the phone for 10 seconds, answer, and then play monkey noises, then hang up.

So, now, if the incoming caller ID matches “01252555029″, they are taken away by monkeys. The phone doesn’t even ring.

Bliss.

  • Share/Bookmark

5 Comments »

  1. Out of interest, are you using dahdi hardware to plug into your landline or do you have a completely VoIP setup?

    Comment by Tim Dobson — June 3, 2010 @ 10:42 am

  2. Hi,

    It’s completely VoIP. The call quality is great over the NTL 50Mbps service, even though the co-located server is 200 miles away.

    Incoming calls come in via Draytel, and outgoing calls go out via different providers based on the dialing code, to get the best rate.

    Cheers.

    Comment by admin — June 3, 2010 @ 10:46 am

  3. I can imagine that setup works pretty well!

    You are co-lo’ing your asterisk install and your phones are connecting remotely to it or your server is onsite at home?
    Just interested. Sounds like you have quite a neat setup!

    Personally I tend to go for VoIP phones like Grandstream GXP2000’s on all VoIP systems though.

    Comment by Tim Dobson — June 3, 2010 @ 4:33 pm

  4. The Asterisk installation is at my colo’d machine in the data centre, because it’s on a VM which has its own IP, and then I don’t have to deal with NATing SIP (painful). If I was doing a professional rollout I would use a proper SIP phone yes, but given that this isn’t a professional rollout, the Linksys PAP2T works very nicely.

    Comment by admin — June 3, 2010 @ 5:56 pm

  5. Oh cool. Your doing hosted Asterisk. :) Neat.
    NAT’ing SIP is a pain, but STUN can usually manage on decent router if the network isn’t very crowded..

    Comment by Tim Dobson — June 7, 2010 @ 10:45 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress