Restricting one extension to call just one other Extension

surjones

New Member
Joined
Jan 20, 2011
Messages
10
Reaction score
0
Hello!

I have PBX in a Flash 1.7.5.5 and Asterisk 1.8.2 behind a hardware firewall.

I have two friends setup as remote extensions:

Me=701
Friend A =702
Friend B=703

Friend A does not know Friend B, so I wish to allow
Friend A to call me
and Friend B to call me

NOT 702<->703

I've just started and am reading PIAF without tears!
Thanks!
Suraj
 

jmullinix

Guru
Joined
Oct 21, 2007
Messages
1,263
Reaction score
7
Suraj,

You should probably create some new contexts in the extensions_custom.conf file that look like this:
Code:
[from-friend-A]
exten => 701,1,goto(from-internal,${EXTEN},1)
exten => _7XX,1,hangup()
include => from-internal
The first line completes any calls from Friend A to extension 701. The second line dumps all other calls to 700 series extensions. The "include" line allows Friend A to use the rest of the dial plan. If you don't want them to be able to dial out, removed the include line.

If you remove the include statement, make sure you add the necessary code to make emergency calls. Here in North America, that would be:
Code:
exten => 911,1,goto(from-internal,${EXTEN},1)
The last step is to go into FreePbx and change the context for the extension to "from-friend-A."
 

surjones

New Member
Joined
Jan 20, 2011
Messages
10
Reaction score
0
I am using the multi tenant system for google voice where each extension can dial out from their outbound route and associated trunk. It made me create custom contexts from the freepbx interface and I associated that with each extension. How do I make your context and that context work together?

Many thanks!
 
Joined
Jun 29, 2009
Messages
258
Reaction score
0
What follows is strictly my opinion so you can take it or leave it, but my belief is that Custom Contexts is overkill for most users. All you really need to restrict extensions to certain trunks is to create a separate outbound route for each extension, making "their" Google Voice (or whatever) trunk the destination, and then use the extension field of your outbound route dial patterns to limit the use of that route to a particular extension or group of extensions. This article from my blog provides a bit more information on the subject:

A couple tidbits for Asterisk and FreePBX users

Once you get rid of Custom Contexts, then it's much easier to do the type of restriction you want. Just follow the advice jmullinix gave you, and/or see the last section of this article on the FreePBX site (ignore the first part, I think it must have been written prior to the implementation of the extensions field in the outbound route dial patterns):

freepbx.org/support/documentation/h...xtension-different-or-restricted-trunk-access
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Hi

FreePBX really is not designed for Multi-tenant operation, so to try and force it into such a role is going to lead to administrative headaches.

Multi-tenant can be approximated with FreePBX, but I would hesitate to take this approach unless you are in an environment where all the owners of all the extensions know one another, and mis-transferring a call to the wrong extension is not going to cause business conflicts.

If you want to separate extensions, then consider virtualisation with one PBX per customer. It's easily done with Proxmox, or look at a PBX system which is designed from the ground up to multi-tenant.

Joe
 

surjones

New Member
Joined
Jan 20, 2011
Messages
10
Reaction score
0
Hello,
I followed what you say about outbound route dial pattern extension field to set one extn. to call out with one route and one trunk associated with it.

I added the context as John says in the extensions_custom.conf file.

Now when I go to the extension to set the context of that extension to this context, I don't see it in the "custom context" drop down menu. I don't see any other custom context field also on the extension..

Where should I set it?
Thanks!
Suraj
 

jmullinix

Guru
Joined
Oct 21, 2007
Messages
1,263
Reaction score
7
Just type it in the extension's context field without the square brackets.
 

surjones

New Member
Joined
Jan 20, 2011
Messages
10
Reaction score
0
Thanks,

But as I said, the custom context is a dropdown field and is non-editable. I am using freePBX ver. 2.8.0.4.

Sorry if it sounds stupid!
Suraj
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
You are not actually looking for a "Custom Context" field, rather just "Context" in the PEER sections around the Secret field etc. You would replace from-internal with the new context.
 

Members online

No members online now.

Latest Posts

Forum statistics

Threads
25,861
Messages
168,049
Members
19,281
Latest member
Alex_Spiridonov
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.
Top