Name

Read() — Reads DTMF digits from the caller and assigns the result to a variable

Synopsis

Read(variable[,filename[,maxdigits[,option[,attempts[,timeout]]]]])

Reads a #-terminated string of digits from the user in to the given variable.

Other arguments include:

filename

Specifies the file to play before reading digits.

maxdigits

Sets the maximum acceptable number of digits. If this argument is specified, the application stops reading after maxdigits have been entered (without requiring the user to press the # key). Defaults to 0 (no limit, wait for the user to press the # key). Any value below 0 means the same. The maximum accepted value is 255.

option

Zero or more of the following options:

s

Return immediately if the line is not answered.

i

Interpret the filename as an indication tone setting from indications.conf.

n

Read digits even if the line has not been answered.

attempts

If greater than 1, that many attempts will be made in the event that no data is entered.

timeout

If greater than 0, that value will override the default timeout.

; 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

SendDTMF()