How to get users's extention group

Hi!

I need to setup a dialplan, that restricts users from a specific extention to dial a specific number.

We have basically two group (extention): 100(Office) and 500(OfficeRomania).

User 101 is in the Office(100) extension(queue) and
user 108 is in the OfficeRomania(500)extension(callgroup).

The dialplan is working when I bound it to a user (101 or 108), but it is not workinkg with the extension numbers above. Heres what i mean.

exten => _0040[+*%#a-zA-Z0-9]/101,1,Verbose(1,dial is denied)
exten => _0040[+*%#a-zA-Z0-9]/101,n,PlayBack(beeperr)
exten => _0040[+*%#a-zA-Z0-9]/101,n,PlayBack(mdc-outbound-denied)
exten => _0040[+*%#a-zA-Z0-9]/101,n,HangUp(20)

This script works.
When user 101 wants to dial a romanian phone number, it wont allow it. But when i want to expand this script to the whole Office(100) group it stops working, as invalid extension number.

exten => _0040[+*%#a-zA-Z0-9]/100,1,Verbose(1,dial is denied)
exten => _0040[+*%#a-zA-Z0-9]/100,n,PlayBack(beeperr)
exten => _0040[+*%#a-zA-Z0-9]/100,n,PlayBack(mdc-outbound-denied)
exten => _0040[+*%#a-zA-Z0-9]/100,n,HangUp(20)

How do i get the correct extension number for my extension?

Is it even the right way to this sort of thing?

Thanks in advance!

These are devices not extensions, in Asterisk terms.

The preferred way is to use different contexts for different classes of service. However, you can also use underscore type patterns after the /.

2 Likes

Seems like we managed to get it to work. What we did was to rename our other users to 5XX

Now it looks like this:

exten => _0036[+*%#a-zA-Z0-9]!/_5X[1-9],1,Set(MDC_INPREFIX_TRUNK=)
exten => _0036[+*%#a-zA-Z0-9]!/_5X[1-9],n,Verbose(1,remove inprefix: ${MDC_INPREFIX_TRUNK})
exten => _0036[+*%#a-zA-Z0-9]!/_5X[1-9],n,GoTo(mdc_outgoing-43,${EXTEN:0},1)

Its because we use Pascom, a PBX manager system, that overwrites Asterisk configs. So we had to set up the deny in the GUI and then our custom srcipt.
This is way more difficult than it would be with plain asterisk…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.