Hi,
I found that setting ‘Blacklist Module - Settings - Block Unknown/Blocked Caller ID’ to Yes, adds additional lines (I commented the lines) to the /etc/asterisk/extensions_additional.conf file
Here is a snippet from that file.
[app-blacklist-check]
include => app-blacklist-check-custom
exten => s,1,GotoIf($["${TOLOWER(${CALLERID(number)})}" = "unknown"]?check-blocked) ; 1 added
exten => s,n,GotoIf($["${TOLOWER(${CALLERID(number)})}" = "unavailable"]?check-blocked) ; 2 added
exten => s,n,GotoIf($["${TOLOWER(${CALLERID(number)})}" = "anonymous"]?check-blocked) ; 3 added
exten => s,n,GotoIf($["${TOLOWER(${CALLERID(number)})}" = "private"]?check-blocked) ; 4 added
exten => s,n,GotoIf($["${TOLOWER(${CALLERID(number)})}" = "restricted"]?check-blocked) ; 5 added
exten => s,n,GotoIf($["${TOLOWER(${CALLERID(number)})}" = "blocked"]?check-blocked) ; 6 added
exten => s,n,GotoIf($["foo${CALLERID(number)}" = "foo"]?check-blocked:check) ; 7 added
exten => s,n(check-blocked),GotoIf($["${DB(blacklist/blocked)}" = "1"]?blacklisted) ; 8 added
exten => s,n(check),GotoIf($["${BLACKLIST()}"="1"]?blacklisted)
exten => s,n,Set(CALLED_BLACKLIST=1)
exten => s,n,Return()
exten => s,n(blacklisted),Answer
exten => s,n,Set(BLDEST=${DB(blacklist/dest)})
exten => s,n,ExecIf($["${BLDEST}"=""]?Set(BLDEST=app-blackhole,hangup,1))
exten => s,n,GotoIf($["${returnhere}"="1"]?returnto)
exten => s,n,GotoIf(${LEN(${BLDEST})}?${BLDEST}:app-blackhole,zapateller,1)
exten => s,n(returnto),Return()
;--== end of [app-blacklist-check] ==--;
I understand the purpose of those line are to check for common CID names like ‘unknown’ and block them.
My question is about the lines with “CALLERID(number)” function.
I understand that ‘number’ returns the number (3334445555) and ‘name’ returns the text (unknown) of the CID.
If this is correct, then
exten => s,1,GotoIf($["${TOLOWER(${CALLERID(number)})}" = "unknown"]?check-blocked)
will fail to match because ‘number’ will never be ‘unknown’.
I think the line(s) should be
exten => s,1,GotoIf($["${TOLOWER(${CALLERID(name)})}" = "unknown"]?check-blocked)
Q1 Is this a bug or do I misunderstand what the lines are doing?
I have follow up questions, but first I need to understand if the number vs name is a bug.
Thank you,