Read() disconnects half-way through?

Home » Asterisk Users » Read() disconnects half-way through?
Asterisk Users 2 Comments

Hello

I’m using the Read() function to play a message prompting for the
user to type a number followed by the # key to validate, with a 30s
time-out and 2 tries:
==============
[test]
exten => s,1,Wait(2)
exten => s,n,Answer

;typed DTMF: prompt for number to dial: 2 tries, 30s time-tout
exten => s,n(nbr2call),Read(NBR2CALL,please-type-number,,,2,30)

exten => s,n,GotoIf($[${LEN(${NBR2CALL})} != 10]?nbr2call)
exten => s,n,Playback(phone:${NBR2CALL},say)

exten => s,n(end),Wait(2)
exten => s,n,Hangup()
==============

I notice that it sometimes works fine, but sometimes, Asterisk hangs
up while I’m still typing:
==============
CLI> originate Zap/1/5551234 extension s@test

Executing [s@test:3] Read(“Zap/1-1”,
“NBR2CALL|please-type-number|||2|30”) in new stack

2 thoughts on - Read() disconnects half-way through?