Is it possible in Asterisk?

Hi!

I would like to know if is possible to divide Asterisk for group of users.

And make restrictions between them. So, the group number 1 couldn’t call to group number 2.

In some PBXs this features is called Tenanting or something like that…

Is it possible?

thanks all!

Cant you just set up calling rules that if someone from group 1 attempts to dial someone in group 2, to just block that call?

Do I have to do that with all my extensions?? mmm…
Do you have an example?

You can devide dialing plans but you have to be careful with some features like callparking.

If you have two companies and one asterisk server with a proper number plan it is not that hard to get them separated. If all the numbers of company 1 starts with 5 and the numbers of company 2 starts with 6 and the numbers have 4 positions a very basic dialplan could lok something like this.

[company_1]
; internal calls
exten => _5XXX,1,Dial(SIP/${EXTEN},40)
exten => _5XXX,1,Hangup()
; external calls
exten => _XXXXXXXXXX.,1,Dial(${SIP_TRUNK_COMPANY_1}/${EXTEN},40)
exten => _XXXXXXXXXX.,n,Hangup()
[company_2]
; internal calls
exten => _6XXX,1,Dial(SIP/${EXTEN},40)
exten => _6XXX,1,Hangup()
; external calls
exten => _XXXXXXXXXX.,1,Dial(${SIP_TRUNK_COMPANY_2}/${EXTEN},40)
exten => _XXXXXXXXXX.,n,Hangup()

In the sip entries for internal phones for company 1 you add context=company_1 and for company 2 you add context=company_2

This in’t the whole story but if yo understand the above I think you are halfway. Search for numbermatching and do a lot of reading and trying. Success!

Thanks a Lot!!!

I was looking for something different such as simple restriction by group.

But as I see, I have to set differents dialplans.

One more question.

If I want to set the same numbers for both companies. I mean, if both companies numbers starts with 5. Can I do that? setting different dialplans?

Hi

You can do it with one diaplan and then use variables stored in the sip.conf for each user

Ian

[quote=“ianplain”]Hi

You can do it with one diaplan and then use variables stored in the sip.conf for each user

Ian[/quote]
interesting! How I do that? What kind of variables? Where can I search for information about it?

After use variables, do I have to set something in my dialplan?

I must doing something wrong because doing that, I can make calls normally… from one group to another.

If this is all that is in extensions.conf and in the sip entries of company 1 in sip.conf you add context=company_1 and the sip entries for company 2 you add context=company_2 you should have seprated dialplans that can’t touch each other. Don’t forget to reload.

For a good understanding you also have to read about how to include contexts or a .conf file into a context and by including make it part of that context .

I didn’t copied it from a working system so perhaps there is a typo (or two)