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

Danny Nicholas danny at debsinc.com
Thu Mar 10 11:20:47 CST 2011


-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Gilles
Sent: Thursday, March 10, 2011 10:53 AM
To: asterisk-users at lists.digium.com
Subject: [asterisk-users] [1.4.21.2] Read() disconnects half-way through?

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.


Just a guess - the problem may be with Originate instead of Read.   If you
make a an extension 5555 that does this:
Exten => 5555,1,Goto(test,s,1)

Does the behavior manifest itself as well?





More information about the asterisk-users mailing list