If the classroom phones are not supposed to be able to answer inbound, external calls, then I would recommend assigning them non-DID DNs. This way you won't have to worry about doing any crazy translations or dial-peers.
OR
You can create a set of translation rules that grab any call to particular DID from the outside.
Example:
Say you want all calls to 5500 - 5509 from outside sent to voicemail (vm pilot 2222)
-----------------------------------------------------------
voice translation-rule 1
rule 1 /550[0-9]/ /2222/
voice translation-profile ClassRoom
translate called 1
dial-peer voice 2 pots
incoming called number .
direct-inward-dial
translation-profile incoming ClassRoom
-----------------------------------------------------------
As far as disallowing the transfer of an external caller to a classroom from another phone, I can't think of a solution off the top of my head, but if I do, I'll post. You could try something with COR Lists, but I can see that getting complicated quite fast.
HTH
Adam