Blacklist--still answers call, wildcard blocking possible?

Asterisk 1.8 on Centos6
I am getting calls from random numbers from what looks like Simolia (252619850231).

In an attempt to blacklist them I have put the following code into my incoming context (using fake numbers here, of course):

[code]exten => 44205551234,1,GotoIf(${BLACKLIST()}?hangup)
same => n,Zapateller(nocallerid)
same => n,Dial(SIP/mySip)
same => n,Hangup()

exten => hangup,1,Hangup()
Then I enter the following from the commandline :

Then I dial into 44205551234 from the blacklisted number and it still rings. What am I missing?

The number is in the database:

CLI> database show ... /blacklist/13028271010 : Blacklisted for testing ...

Also, is it possible to block the whole country, or use a wildcard type of blocking?

I have partially solved this:

fixed context in extensions.conf:

exten => 44205551234,1,Zapateller(nocallerid)
 same => n,GotoIf(${BLACKLIST()}?hangup)
 same => n,Dial(SIP/mySip)
 same => n(hangup),Hangup()

New CLI command to add number(note the plus sign in prefix)

The blacklisted number is not ringing now, however, the dialplan keeps looping and doesn’t hang up and disconnect the blacklisted party.

As seen via CLI interface:

== Using SIP RTP CoS mark 5 -- Executing [44205551234@from-didProvider:1] GotoIf("SIP/didProvider_did9-000004e6", "1?hangup") in new stack -- Goto (from-didProvider,44205551234,5) -- Executing [44205551234@from-didProvider:5] Hangup("SIP/didProvider_did9-000004e6", "") in new stack == Spawn extension (from-didProvider, 44205551234, 5) exited non-zero on 'SIP/didProvider_did9-000004e6' == Using SIP RTP CoS mark 5 -- Executing [44205551234@from-didProvider:1] GotoIf("SIP/didProvider_did10-000004e7", "1?hangup") in new stack -- Goto (from-didProvider,44205551234,5) -- Executing [44205551234@from-didProvider:5] Hangup("SIP/didProvider_did10-000004e7", "") in new stack == Spawn extension (from-didProvider, 44205551234, 5) exited non-zero on 'SIP/didProvider_did10-000004e7'

This continues until the blocked caller hangs up. Eventually, after about 50 seconds, if the caller hasn’t hung up he hears ringing. I need to hang up his phone or I will be charged if he leaves the phone off the hook.

I got the answer here:


exten => 44205551234,1,Zapateller(nocallerid)
same => n,GotoIf(${BLACKLIST()}?blacklisted)
same => n,Dial(SIP/mySip)
same => n(hangup),Hangup()

exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Playback(ss-noservice)
exten => s,n,Hangup