Wildcard Blacklisting (Blocking Ranges)

Joined: Mon 18 of Jan, 2010

Re: Wildcard Blacklisting (Blocking Ranges)

Posted:Fri 11 of Jun, 2010 (05:20 UTC)

Use the GotoIf variable with Caller Id application. I mean write the dialplan saying that if the caller id is 979.... goto blacklist
Joined: Fri 11 of Jun, 2010

Wildcard Blacklisting (Blocking Ranges)

Posted:Fri 11 of Jun, 2010 (02:03 UTC)
I have a very simple setup of Asterisk 1.4.21 as obtained by apt-get on Debian Lenny. My sip.conf only contains a few very simple entries for a couple of WindowsXP machines running X-Lite, and a connection to freephoneline.ca. My extensions.conf looks like this:


exten => 2000,1,Dial(SIP/2000)
exten => 2001,1,Dial(SIP/2001)
exten => _XXXXXXXXXXX,1,Dial(SIP/${EXTEN}@fpl-account)

exten => 16135555555,1,GotoIf(${BLACKLIST()}?blist,1)
exten => 16135555555,n,Dial(SIP/2000)

exten => blist,1,Answer()
exten => blist,n,Wait(2)
exten => blist,n,Playback(spammer)
exten => blist,n,Wait(1)
exten => blist,n,Hangup()

and I have been adding entries to the blacklist via the CLI with the command

database put blacklist 16135551111 "Telemarketer"

and this is working. However, I am unable to find a way to (1) blacklist entire ranges of numbers and (2) find a way to force it to always look at the number instead of the name. For example, I would like to block the entire 979 area code without having to enter every number individually. Pattern matching does not seem to apply to the database blacklist entries. I also have a friend who's CallerID shows only his name and as a result can not be blocked by adding his phone number (though blocking his name works).

Am I going about this the right way or is there a better way to do this?