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=