Custom Context - I don't want to allow long distance on public phone

Hoping to use this module.

I have ext. 109 as the phone on the front desk of a hotel.

I would like to have ext. 109 only allow toll free, local and 911 calls.

I pasted this into the Dial Rules of a Custom Context that I created and turned everything else in Custom Context to deny.
NXXXXXX|NXXNXXXXXX|1800NXXXXXX|1888NXXXXXX|1877NXXXXXX|1866NXXXXXX|1855NXXXXXX|911

To complicate things a bit more:

On weekends I would like to allow long distance calls.

I would also like a PIN # that can override these setting at any time so that I can use this ext. just like any other phone in the facility.

The way I have it currently set it does not work.

1 Like

You can play around with using the extension routing module to enable only certain routes for that extension, and then assign a time condition to your LD route for the extension in the outbound Routes module, so that it will only allow outbound routes. This is of course assuming you are using the FreePBX distro, or an installation that supports the ability to add the Extension Route module.

There is a good write up in the wiki for custom context module. If you have not read it I recommend it.

I have not tried this but I believe you need to set up two time groups, one for when you want things barred and one for when you don’t. Then set up two outbound routes one for barred and one for unbarred.

Now all you need to do in custom contexts is to allow access to these two routes on the basis of the time groups that now appear in the allow/deny dropdown for the routes.

And presumably set 109 to use that context?

Using a custom context for that is the proper way to go.
Then, I’d jump into from-internal to a misc destination that points to a timegroup (that gives you the weekend stuff you want plus manual override, while integrating nicely with the GUI so that you can change time groups etc there).

Have the “true” condition point to a misc destination that dials ${EXTEN} (I think that’s the one off the top of my head).
Have to “false” condition go to an announcement of “call cannot be completed as dialed” or something.

I haven’t tested this, but this should give you a start on how to approach this, but it should work. Plus it’d be nice to keeps most things in the GUI for ease of administration.
Please let me know if this worked for you if you decide to give it a try.

Top of screen - http://screencast.com/t/mIKTsYEld
Bottom of screen - http://screencast.com/t/koSijPiOjr

The Dial Plan I have entered does not appear to be working. How should I change the format?

If you deny everything who will 109 call? certainly not other extensions.

mts-lines should be deny rules if you have so defined them.

seperate your dial rules one per line don’t trust the pipe.

again is 109 in that context?

Putting each dialplace on its own line was needed.
NXXXXXX
NXXNXXXXXX
1800NXXXXXX
1888NXXXXXX
1877NXXXXXX
1866NXXXXXX
1855NXXXXXX
911

On my outbound routes, I marked it “Allow Rules”. By doing that it seems to allow calls out based on the dial plan rules I named at the top.

Now I need to figure out how to allow this phone to dial extensions. It needs to be able to dial 101 to get a front desk attendant.

ext-local - Enabling that got my local extensions working

Now I need to figure out how to put the logic in place to have it use my regular dialplan on weekends, and this special dial plan during the week.

I apoligze, I realize now you’re trying to use the (afaik unsupported) custom context module.
When I first read “custom context” I was under the impression you created a context manually in extensions_custom.conf.
I haven’t personally used the CC module, but either way, routing the call through a timecondition may accomplish what you want.