B.56. LookupBlacklist()

Checks the caller ID of a call against the local number blacklist in the Asterisk database (AstDB).
LookupBlacklist([options])
Searches for the caller ID number (or name) of the active channel in the blacklist family of the AstDB.des aktiven Channels in der AstDB in der Familie blacklist. If the option j is given, the number exists in the AstDB and the priority n+101 exists, the channel is handed to that priority. If no caller ID is available, the application does nothing.
Sets the channel variable LOOKUPBLSTATUS to FOUND or NOTFOUND.
To add numbers to the blacklist from the CLI, enter database put blacklist "number" "1"; similarly database del blacklist "number" to delete the entry and database show blacklist for a listing of all the entries in the database.
; Block calls from numbers in the blacklist,
; otherwise dial the number in the variable ${PETER}:
exten => 123,1,Answer()
exten => 123,n,LookupBlacklist()
exten => 123,n,GotoIf($["${LOOKUPBLSTATUS}" = "FOUND"]?black,1)
exten => 123,n,Dial(${PETER},30)

exten => black,1,Playback(tt-allbusy)
exten => black,n,Hangup()
You can accomplish the same effect as LookupBlacklist() with the following dialplan entries:
exten => 123,1,Macro(blacklist,${CALLERID(num)})
exten => 123,n,Dial(IAX2/user:secret@widgets.biz/500)

[macro-blacklist]
; Aufruf: Macro(blacklist,${CALLERID(num)})
exten => s,1,GotoIf(${DB_EXISTS(blacklist/${ARG1})}?black)
exten => s,10(black),NoOp(${ARG1} is in the blacklist)
exten => s,n,Busy(5)
exten => s,n,Hangup()

Note

Internal help for this application in Asterisk 1.4:
  -= Info about application 'LookupBlacklist' =- 

[Synopsis]
Look up Caller*ID name/number from blacklist database

[Description]
  LookupBlacklist(options): Looks up the Caller*ID number on the active
channel in the Asterisk database (family 'blacklist').  
The option string may contain the following character:
 'j' -- jump to n+101 priority if the number/name is found in the blacklist
This application sets the following channel variable upon completion:
 LOOKUPBLSTATUS  The status of the Blacklist lookup as a text string, one of
  FOUND | NOTFOUND
Example: exten => 1234,1,LookupBlacklist()
diff output to internal help in Asterisk 1.2:
- none -