<html><body>
<DIV>I've done something similar on my home office. I use a global variable. A person calls a particular extension which sets the variable to an "out of the office" value. (There is an equivalent "in office" extension.) </DIV>
<DIV> </DIV>
<DIV>Then, in the dialplan use the GotoIf command, checking the value of the variable.</DIV>
<DIV> </DIV>
<DIV>This is the dialplan:</DIV>
<DIV> </DIV>
<DIV><FONT size=2>
<P>[general]</P>
<P>static=yes</P>
<P>writeprotect=yes</P>
<P>[globals]</P>
<P>THERESA_EXT=2001</P>
<P>ALISON_EXT=2002</P>
<P>KATHY_EXT=2003</P>
<P>CHUCK_EXT=2004</P>
<P>THERESA_PHONE=SIP/${THERESA_EXT}</P>
<P>SECOND_OFFICE_PHONE=SIP/2002</P>
<P>KATHY_AVAIL=true</P>
<P>ALISON_AVAIL=true</P>
<P>AVAILABLE=1</P>
<P>NOT_AVAILABLE=0</P>
<P>[voicepulse-incoming]</P>
<P>include => afterhours|00:00-7:59|mon-fri|*|*</P>
<P>include => workday|8:00-17:00|mon-fri|*|*</P>
<P>include => afterhours|17:01-23:59|mon-fri|*|*</P>
<P>include => weekend|*|sat|*|*</P>
<P>include => weekend|*|sun|*|*</P>
<P>exten => h,1,Hangup</P>
<P>exten => i,1,Hangup</P>
<P>exten => t,1,Hangup</P>
<P>[workday]</P>
<P>exten => _NXXNXXXXXX,1,Dial(${THERESA_PHONE},20,tr)</P>
<P>exten => _NXXNXXXXXX,2,GotoIf($[${ALISON_AVAIL} = true]?4:3)</P>
<P>exten => _NXXNXXXXXX,3,GotoIf($[${KATHY_AVAIL} = true]?4:5)</P>
<P>exten => _NXXNXXXXXX,4,Dial(${SECOND_OFFICE_PHONE},20,tr)</P>
<P>exten => _NXXNXXXXXX,5,Goto(ppimenu,s,1)</P>
<P>exten => h,1,Hangup</P>
<P>[afterhours]</P>
<P>exten => _NXXNXXXXXX,1,Dial(${THERESA_PHONE},20,tr)</P>
<P>exten => _NXXNXXXXXX,2,Goto(ppimenu,s,1)</P>
<P>exten => h,1,Hangup</P>
<P>[weekend]</P>
<P>exten => _NXXNXXXXXX,1,NoOp("GOT TO WEEKEND!")</P>
<P>exten => _NXXNXXXXXX,2,Goto(ppimenu,s,1)</P>
<P>exten => h,1,Hangup</P>
<P>[ppimenu]</P>
<P>exten => s,1,Answer</P>
<P>exten => s,2,Background(ppimenu)</P>
<P>exten => 1,1,Voicemail(u${THERESA_EXT}@local)</P>
<P>exten => 1,2,Hangup</P>
<P>exten => 2,1,Voicemail(u${ALISON_EXT}@local)</P>
<P>exten => 2,2,Hangup</P>
<P>exten => 3,1,Voicemail(u${KATHY_EXT}@local)</P>
<P>exten => 3,2,Hangup</P>
<P>exten => 4,1,Voicemail(u${CHUCK_EXT}@local)</P>
<P>exten => 4,2,Hangup</P>
<P>exten => i,1,Goto(ppimenu,s,2)</P>
<P>exten => h,1,Hangup</P>
<P>exten => t,1,Playback(vm-goodbye)</P>
<P>exten => t,2,Hangup</P>
<P>[good]</P>
<P>;exten => _NXXNXXXXXX,1,Playback(demo-congrats)</P>
<P>;exten => _NXXNXXXXXX,1,Dial(SIP/2002,20,tr)</P>
<P>exten => _NXXNXXXXXX,1,Dial(SIP/2001&SIP/2003,20,tr)</P>
<P>exten => _NXXNXXXXXX,2,Voicemail(u2002@local)</P>
<P>;exten => h,2,Hangup</P>
<P>;exten => i,2,Hangup</P>
<P>;exten => t,2,Hangup</P>
<P>[voicepulse-outgoing]</P>
<P>;exten => _1NXXNXXXXXX,1,Dial,IAX2/VfQ62JvV74@voicepulse/${EXTEN}</P>
<P>exten => _1NXXNXXXXXX,1,Dial,IAX2/VfQ62JvV74:jmF63yJh74@gwiaxt02.voicepulse.com/${EXTEN}</P>
<P>exten => _011.,1,Dial,IAX2VfQ62JvV74@voicepulse/${EXTEN}</P>
<P>exten => 2000,1,Dial(SIP/2000,20,tr)</P>
<P>exten => 2001,1,Dial(SIP/2001,20,tr)</P>
<P>exten => 2002,1,Dial(SIP/2002,20,tr)</P>
<P>exten => 2003,1,Dial(SIP/2003,20,tr)</P>
<P>exten => 2004,1,Dial(zap/1,20,tr)</P>
<P>exten => 2222,1,Answer</P>
<P>exten => 2222,2,Playback(chuck)</P>
<P>exten => 95${KATHY_EXT},1,Macro(call-voicemail,${KATHY_EXT})</P>
<P>exten => 95${ALISON_EXT},1,Macro(call-voicemail,${ALISON_EXT})</P>
<P>exten => 95${THERESA_EXT},1,Macro(call-voicemail,${THERESA_EXT})</P>
<P>exten => 95${CHUCK_EXT},1,Macro(call-voicemail,${CHUCK_EXT})</P>
<P>;exten => 95${KATHY_EXT},1,Answer</P>
<P>;exten => 95${KATHY_EXT},2,Wait(1)</P>
<P>;exten => 95${KATHY_EXT},3,VoicemailMain(${KATHY_EXT}@local)</P>
<P>;exten => 95${KATHY_EXT},4,Hangup</P>
<P>;exten => 95${ALISON_EXT},1,VoicemailMain(${ALISON_EXT}@local)</P>
<P>;exten => 95${ALISON_EXT},2,Hangup</P>
<P>;exten => 95${THERESA_EXT},1,VoicemailMain(${THERESA_EXT}@local)</P>
<P>;exten => 95${THERESA_EXT},2,Hangup</P>
<P>;exten => 95${CHUCK_EXT},1,VoicemailMain(${CHUCK_EXT}@local)</P>
<P>;exten => 95${CHUCK_EXT},2,Hangup</P>
<P>;exten => 2999,1,VoicemailMain(${CALLERIDNUM}@local)</P>
<P>exten => 2999,1,VoicemailMain(2002@local)</P>
<P>exten => 3999,1,VoicemailMain(2001@local)</P>
<P>exten => h,1,Hangup</P>
<P>exten => i,1,Hangup</P>
<P>exten => t,1,Hangup</P>
<P>;</P>
<P>; DO NOT DISTURB LOGIC</P>
<P>;</P>
<P>exten => 99${KATHY_EXT}${AVAILABLE},1,Macro(change-availability,KATHY_AVAIL,true,vm-goodbye)</P>
<P>exten => 99${ALISON_EXT}${AVAILABLE},1,Macro(change-availability,ALISON_AVAIL,true,alison_in)</P>
<P>exten => 99${KATHY_EXT}${NOT_AVAILABLE},1,Macro(change-availability,KATHY_AVAIL,false,vm-goodbye)</P>
<P>exten => 99${ALISON_EXT}${NOT_AVAILABLE},1,Macro(change-availability,ALISON_AVAIL,false,alison_out)</P>
<P>;exten => h,1,Hangup</P>
<P>[macro-change-availability]</P>
<P>; ARG1 - variable name. will be set to the value of ARG2</P>
<P>; ARG2 - 'true' or 'false'</P>
<P>; ARG3 - message to play back</P>
<P>exten => s,1,Answer</P>
<P>exten => s,2,SetGlobalVar(${ARG1}=${ARG2})</P>
<P>exten => s,3,NoOp("Kathy is available? ${KATHY_AVAIL}")</P>
<P>exten => s,4,Playback(${ARG3})</P>
<P>exten => s,5,Hangup</P>
<P>[macro-call-voicemail]</P>
<P>; ARG1 - extension</P>
<P>exten => s,1,Answer</P>
<P>exten => s,2,Wait(1)</P>
<P>exten => s,3,VoicemailMain(${ARG1}@local)</P>
<P>exten => s,4,Hangup</P>
<P>exten => h,1,Hangup</P></FONT></DIV>
<DIV>>The system wants to have different incoming call handling more-or-less </DIV>
<DIV>>based on time of day, but we don't want it to be at some precise UNIX time, <BR>>but rather under human control, so if people stay late they can keep it in <BR>>a more appropriate mode.<BR></DIV></body></html>