Best way to set up restricted courtesy extensions?

mcbsys

Guru
Joined
Oct 16, 2008
Messages
139
Reaction score
5
Hi,

I'm replacing an old Trixbox installation with PiaF at a small church. There are a couple of analog courtesy phones in public areas, connected to an FXS port on a TDM400 card. These phones should be allowed to call internal extensions and 911 only.

Here is what I've done in the past:

1. Set up an Outbound Route called 9_outside_911only with this Dial Plan:

911
9|911

2. Set up a Zap extension with a custom context called "from-internal-courtesy".

3. Add these lines to the top of /etc/asterisk/extensions_custom.conf:

[from-internal-courtesy]
include => ext-local
include => outrt-002-9_outside_911only
exten => h,1,Hangup

This seems to be working, but I don't like having references to auto-generated contexts, which might change e.g. if I add or resequence routes.

Is there a relatively simple way that I can do this directly in the UI without having to modify extensions_custom.conf?

Thanks for your help,

Mark
 
Try this.

In [from-internal-courtesy] do something like this:

[from-internal-courtesy]

exten => 911,1,goto(from-internal,${EXTEN},1)
exten => _XXXX,1,goto(from-internal,${EXTEN},1) ;change XXXX to your internal extension dial pattern. Leading "_" is important.
exten => .,1,hangup() ;hangup on all other calls
 
Thanks John. Internal extensions are 200 - 209 + 298. I'm assuming the idea that this will use the default Outbound Route? That has a dial pattern of "9|." (require 9 for an outside line), so I'm thinking that means the context would look like this:

[from-internal-courtesy]
exten => 911,1,goto(from-internal,9911,1) ; leading "9" will be trimmed by Outbound Route
exten => 9911,1,goto(from-internal,9911,1) ; in case they actually dial 9 + 911
exten => _20X,1,goto(from-internal,${EXTEN},1)
exten => 298,1,goto(from-internal,298,1)
exten => .,1,hangup() ;hangup on all other calls

Does that look right?

Mark
 
As they say here in the mountains, "I believe that dog will hunt." That looks perfect to me.
 

Members online

Forum statistics

Threads
26,687
Messages
174,411
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top