Name
Read() — Reads DTMF digits from the caller and assign the result to a variable
Synopsis
Read(variable[,filename][,maxdigits][,option][,attempts][,timeout])
Reads a #-terminated string
of digits a certain number of times from the user into the given
variable.
Other arguments include:
filenameSpecifies the file to play before reading digits.
maxdigitsSets the maximum acceptable number of digits. If this argument is specified, the application stops reading after
maxdigitshave been entered (without requiring the user to press the#key). Defaults to0-(no limit, wait for the user to press the#key). Any value below0means the same. The maximum accepted value is255.optionSpecify
skipto return immediately if the line is not answered, ornoanswerto read digits even if the line is not answered.attemptsIf greater than
1, that many attempts will be made in the event that no data is entered.timeoutIf greater than
0, that value will override the default timeout.
Returns -1 on hangup or error
and 0 otherwise.
; read a two-digit number and repeat it back to the caller
exten => 123,1,Read(NUMBER,,2)
exten => 123,2,SayNumber(${NUMBER})
exten => 123,3,Goto(1)See Also
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.
Read now
Unlock full access