All pastes #366195 Raw Edit

Unnamed

public text v1 · immutable
#366195 ·published 2007-02-21 15:55 UTC
rendered paste body
-- Accepting call from '94975' to '650137' on channel 0/1, span 1
    -- Executing Goto("Zap/1-1", "Auto") in new stack
Feb 21 16:55:49 NOTICE[4068]: pbx.c:1753 pbx_extension_helper: No such label 'Auto' in extension '650137' in context 'incoming'
Feb 21 16:55:49 WARNING[4068]: pbx.c:6515 ast_parseable_goto: Priority 'Auto' must be a number > 0, or valid label
  == Spawn extension (incoming, 650137, 1) exited non-zero on 'Zap/1-1'
    -- Hungup 'Zap/1-1'


The Code is:

;Incoming calls- check if autoattendant is logged in, otherwise goto "auto"

exten => 650137,1,Goto(Auto)

[Auto]

exten => s,1,DBGet(autoattendant=auto)
exten => s,2,GotoIf($${autoattendant} = "1"?openb|1)
exten => s,3,Voicemail(su1139)
exten => s,4,Hangup


and to set:

;Login with 801, log out with 802
 exten => 801,1,DBPut(auto=1)
 exten => 802,1,DBPut(auto=0)