I’d like to be able to restrict incoming calls based on the time of day. During the day when there are classes being taught in some of the rooms, I would like to have the phones in those rooms go straight to voicemail if someone from outside the building calls in to that extension. Calls to those rooms from inside the building should be allowed to go through.
I know about the include statements to base includes on time of day, but I’m not sure how to use them for incoming calls without replicating my dial plan for daytime and nighttime.
The only thing I could come up with so far is:
include => daytime|8:00-17:00|mon-fri||
include => nighttime|17:01-7:59|mon-fri||
exten => 3331,1,Voicemail(u3351)
exten => 3332,1,Voicemail(u3332)
…and so on
exten => 3331,1,Dial(SIP/3331,20,rt)
exten => 3331,2,Voicemail(u3331)
exten => 3332,1,Dial(SIP/3332,20,rt)
exten => 3332,2,Voicemail(u3332)
…and so on
While I think this will work, it will be tedious to make and maintain the dialplan because it will be so huge and there’s lots of duplication.
Is there any easier and more efficient way of doing this that I’m overlooking?