External Calls not allowed to reach certain extensions during office hours

Hello and thanks in advance for any help.
I want to set it to where teachers in our district phones will not ring during school hours. If a parent calls in and wants to talk to a teacher they will be forwarded to the teachers voicemail automatically instead of their phone ringing. However I still want internal calls able to go through incase the office needs to reach the teacher.
Thanks again!

Without entering into custom dialplan, may use a time condition so then during business ours won’t get to a teacher’s extension. Will have to figure how to reach every extension, if there aren’t too many, maybe options with the same ext# going to every extension’s voicemail.
Don’t know how usually a caller gets to the teacher’s ext.

I did just this about a year or so ago. Check out the thread here. Only problem I had is if I enabled dial by name directory, so parent can search for teacher but name. My dial plan doesn’t work, haven’t had time to troubleshoot it yet.

So you’re saying that you weren’t able to enable dial by name with it working? But direct dial once they got into the IVR worked fine?

Yes, if I enabled dial by name in the IVR and create a directory with the list of teacher name (so they can not dial anyone outside of school) my custom dialplan would not work. But if you have it the IVR dial by name is without a directory (ie the whole district) my custom dial plan works.

Okay awesome. Thanks for all your help. I haven’t had to mess with SQL databases too much do you have a how to guide you followed to complete the thread you posted?

Check this post, Redirect calls from external to VM part2 - #25 by longqvo

I was able to use the"Account Code" Field in the extension instead, it is looking for a string “@classroom

Okay so you set account code to classroom for all teacher extensions. I guess from reading the thread I’m a bit confused on how exactly you got to your end goal to make it working. You also made a time group that ties in from what I read but not exactly sure the steps you took.

For the Timegroup, I created a TimeGroup under Application - Time Group, I created 2 groups, one for Classroom Hours (Mon-Fri 7am to 3pm), 2nd one Holidays (Spring Break\Thanksgiving\ ie non-school days).

Keep in my I am not an expert in dialplan\asterisk or a programmer. I know enough to be dangerous.

This is just setting variables, Looking at the extension Account Code field. Looking at Classroom Hours\Hoilday from the above Time Groups

exten => _XXXX,1,Answer()
same => n,Set(CALLER_ACCOUNTCODE=${DB(AMPUSER/${EXTEN}/accountcode)})
same => n,Set(classroom_hours=${EXTENSION_STATE(*271@from-internal)})
same => n,Set(holiday=${EXTENSION_STATE(*273@from-internal)})

Checks if accountcode has the word “@classroom”, if not SkipForwardVM (ie rings into the room), if yes, go to the next line

same => n,GotoIf($[“${REGEX(”@classroom" ${CALLER_ACCOUNTCODE})}" != “1”]]?SkipForwardVM)

If classroom hours are “Inuse” meaning NOT classroom hours.
If Holiday = Not_INsue, meaning it is a holdiday, if yes SkipForwardVM (ie rings into the room), if yes, go to the next line

same => n,GotoIf($[“${classroom_hours}” = “INUSE”]?SkipForwardVM)
same => n,GotoIf($[“${holiday}” = “NOT_INUSE”]?SkipForwardVM)

All above means it is a classroom\classs time and not hours,gdo to VM

same => n(ForwardVM),Voicemail(${EXTEN},u)
same => n,Macro(hangupcall,)

This is the Ringing the classroom part.

same => n(SkipForwardVM),Goto(from-did-direct-continue,${EXTEN},1)
same => n,Hangup()

Hope that helps.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.