There is a commercial module Class of Service, but it does not support extension to extension blocking. Other than that, I am not aware of any module that does anything similar or close to this .
You have two options (both are custom dialplans…).
- Put these phones in a custom context, write a dialplan which will do the checks, andif allowed, you will send the call to
from-internal,${EXTEN},1
- Use the predial hook to do the check. See: Hooking for fun and income