Outbound call restrictions

Hello,

Please can anyone help me with setting up a specific setup please?

I am wanting to restrict certain extensions from dialling outbound (apart from emergency numbers), other extensions need to only be able to calls prefixed with 08 and emergency numbers, another set which can ring numbers prefixed with 07, 08 and emergency numbers, etc.

I believe there is a way to do it with contexts - is this correct…? If so, could anyone give me an idea on how to set this up?

Thanks!

Here is an example (Not tested)
In extensions.conf

[code]
[emergency]
exten => 911,1,Dial(…)

[pre-08]
exten => _08.,1,Dial(…)

[pre-07]
exten => _07.,1,Dial(…)

[call-all]
include => emergency
include => pre-08
include => pre-07
exten => _NXXNXXXXXX,1,Dial(…)

[call-08]
include => emergency
include => pre-08

[call-07-08]
include => emergency
include => pre-08
include => pre-07[/code]
Then in sip.conf set the peer to either default to the call-all, call-08 or call-07-08 contexts.

[quote=“davevg”]Here is an example (Not tested)
In extensions.conf

[code]
[emergency]
exten => 911,1,Dial(…)

[pre-08]
exten => _08.,1,Dial(…)

[pre-07]
exten => _07.,1,Dial(…)

[call-all]
include => emergency
include => pre-08
include => pre-07
exten => _NXXNXXXXXX,1,Dial(…)

[call-08]
include => emergency
include => pre-08

[call-07-08]
include => emergency
include => pre-08
include => pre-07[/code]
Then in sip.conf set the peer to either default to the call-all, call-08 or call-07-08 contexts.[/quote]

Fantastic… All seems to be working now…

Thank you very much!