@2btested123 You want to setup a custom context in extensions_custom.conf
. This is found in Admin -> Config Edit.
Here is an example I have for a house phone that can only dial the operator. The phone itself is also set to auto dial 1200. But just in case someone gets around that, the extension is in this context.
[from-house-phone]
exten => 1200,1,Goto(from-internal,${EXTEN},1)
exten => _[*0-9]!,1,Playback(ss-noservice)
exten => h,1,Hangup()
Then in the Advanced tab of the Extension(s) that you want to be in the context, you give them the context.
Edit:
You would need a more complex, or at least different bit of context to do what you want.
If your extensions were in simple groups, you could do something like this. (Pulled right out of my butt, may not work).
[from-restricted-extension]
; dialing extensions 1200-1299 is not allowed
exten => _12XX,1,Goto(nocallforyou,1)
; dialing extensions 1400-1499 is not allowed
exten => _14XX,1,Goto(nocallforyou,1)
; dialing anything else is allowed send it back to the normal call flow context
exten => _[*0-9]!,1,Goto(from-internal,${EXTEN},1)
; play the no service message and then hangup;
exten => nocallforyou,1,NoOp()
exten => nocallforyou,n,Playback(ss-noservice)
exten => nocallforyou,n,Hangup()