[Asterisk-Users] logic problem with GotoIf?
Rich Adamson
radamson at routers.com
Tue Mar 9 10:43:26 MST 2004
Trying to implement a simple mechanism to enable / disable the ivr menues
while in the office and having a logic problem (brain fart).
Call comes in via x100p in the "inbound-bus" context of zapata.conf
In extensions.conf, I've got:
; activate the ivr by dialing this extension
exten => 3950,1,Wait(1)
exten => 3950,2,DBput(FEAT/ivron=yes)
exten => 3950,3,Hangup
; deactivate the ivr by dialing this extension
exten => 3951,1,Wait(1)
exten => 3951,2,DBdel(FEAT/ivron)
exten => 3951,3,Hangup
[inbound-bus]
exten => s,1,GotoIf(DBget(FEAT/ivron) == yes?bus-ivr-main|s|1)
exten => s,2,Dial(${PHONE1}&${PHONE2},15)
[bus-ivr-main]
exten => s,1,Wait,1
exten => s,2,Answer
exten => s,3,DigitTimeout,5
exten => s,4,ResponseTimeout,20
exten => s,5,Background(npi-greeting) ; "Thanks for calling press 1 for"
<snip>
I call x3951 and the DBdel is executed.
When a call arrives, the CLI shows...
Mar 9 11:49:18 NOTICE[1226054960]: chan_zap.c:4607 ss_thread: Got event 2 (Ring/Answered)...
-- Executing GotoIf("Zap/2-1", "DBget(FEAT/ivron) == "yes"?bus-ivr-main|s|1") in new stack
-- Goto (bus-ivr-main,s,1)
Looks like the GotoIF is not doing what I thought it would. Is my logic
messed up?
Thoughts?
Rich
More information about the asterisk-users
mailing list