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.
aSets the CDR field named
accountcodeand the channel variableACCOUNTCODEto the password that is entereddInterprets 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.
rRemoves the database key upon successful entry (valid with
donly).
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})