Simplest way to bar an extension from making an outbound call

I posted the following in the FreePBX forum earlier today. Maybe there is an Asterisk only solution. I am a newbie to both Asterisk and FreePBX.

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.

Can anyone help and offer an example?

Asterisk handles calls based on contexts in the extensions.conf file,FreePBX auto generate extensions.conf file every time you make and apply a change on this system, you can check on the FreePBX forum if there is any module that meet your needs, or write your context on extensions_custom.conf file or edit the FreePBX core dial plan and remove the remove the access for outbound calls to the sip device , this change need to be done on /etc/asterisk/extensions_override_freepbx.conf

So far, I have only seen references to commercial modules which are out of my budget.

I got a suggestion from a user on the FreePBX community forum, however, he is looking for commercial work. Like I sad, I am new to this so some practical examples will help.

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

In my case case, all extensions could start with 1-7 and are three digits long. My outbound route defintions use either 8 or 9 to select one.

So, I want extension 602 to use the [from-restricted-phone] context, I need to understand how to specify that dialing 8 or 9 will play the ss-noservice recording. Ideally, I’d like to have a custom recording but I’ll work on that later.

Is hard to work with Asterisk and FreePBX at the same time on this forum, because when dealing with FreePBX there are always changes that need to be done directly on the GUI like the outbound route defintion, so If you can’t edit the dial plain without omit the GUI I suggest you address this issue specifically on the FreePBX forum

According to the guy who posted the example I gave, it is “simply” a matter of changing the extension_custom.conf file using the editor FreePBX provides. I would “assume” that FreePBX wouldn’t clobber that file during an upgrade but I don’t know because this is a fresh system.

The solution he provided seems simple enough but I haven’t been able to get it to work.

add the following to extensions_custom.conf

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

then on using the GUI change the context for the extensions from from-internal to from-restricted-phone

future questions about this topic, address it directly with the guy who proposed the solution he should know more than any one how to implement it

I’ve done all that. The third line causes all calls to play back ss-noservice. That’s not what I want, as described above.

The fellow on the FreePBX forum is soliciting commercial work. I do not want to deal with him.

You actually mean device or user, not extension. Extension is FreePBX terminology.

The standard way of doing this in Asterisk is to have different contexts according to the class of service of the calling device, and to allocate those contexts in the device technology file, e.g. sip.conf.

As method that can be used to restrict remote callers can also be generatised and that is “ex-girlfriend logic”. You can place a second sub-field in the extension field in extensions.conf, separated by a “/” and put a number or pattern for a caller ID to be matched. Some subtleties are that the extension field doesn’t have to be the same for each priority and priorities numbers increment from line to line when using n, regardless of the extension field, and you can use s or n-1 to repeat the last priority.

Asterisk will use the best match in any case, so you can provide a catch all match, with no caller ID sub-field.

Failing to implement class of service would seem a major limitation of FreePBX, so I’m surprised it is the case, but I’ve never used it.

FreePBX implements CoS through a commercial module. I haven’t looked into using Asterisk by itself to implement this.

Thanks for your suggestion.

I got a very simple solution on the FreePBX community site. It’s not complete but does the trick so far. Thanks for those who have helped.

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