O'Reilly logo

Asterisk: The Future of Telephony by Leif Madsen, Jared Smith, Jim Van Meggelen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required