I’m making a few assumptions in this answer:
- You meant intra-district (ie internal) calls should still be permitted.
- For some reason, both internal and external calls are using the same auto-attendant. I would have expected internal calls to call the classroom extension directly.
CUC can’t do exactly what you’re asking because it can’t evaluate the calling number as part of a Call Handler. CCX/IP IVR could since it has a full scripting language at it’s disposal.
As much as I detest it, this may be a use case for CUCM Time of Day routing on the incoming PSTN Gateway/Trunk CSS. During the day, add a Translation Pattern that changes the called number. This would allow you to match a different Call Handler on CUC that either doesn’t allow extension input (all Caller Input options are Locked) or had a CUC CSS that excludes the CUC Partition of all classroom mailboxes.