How to restrict access of users to a particular trunk?

Hello,

Thanks for reading my post! Is there a way to restrict a set of users to only be able to use a specific trunk for incoming and outgoing? We are only using 1 Asterisk Server. Basically what I want to happen is Local 721,722,723 will be able to use Trunk 1 and receive any incoming call from trunk 1 (must restrict access to 421,422,423. and 421,422,423 will be able to use Trunk 2, receive it’s incoming call but restrict 721, 722 and 723 access.
Right now this can be achieved by using 88 as access number to 72X and 89 for 42X users but my problem is when 42X uses 88 as access it allows it allows the call to go through.

When is say RESTRICT it means that when 721,722,723 tries to dial the pattern for 421,422,423 it will not go through vice versa.

Users Trunk 1
721
722
723
Users Trunk 2
421
422
423


IAX Trunk 1
(must allow only incoming and outgoing to 721, 722,723)
IAX Trunk 2 (must allow only incoming and outgoing to 421, 422, 423)

I would really appreciate it if you would be able to put a sample code on how to do this…

Thanks in advance,
Joey

have different contexts set for the groups of users, and in extensions.conf you’ll have the ability to define different dialplans, and so restrict who can dial what. keep all the common extensions in another context and “include” that. e.g.

[code][internal-common]
exten => 100,1,Dial(SIP/100|30|Tt); Reception

[group1]
include => internal-common
exten => _X.,1,Dial(ZAP/G1/${EXTEN}|60|TW)

[group2]
include => internal-common
exten => _X.,1,Dial(ZAP/G2/${EXTEN}|60|TW)
[/code]
you should be able to work out the reverse easily enough for incoming calls.

Hello Baconbuttie,
Thanks for pointing me to the right direction… I’ll try to do this over the weekend… :wink:

Cheers,
Joey