Blocklist [NOT BLACKLIST]

Ok, so I had created a problem. As I was moving the rule in the file I managed to leave one behind and thus had the rule duplicated. That was the reason for the corrupt looking entry, as it was grouping the duplicated entries together, and was also why the rule kept working as I was moving the other one around.

So, back to square one. At its original position in the file it does not work. Moving it up to the point that it works its at rule 8, move it to 9 and it does not work. So, its seems rules 1-8 inclusive work, 9 and above do not.

Is there some kind of a limit that I don’t know about?

The limit is 128 includes I believe as you include each one by using incrementing numbers, not 1 (one) for each then yes you probably reached it.

whoops neep to reply not post a new one . .

The limit is 128 includes I believe as you include each one by using incrementing numbers, not 1 (one) (effectively including already included includes iteratively :slight_smile: ) for each then yes you probably reached it.

Ok, so [dicko] wins the prize.

Set all rules to priority 1 and the rule works no matter where it in the file.

Why it worked at all up to rule 8 and not beyond, I have no idea, and I’m not going to hurt my brain trying to figure it out either. So it effectively looks like my syntax error after all.

Thanks everyone who contributed!

He is right, they all need to start with a 1, and further you should have a hangup after each in case the dialplan wanders back to that point by accident.

so:

[from-pstn-custom]
exten => _X./_2012986XXX,1,Goto(app-blackhole,hangup,1)
exten => _X./_2012986XXX,n,Hangup()
exten => _X./_2064960XXX,1,Goto(app-blackhole,hangup,1)
exten => _X./_2012986XXX,n,Hangup()
exten => _X./_2532468XXX,1,Goto(app-blackhole,hangup,1)
exten => _X./_2532468XXX,n,Hangup()

blah blah blah

That make sense?

Yes, and in fact

[from-pstn-custom]
exten => _X./_2012986XXX,1,Hangup(21)
exten => _X./_2012986XXX,n,Hangup(21)
exten => _X./_2064960XXX,1,Hangup(21)
exten => _X./_2012986XXX,n,Hangup(21)
exten => _X./_2532468XXX,1,Hangup(21)
exten => _X./_2532468XXX,n,Hangup(21)

blah blah blah

makes even more sense?.. but of course you could just keep going with that.

Yep, that would do the trick, might not peg a CDR, not sure if that is important to you.

Well, CDR is a though and I guess I could put in a step to log it. But, right now the provider sends an email on all the fails so I know about it. I guess it wouldn’t hurt though. The main thing was terminating those calls in such a way that the provider won’t bill them.

You could of course put on your belt and braces and braces and belt again.

exten => _X./_2532468XXX,1,Hangup(21)
exten => _X./_2532468XXX,n,Hangup(21)
exten => _X./_2532468XXX,n,Hangup(21)
exten => _X./_2532468XXX,n,Hangup(21)

it will just never get to the first braces though.

but The advantage of the blackhole app is it will both hangup and leave a CDR, plus give you a chance to piss the caller off if you want, you never said why you want to block all these numbers, I have wondered. . .

hangup(22) over a PRI will normally have a “we are sorry your call cannoty be completed . . .” message

Hangup(n) works directly on PRI lines (NI-2) if you are using SIP trunking then map these hangup causes backwards:-

but it’s up to you to play the message before you send thm to the bit-bucket.

ISUP Cause value SIP response


