Skip to Content
Asterisk: The Future of Telephony
book

Asterisk: The Future of Telephony

by Jim Van Meggelen, Jared Smith, Leif Madsen
September 2005
Intermediate to advanced
408 pages
16h 20m
English
O'Reilly Media, Inc.
Content preview from Asterisk: The Future of Telephony

Name

Authenticate() — Requires that the caller enter a correct password before continuing

Synopsis

    Authenticate(password[,options])

Requires a caller to enter a given password in order to continue execution of the next priority in the dialplan. Authenticate() gives the caller three chances to enter the password correctly. If the password is not correctly entered after three tries, the channel is hung up.

If password begins with the / character, it is interpreted as a file that contains a list of valid passwords (one per line). Passwords may also be stored in the Asterisk database (AstDB); see the d option below.

A set of options may be provided, consisting of one or more of the letters in the following list.

a

Sets the CDR field named accountcode and the channel variable ACCOUNTCODE to the password that is entered

d

Interprets the path as the database key from the Asterisk database in which to find the password, not a literal file. When using a database key, the value associated with the key can be anything.

r

Removes the database key upon successful entry (valid with d only).

Returns 0 if the user enters a valid password within three tries, or -1 otherwise (or on hangup).

    ; force the caller to enter the password before continuing, 
      and set the CDR field
    ; named 'accountcode' to the entered password
    exten => 123,1,Answer
    exten => 123,2,Authenticate(1234,a)
    exten => 123,3,Playback(pin-number-accepted)
    exten => 123,4,SayDigits(${ACCOUNTCODE})
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Asterisk: The Future of Telephony, 2nd Edition

Asterisk: The Future of Telephony, 2nd Edition

Jim Van Meggelen, Jared Smith, Leif Madsen
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz

Publisher Resources

ISBN: 0596009623Supplemental ContentCatalog PageErrata