Reading the combination of the letters and characters in asterisk gateway interface


#1

hello dear friends, have a nice time!
I am using agi script with php. which command can help me to read character, numbers and letters all together. for example it should read this : q-12345 . thankful if anyone help me.


#2

Read from what? From a variable should be easy. From a normal telephone is difficult, because phones cannot send “q” and “-”, so you would need to use multiple key presses with timeouts, and/or use knowledge of the syntax to know when to treat a key press as a digit, and use more complex processing. I don’t believe that there is any built in way of providing that knowledge, so you will have to provide your own code to implement it.


#3

I want to read from a soft phone. I stored that value to a variable and I passed that value to the say_digits command but it couldn’t read it. Or is there any argument for say_digit command to escape two letters and start reading from third character?


#4

People will understand “reading” to mean obtaining the value, not outputting it.


#5

If you just want to say the digits SayDigits() should work. I think it ignores non-digit characters.
Or you could clean it up with REGEX() like this:

...
 same => n,Set(just_the_digits=${REGEX(“[0-9]+” "q-12345")})
 same => n,SayDigits(just_the_digits)
 same => n,Hangup()

You could also try: SayAlpha()