[Asterisk-Users] Gogoif with variables acting funny?

brian brian at bkw.org
Mon Jul 12 10:05:12 MST 2004


Are you using the lastest cvs?  If not you have a broken gotoif...

bkw

> -----Original Message-----
> From: asterisk-users-admin at lists.digium.com [mailto:asterisk-users-
> admin at lists.digium.com] On Behalf Of Steve Woolley
> Sent: Monday, July 12, 2004 9:51 AM
> To: asterisk-users at lists.digium.com
> Subject: [Asterisk-Users] Gogoif with variables acting funny?
>
> Using an example provided by "The Hitchhiker's Guide to Asterisk", I
> made the following addition to my extensions.conf file:
>
> [inbound-analog]
> exten => s,1,Wait(1)
> exten => s,2,SetVar(counter=0)
> exten => s,3,Answer()
> exten => s,4,Wait(1)
> exten => s,5,DigitTimeout(15)
> exten => s,6,ResponseTimeout(10)
> exten => s,7,BackGround(pls-entr-num-uwish2-call)
>
> exten => t,1,SetVar(counter=[${counter}+1])
> exten => t,2,Gotoif([${counter}<3]?s,7:h,1)
>
> exten => i,1,Playback(invalid)
>
> exten => h,1,hangup()
>
> The hope would be that the "pls-entr-num-uwish2-call" message would be
> offered up to incoming calls 3 times if the caller times out (10
> seconds) and then hangup. However the call hangs up 10 seconds after the
> first playing of "pls-entr-num-uwish2-call".
>
> My asterisk log shows:
>
>     -- Executing Wait("Zap/99-1", "1") in new stack
>     -- Executing SetVar("Zap/99-1", "counter=0") in new stack
>     -- Executing Answer("Zap/99-1", "") in new stack
>     -- Executing Wait("Zap/99-1", "1") in new stack
>     -- Executing DigitTimeout("Zap/99-1", "15") in new stack
>     -- Set Digit Timeout to 15
>     -- Executing ResponseTimeout("Zap/99-1", "10") in new stack
>     -- Set Response Timeout to 10
>     -- Executing BackGround("Zap/99-1", "pls-entr-num-uwish2-call") in
> new stack
>     -- Playing 'pls-entr-num-uwish2-call' (language 'en')
>     -- Timeout on Zap/99-1
>   == CDR updated on Zap/99-1
>     -- Executing SetVar("Zap/99-1", "counter=[0+1]") in new stack
>     -- Executing GotoIf("Zap/99-1", "[[0+1]<3]?s|7:h|1") in new stack
>     -- Goto (inbound-analog,h,1)
>     -- Executing Hangup("Zap/99-1", "") in new stack
>   == Spawn extension (inbound-analog, h, 1) exited non-zero on
> 'Zap/99-1'
>     -- Executing Hangup("Zap/99-1", "") in new stack
>   == Spawn extension (inbound-analog, h, 1) exited non-zero on
> 'Zap/99-1'
>     -- Hungup 'Zap/99-1'
>
> It looks to me as if the Gotoif thinks that [0+1] is greater than or
> equal to 3 and therefore jumps to hangup.
>
> Am I missing something here?
>
> --
> Steve Woolley
> IT Manager
> ADS Telecom, Inc.
> 59 Skyline Drive
> Suite 1250
> Lake Mary, Florida 32746
>
> Phone: (407)682-6226 x1110
> Fax:   (407)682-3455
> Cell:  (321)229-5311
>
> swoolley at adstelecom.com
> www.adstelecom.com
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users





More information about the asterisk-users mailing list