Name

LookupBlacklist() — Performs a lookup of a Caller ID name/number from the blacklist database

Synopsis

    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), the channel will be set up to continue at that priority level. Otherwise, the application returns 0. If no Caller ID was received on the channel, it does nothing.

To add to the blacklist from the Asterisk CLI, type database put blacklist name / number.

    ; send blacklisted numbers to an endless loop
    ; otherwise, dial the number defined by the variable ${JOHN}
    exten => s,1,Answer()
    exten => s,2,LookupBlacklist()
    exten => s,3,Dial(${JOHN})
    exten => s,103,Playback(tt-allbusy)
    exten => s,104,Wait(10)
    exten => s,105,Goto(103)

Get Asterisk: The Future of Telephony now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.