FreePBX | Register | Issues | Wiki | Portal | Support

Restrict internal extension calls


(It Atk) #1

Hi,

I am currently using AsteriskNow which include this FreePBX.

Now I am looking solution how to restrict calls.

I have extension/extension groups 100 000 - 199 999 and 200 000 - 299 999. How I can make rule that only allow internal call between 100 000 - 199 999 extensions but not can’t make call 200 000 - 299 999?

I have understand that I need to make modifications in sip_custom.conf and extensions_custom.conf?

I have found those configuration files under /etc/asterisk/ but it’s only way to edit those using SSH? I have also found that there should be something file editor in FreePBX?


Separating groups of extensions
(Bob Reiber) #2

Use the class of Service module instead of screwing around with the config files


(It Atk) #3

Thanks but there is not any free module?


(It Atk) #4

I tested that module but didn’t found solution how I can restrict calls between extensions.


(Bob Reiber) #5

it works perfectly. we use it at some schools to prevent the students from dialing the paging system. you can say that extension x cannot dial extension y which i assumed is what you were trying to do


(It Atk) #6

Hmm… then I do not know how to use that module because problem is that what you are saying that when I make call like 100101 to 200101 I want that to happened.

Do I need make like paging group and that way block calls?

Because now I tested in extension_custom.conf and put these in

exten => _[23456789]XXXXX,1,playback(ss-noservice)
exten => _[23456789]XXXXX,n,Hangup()
include => from-internal

exten => _[13456789]XXXXX,1,playback(ss-noservice)
exten => _[13456789]XXXXX,n,Hangup()
include => from-internal

Those works fine.


(Bob Reiber) #7

http://wiki.freepbx.org/display/F2/Class+of+Service


#8

@bksales boy do I wish it was that easy.

Please correct me if I’m wrong however my understanding is that the COS module will restrict all kinds of stuff like trunks, paging, queues etc however there is no extension to extension restrictions.

There is no way from the interface to restrict extension to extension calling.


(It Atk) #9

Yes, that is same conclusion which I found.


#10

Could one of the season veterans chime in with an official response please.


(Tony Lewis) #11

COS will not let you restrict dialing between extension. Only between other things like ring groups, queues, feature codes and routes. But it has no ability to restrict what extensions can be called.


(Dave Burgess) #12

On the other hand, you can write a replace from “from-internal” like “from-internal-1000:” which would stop you from dialing “2xxx” numbers and “from-internal-2000” to block “1xxx” numbers.

Use “from-local” from extensions.conf as you template.


(It Atk) #13

@cynjut Do you mean that I will use that from-internal-100000 and context from-internal-200000 in FreePBX extensions context?

But if I do that then nothing works because I need to also make in extension_custom.conf like this

[from-internal-100000]
exten => _[23456789]XXXXX,1,playback(ss-noservice)
exten => _[23456789]XXXXX,n,Hangup()
include => from-internal

[from-internal-200000]
exten => _[13456789]XXXXX,1,playback(ss-noservice)
exten => _[13456789]XXXXX,n,Hangup()
include => from-internal

Then I can allow extensions make calls inside 100000 and 200000 extension but also when I make more extensions like 300000 group I can make new modification in extensions_custom.conf file?

[from-internal-300000]
exten => _[12456789]XXXXX,1,playback(ss-noservice)
exten => _[12456789]XXXXX,n,Hangup()
include => from-internal

Which allow 300000 extensions makes internal call between them.


Dial Plan to manage which extenstion can be dialed and which not
(Daniel Friedman) #14

Hello,

Just stay in the [from-internal-custom] context. There is no need to include the from-internal context as the custom context is executed before the from-internal context.

All you have to do to limit calls between extensions is to use something like that:

[from-internal-custom]
;disallow calls from extensions 1XXXXX to 2XXXXX
exten => _2XXXXX/_1XXXXX,1,Hangup

;disallow calls from extensions 2XXXXX to 1XXXXX
exten => _1XXXXX/_2XXXXX,1,Hangup

Insert these lines to the extensions_custom.conf file and then run the command:

rasterisk -x'dialplan reload'

from the Linux console.

Thank you,

Daniel Friedman
Trixton LTD.


#15

Or in [ext-local-custom], starting at

exten => s,1,

Logically if the length of ${EXTEN} and ${DB(AMPUSER/${AMPUSER}/cidnum)} are both 6 and ${EXTEN:0:1} is not equal to the the first digit of the same cidnnum,` then you could, perhaps, reasonably and preemptively signal unavailable and then hangup.


#16

The simplest way is Custom Contexts.
This example shows access to just one ring group and to a limited extension range.


Blocking external calls on groups of extensions
(Dave Burgess) #17

So, the answer to the original question is obviously “Yes”.

There are lots of ways of blocking this. Pick one and go for it.


(It Atk) #18

I started using that Custom Contexts solution and that is working fine. Thanks for helping.


(Callinectes) #19

Any chance you could share some detail about how you got this to work by using Custom Contexts, UnknowPerson?