Asterisk–Creating an Auto Attendant
Method One : using on/off service codes :
Login with 111 and log out with 222
exten => *111,1,DBPUT(auto/attendant=1) exten => *222,1,DBPut(auto/attendant=0)
Incoming calls- check if autoattendant is logged in, otherwise goto "auto"
exten => s,1,DBGet(autoattendant=auto/attendant) exten => s,2,GotoIf($${autoattendant} = "1"?auto|1) exten => s,3,Dial(SIP/333,30,t) exten => s,4,Goto(auto|1)
Method Two : Password protected In-menu Toggle :
[global-attendant] exten => s,1,Answer exten => s,2,DBGet(aastatus=auto/attendant) exten => s,3,GotoIf($${aastatus} = "1"?autoattendant,1) ... remaining body of attendant IVR logic
Turn attendant on/off
exten => **,1,Background(Password) exten => **,2,Authenticate(0000) exten => **,3,DBGet(aastatus=auto/attendant) exten => ,4,GotoIf(${aastatus} = "1"?,10) exten => **,5,DBPut(auto/attendant=1) exten => **,6,Playback(autoattendant-turned-on) exten => **,7,Hangup exten => **,10,DBPut(auto/attendant=0) exten => **,11,Playback(autoattendant-turned-off) exten => **,12,Hangup
Another Method :
Put the calls to queue and have your receptionist login/logout of the queue
exten => 600,1,AddQueueMember(phillyq|SIP/${CALLERIDNUM:6}) exten => 600,2,Playback(agent-loginok) exten => 600,3,Hangup exten => 601,1,RemoveQueueMember(phillyq|SIP/${CALLERIDNUM:6}) exten => 601,2,Playback(agent-loggedoff) exten => 601,3,Hangup