1 unallocated number 404 Not Found
2 no route to network 404 Not found
3 no route to destination 404 Not found
16 normal call clearing — (*)
17 user busy 486 Busy here
18 no user responding 408 Request Timeout
19 no answer from the user 480 Temporarily unavailable
20 subscriber absent 480 Temporarily unavailable
21 call rejected 403 Forbidden (+)
22 number changed (w/o diagnostic) 410 Gone
22 number changed (w/ diagnostic) 301 Moved Permanently
23 redirection to new destination 410 Gone
26 non-selected user clearing 404 Not Found (=)
27 destination out of order 502 Bad Gateway
28 address incomplete 484 Address incomplete
29 facility rejected 501 Not implemented
31 normal unspecified 480 Temporarily unavailable
34 no circuit available 503 Service unavailable
38 network out of order 503 Service unavailable
41 temporary failure 503 Service unavailable
42 switching equipment congestion 503 Service unavailable
47 resource unavailable 503 Service unavailable
55 incoming calls barred within CUG 403 Forbidden
57 bearer capability not authorized 403 Forbidden
58 bearer capability not presently 503 Service unavailable
available
65 bearer capability not implemented 488 Not Acceptable Here
70 only restricted digital avail 488 Not Acceptable Here
79 service or option not implemented 501 Not implemented
87 user not member of CUG 403 Forbidden
88 incompatible destination 503 Service unavailable

To not get billed, then you have to not answer, if using sip then you should return a “busy” code (17), but you can’t of course play a message first

extn => blah,blah,1, goto(app-blackhole,busy,1)

I was using the blackhole app but it never dropped a CDR. Maybe things just weren’t configured correctly.

Problem is if I answer the call to play a message, or even a SIT tone, the provider will charge minutes since its a completed call, and 1 second rounds up.

Most of these number blocks belong to a phone spam facilitator. Basically a CLEC that specifically provides service to disreputable companies, and all out fraudsters, that can’t get, or keep, service through reputable CLEC’s. This is the origin of most “lower your interest rate” and various other scams. I’m also having some trouble with some Level-3 blocks in NJ, but their a reputable CLEC so I have to be a little more selective. Then you have the VoIP fraudsters that just spoof invalid NNX like 609-1XX. That’s not even routable so I should probably just put in a global block for that kind of crap.

Unfortunately, no matter what reason code I send back to the provider they either call it a busy or congestion and play a busy to the caller. I’ve opened a ticket with them to see if I can get different handling, but I’m not holding my breath.

even 17 ?

I tried it with Vitelity (who use L3) and sure enough, busy, no cahrge.

so maybe _[01]XX[10]XXXXXX is a good (not)match also? (effectivelty not N)

With Vitelity, as long as you just send back a BYE, there is no charge, well, except CNAM. However, they interpret all reason codes as either Busy or Congestion, and regardless, play a Busy to the caller. Technically, the last thing you want is to play a busy which just invites a callback. What you’d prefer is a SIT tone as some dialers have been set up to recognize the tone and take the number off the campaign list. The billing problem is solved… actually it was never really a problem. Getting the rules just to work was the issue. The rest is gravy.

Hehe, yes Yosarian, it’s a Catch-22 there, I’d let them ring for a few hundred seconds before giving them bye or 17 and let them be inconvenienced or self terminate the call as a “bad drive-by” I bet they add you then . . .

exten => blah,blah,1,Wait(300)
exten => blah,blah,n,hangup(17)

sort of thing, they would either get 5 minutes of ring-back or dead-air . . .

Personally I cache CNAM’s to mysql and query on no-match to www.cnam.info, yep, I’m a cheap bastard, but I guess you are too :slight_smile:

Regards

dicko

I’ve tried CNAM providers but I found calls out to a web service can delay, or even prevent, calls from being delivered. If the CNAM provider starts having trouble you can loose your inbound phone service… unless you get real sophisticated and put in timeouts. So I just let Vitelity deliver it on the call… but then there is no provision to cache it and you have to pay even if you reject the call since it was supplied on the Invite. You can’t win with CNAM… and I’m even thing twice about it since everything these days comes in either “Unknown” or “Wireless Caller”… like I want to pay $0.009 for that.

Yes a timeout is needed but trivial, but 99.9% of legit inbound calls are already cached (by me and my friend mysql, she knows all my servers and they know her :wink: ) so no query necessary there. Either way .006 always trumps .009 especially if you only do it once, ever, per CLID.

How many times do you pay Vitelity to tell you what your girlfriend/wife/bank/fedex/juryduty/etc. name is every week? So I agree, it adds up.