[asterisk-users] [1.4.21.2] Read() disconnects half-way through?

Gilles codecomplete at free.fr
Thu Mar 10 10:53:27 CST 2011


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 at test

Executing [s at test:3] Read("Zap/1-1",
"NBR2CALL|please-type-number|||2|30") in new stack
-- <Zap/1-1> Playing 'please-type-number' (language 'fr')
-- User disconnected
 == Spawn extension (test, s, 3) exited non-zero on 'Zap/1-1'
    -- Hungup 'Zap/1-1'
==============

Has someone also experienced this? Is Read() unreliable and if that's
the case, should I use another way to let a user type a phone number?

Thank you.




More information about the asterisk-users mailing list