Simplest way to bar an extension from making an external outbound call

I have read a number of discussions about this topic but all offer more or less complex solutions or require the purchase of commercial modules. I am a newbie so I am looking for a very simple solution, if there is any. It seems to me that this should be a standard feature. If i were to implement it, I’d have an option, such as a check box, to bar all external calls except to emergency numbers.

I realize others will have more complex requirments and those must be addressed. So, what I want to do when creating an extension is have it default to no external calls to emergency numbers and far a simple way to release the bar.

It is very simple, but it is in no way normal to want. For those that want it, people took the time to code and continually update commercial modules such as extension routing.

Basic (simple code) development from my company is $150/hour. And we cannot code a module to do this in an hour.

That hour ($150) would get you 4 years of Extension Routing ($35/year).

Now if you want to do it cheap, here is only 911. You can figure out for yourself how to add extensions.

Admin → Config Edit → extension_custom.conf

exten => 911,1,Goto(from-internal,${EXTEN},1)
exten => _[*0-9]!,1,Playback(ss-noservice)
exten => h,1,Hangup()

Save → Apply Config

Edit the extension(s) that you want to be restricted → Advanced tab → Context

Submit → Apply Config

Any company/agency I have ever worked for has had the ability to bar outside calls. I don’t know why you say it is not normal.

So does Asterisk. Many ways to handle it. I just showed you one in like 2 minutes. There are more options, but I’m not going to bother holding your hand.

I have only been using FreePBX and I am not all that familiar with Asterisk Thank you for your suggestion.

You need to do a little reading. FreePBX is not the phone system you are using.

I can do a lot of reading, which I have. I have also purchased a book on Asterisk and have enrolled in on online course but often practical examples clarify the theory.

What I want is for extension 602 to be able to call any other extension. In order to get to an outgoing trunk, the user must dial either 8 or 9. Right now all extensions begin with 6 but could be anything except 8 or 9. I am pretty sure it is the third line of Mr. Busch’s example that will do the trick but so far I haven’t figured out the syntax.

I have moved this to the Asterisk community group.

You can do it in the outbound routes, make a 911 route that matches that extension CID only, don’t connect it to any trunk move it on top of the route that allows it.

Perhaps I am not making myself clear.

I want certain extensions to be able to dial 911 and any other extension. They cannot make outbound local, long-distance or international calls.

I have two outbound trunks for external calls. To use them, the user is required to dial either 8 or 9. Simply routing them to a message if they dial 8 or 9 should solve the problem.

Huh? You’ve been a member of this forum for more than five years.

Each Outbound Route Dial Pattern has a CallerID field. If this is not blank, the route will be chosen only if the extension number matches the number or pattern in that field. For example, if you put 20X there, only extensions 200 through 209 can use the route. You can also use patterns such as 20[17-9], which would allow extensions 201, 207, 208 and 209 to call, or use multiple patterns if needed.

If you want to permit most extensions to make outbound calls and only restrict a few, create dummy routes ahead of the normal ones, which match the restricted extensions. These routes would list no trunks, so outside calls made from those extensions would always fail.

Modern systems are generally set up so that numbers are dialed in the same format as a landline or mobile; trunk selection is automatic. What kind of trunks do you have and why do you want to select them manually?

Then the best, easiest and cheapest would be the commercial module extension routing. (Which I believe was already mentioned by Jared.
Create a 911 route, which everyone can access, and create a “Domestic” Route, and grant access only to the extensions who need to be able to place outbound calls.

As Stewart said, these type of setups were used with older systems. …I hope you don’t have to dial 8 or 9 to call 911.

I joined the forum when I was in Vietnam but circumstances required me return to the USA. I really didn’t make much progress learning FreePBX before I left.

One of the trunks is chan_sip and the other is pjsip. My provider is having problems processing calls with pjsip so I require dialing 8 for the chan_sip trunk and 9 for pjsip until we get this sorted out. That is another issue not related to this one.

Your solution seems to be a good one and I’ll give that a try today.

I took this approach.

For the moment, extensions can be from 100-999. Only extensions 100-899 should be able to dial out. For this test site, I have one extension, 901. It should not be able to dial out

I defined a dummy outbound route with no trunks specified. In the Dial Pattern, I put 9XX. It is the first outbound route.

This extension can still make outbound calls.

Match Pattern: X.
CallerID: 9XX

If no luck, post screenshot.

In the caller ID field, like you said. Screenshot of what?

I tested with this, blocking 4-digit extensions beginning with 1. In your case, use 9XX instead of 1XXX

Doh! I forgot the pattern to match…putting in the “x.” made it work.

I get an “all circuits are busy now” message. Now how to get a custom message.

I’d like to get a message like, “you are unauthorized to make outbound calls”.