Synopsis:
Look up Caller*ID name/number from blacklist database
Description:
LookupBlacklist
Looks up the Caller*ID number on the active channel in the Asterisk database (family ‘blacklist’). If the number is found, and if there exists a priority n + 101, where ‘n’ is the priority of the current instance, then the channel will be setup to continue at that priority level.
Otherwise, it returns 0. Does nothing if no Caller*ID was received on the channel.
Example:
Sample Section for extensions.conf
[incoming]
exten => s,1,LookupBlacklist
exten => s,2,Dial(SIP/1234,15)
exten => s,3,Answer
exten => s,4,Wait(1)
exten => s,6,Voicemail(u1)
exten => s,7,Hangup
exten => s,102,Goto(blacklisted,s,1)
[blacklisted]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,Zapateller
exten => s,4,Zapateller
exten => s,5,Playback(ss-noservice)
exten => s,6,Hangup
Note: On asterisk 1.2+ you must add (j) to the end, in order for it to actually make the priority jump. Like such:
exten => s,1,LookupBlacklist(j)
otherwise, it will just continue onto the next priority.
To insert a number into the Black list from the CLI
database put blacklist <name/number> 1
eg. database put blacklist 0123456789 1
Stores 0123456789 as a blackilsted CallerID
To delete a number from the blacklist using the CLI
database del blacklist <name/number>
eg. database del blacklist 0123456789
Deletes 0123456789 from the blacklist database
Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