how to use '#' in Read()

tleu
Posts: 12
Member Since:
2008-03-05

I want to use '#' in Read function

so that if I write in dialpal:

exten => s,n,Read(var,hello-world,1,,1,0)

when I enter '#' my variable ${var}='#'

I have no problem with '*',1,2,3,4,5,6,7,8,9,0 in Read function

but if I enter '#' ,it says 'User entered nothing.'

How can I make it?



Praeter
Posts: 343
Member Since:
2006-10-26
As far as I know there is no

As far as I know there is no over ride function for the use of the '#' sign. It is the terminator character and that is that. Some commands like record have an option to change the termination character, but I do not believe read has one. The help screen does not show one , so it would have to be an undocumented option.

>>>>>>>>>>>>>
using asterisk 1.4<
local> core show application Read

[Synopsis]
Read a variable

[Description]
Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])

Reads a #-terminated string of digits a certain number of times from the
user in to the given variable.
filename -- file to play before reading digits or tone with option i
maxdigits -- maximum acceptable number of digits. Stops reading after
maxdigits have been entered (without requiring the user to
press the '#' key).
Defaults to 0 - no limit - wait for the user press the '#' key.
Any value below 0 means the same. Max accepted value is 255.
option -- options are 's' , 'i', 'n'
's' to return immediately if the line is not up,
'i' to play filename as an indication tone from your indications.conf
'n' to read digits even if the line is not up.
attempts -- if greater than 1, that many attempts will be made in the
event no data is entered.
timeout -- An integer number of seconds to wait for a digit response. If greater
than 0, that value will override the default timeout.

Read should disconnect if the function fails or errors out.

--

James Fainer - FtOCC
Praeter Tech



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.