FOOD FOR THOUGHT Blacklist issue

AndyInNYC

Active Member
Joined
May 23, 2013
Messages
772
Reaction score
124
I keep getting calls from a callerid 'GO GREEN' or 'GOGREEN' from various, non-legitimate numbers. Some are in my area code, some not.

I'm using the blacklist module and have entered just the callerid (name) in an attempt to block the calls along with entries using (non-repeating or blocked after entry) the number.

Is there some way to block all calls from 'GOGREEN' or 'GO GREEN' that I'm missing?


Andrew
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
I too have wanted a feature like this. Sadly it'll probably take some dialplan code and a custom DB.
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
Perhaps send calls to a context like

[catch-trolls]
exten => _X.,1,gotoif($["${CALLERID(name)}" = "GOGREEN"]?troll)
exten => _X.,n,gotoif($["${CALLERID(name)}" = "GO GREEN"]?troll)
exten => _X.,n,Goto(from-pstn,${EXTEN},1)
exten => _X.,n(troll),Hangup()
 
Last edited:

AndyInNYC

Active Member
Joined
May 23, 2013
Messages
772
Reaction score
124
Dicko,

I like the idea, but the list is longer than just GO GREEN. I'd love to work in side the blacklist module (ie have blacklist use the description field as well, perhaps).

Plus, your context should likely be added in with some other additional code - so that I don't ignore blacklist to just remove GO GREEN, for example. Where would your context be added?

Andrew
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
It's a little harder than you think, the blacklist "module" is a wrapper around an internal asterisk function blacklist() it only operates on CallerID(number) , you could certainly add either another db or multitask the blacklist one in the sqlite3 astdb table and query it instead of my simplistic "GO GREEN" example , but populating the table with alphabetical data essentially a phone dial pad would be very difficult, you could look at the app-blacklist* contexts in the FreePBX code and perhaps use something like app-blacklist-last but replicating all of the blacklist() functions to use CallerID(name) would "not be trivial"

either way you would put your code in extensions_custom.conf , send all inbound calls to it and make sure you pass successful calls on to whatever context you are using right now.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
@dicko: Since this is being sent by the caller as the CallerID, I'm just curious what would happen if you manually added GOGREEN and GO GREEN to the Asterisk DB blacklist table:
Code:
asterisk -rx 'database put blacklist "GO GREEN" 1'
asterisk -rx 'database put blacklist GOGREEN 1'

You can always delete them if it causes problems or doesn't work:
Code:
asterisk -rx 'database del blacklist "GO GREEN"'
asterisk -rx 'database del blacklist GOGREEN'
 
Last edited:

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
That would probably work no trouble as blacklist() just checks whethere CALLERID(number) is in the db. However one could argue that if the CALLERID(number) contains anything but numbers it would not be kosher, then one could simply have

exten => _X.,1,gotoif($["${CALLERID(number)}" : "[0-9]+"]?from-pstn,${EXTEN},1:app-blackhole,hangup,1)


Edit:-
I just looked at func_blacklist.c and it would appear that blacklist actually checks both CALLERID(name) and CALLERID(number)

if (ast_channel_caller(chan)->id.number.valid && ast_channel_caller(chan)->id.number.str) {
if (!ast_db_get("blacklist", ast_channel_caller(chan)->id.number.str, blacklist, sizeof (blacklist)))
bl = 1;
}
if (ast_channel_caller(chan)->id.name.valid && ast_channel_caller(chan)->id.name.str) {
if (!ast_db_get("blacklist", ast_channel_caller(chan)->id.name.str, blacklist, sizeof (blacklist)))
bl = 1;
}

So very little is needed , just populating the blacklist DB.
 
Last edited:

AndyInNYC

Active Member
Joined
May 23, 2013
Messages
772
Reaction score
124
After getting yet another call (from yet another DID) I added 'GO GREEN' per Ward's post. I'll let everyone know if they get through again.

Thanks.


Andrew
 
Joined
Aug 10, 2010
Messages
9
Reaction score
0
Can Blacklist catch invalid area codes? For example a Social Security scam group is using 822 area code this morning and it is very annoying. If Blacklist could match an area code it would be nicer.
 

ostridge

Guru
Joined
Jan 22, 2015
Messages
1,618
Reaction score
517
Can Blacklist catch invalid area codes?
You could add inbound route(s) that include a pattern match in the DID(Number) field, and set the destination as required perhaps to 53669 LENNY

Perhaps its not a neat solution if you have a lot of such area codes.

FWIW I have for some time included the following in my blacklist
UNKNOWN
anonymous
private
restricted
unknown
witheld

These seem to work fine.
 

Members online

Forum statistics

Threads
25,779
Messages
167,505
Members
19,199
Latest member
leocipriano
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top