To stop phone extention from calling other groups

Hello I wonder if it is possible top a few extentions from calling everyone else. Li k e say got floor space and office space. I would like for them not to be able to call The other group is that possible?

I think you can use the custom contexts module to do this. Create a new context through the module, enable the outbound routes and features codes but disable calling the other extensions.

Thank you astbox. what I’m trying to figure out this custom contexts module but have no clue where to find it. I looked in the admin module place and other parts of the menus but nothing. What i’m trying to do is have one set of extensions be able to call within each other within that set of extensions and also be able to call out on a analog fxo line

And now be able to call other extensions or there analog fxo lines.

You need to go to module admin, there you can install it from the extended repository, After installing it you can try to set up the different contexts.

Hello Astbox what is the name of it? I can not seem to find a module called custom contexts. i found a

doesn’t the extension routing module do exactly what you are asking for?

Hello bksales no it doesn’t as far as i can see. I’m still new to the whole frepbx but i don’t see how i can stop a whole group of extensions from calling outside there extension. say if i have ring group 600 and in there it has Ext 700 thru 750 yes calling in will only call to them extensions only But no way of blocking that group or stopping that group 700 to 750 from calling another group say 800 to 850. So far that i can see.

Traditionally (since it comes up once or twice a year) the usual recommendation is that you set up a custom context that limits/allows extensions to call each other based on DBGET parameters from the Asterisk database.

Having re-read your post, I want to make sure that you aren’t assuming that ring-groups are actually groups with some sort of management framework around them. Ring groups are just a special destination that allows you to call a group of phones without having to specify a bunch of extension numbers every time.

Now, if I was writing such a context to meet the needs you’ve specified, I might be inclined to use the ring group as the list of “valid” or “invalid” destinations, since the group members are stored in the Asterisk database. That way, as I add and delete members from the group, the context remains the same and you get the benefit you are looking for without having to change the context every time.

That’s just me, though: I hate making changes to two places to solve one problem.

Hello cynjut That is what I’m trying to figure out right now. I do understand the ring group is now for this. But I’m trying to figure how to setup the custom context. Just not sure how i can do this.

You’re just going to have to try. No one is likely to write it for you for free. You might get lucky and someone might be willing to cough up the code they used.

There are plenty of good Asterisk books out there. FreePBX is open source, as is Asterisk. There are all kinds of example of people doing things like this.

If you are really stuck, put it in as a feature request (under Issues, above). You might need to part with some cash to make it happen, though, so be warned.

Hello I’m not asking anyone to do it. The problem I’m having is that. I do not know where to start at where to find this context module at. That is what i been asking for help for. I try to follow astbox post in here. But I can’t not find it at all.

So, let’s start at the foundation.

FreePBX is a management and feature implementation system that runs on Asterisk. Almost everything we do with FreePBX is based on some part of Asterisk.

When handling calls, we almost always use something called a context. These are implemented through a series of configuration files in /etc/asterisk. There are a TON of contexts already being used - there’s one in /etc/asterisk/extensions.conf called “[from-internal]”.

These contexts are just little programs written using the “context language” in the system. Intro to Contexts from VoipInfo.com

So, once you understand that the context is nothing more than a little program, you can start expanding your horizons from there. Asterisk has a real-time (high-speed) database built in that you can interrogate using “IF” and “DBGET” statements in your new context.

If you can’t do what you need with that, you can add more features. I’m pretty sure you won’t need to get much further than that, though. There’s almost nothing that you’ve said you need that you shouldn’t be able to with the local Asterisk database and the logic statements in the context language.

So, to start, log into the console as ‘root’. Find a context that does a bunch of stuff that you need. (dbget, dbput, if, etc.) and copy it to a new context in the file “/etc/asterisk/extensions_custom.conf”. Give it a new name like “[dave_said_this_is_a_name]” at the top. Copy the text of your example context to this new context. Make some changes and see what happens.

At some point in the “[from-internal-custom]” context, you’ll add a reference to “GoSub(dave_said_this_is_a_name,s,1)” and get started from there.

I don’t know how much programming you’ve done or if you even have access to the root account. This isn’t “I’ve just started using Netflix, so I’m going to write a custom context”, but there’s no good reason why a reasonably intelligent person with access to the Internet shouldn’t be able to knock this out in a couple of weeks.

Hello cynjut I do have root access i build he system. I’m looking at what you wrote And I’m amazed at it. Not shocked shocked yet. But I’m learning it thank you for the starting point on it.

A quick Custom Contexts example:
If you wanted to make a context to allow calling Ring Group 602 only, create the context, enter its configuration page and select “Allow Rules” in the ext-group include. And a value of 602 in The Dial Rules box at the top of the page. You could also use regular expressions here if needed.
On the extension(s) concerned select this new context rather than the default from-internal.
Simple as that. Call blocking between extensions can be done the same way, as can selective access to trunks. No need to write dial code.

Find current versions Here

Normally I use a CC to accomplish a number of tasks, not just one as described here. Warning: This is a powerful and versatile tool, you can thoroughly mess up your system with it.

Hello JohnF thank you for the Pointing me in this direction to help me to get started. I will look into this. It gives me a better understanding how soon i will do this.