Alternative to custom contexts using dial patterns?

Ok, so I have three extensions (2001, 2002, and 2003) and they are for taking incoming calls during our TV show 3 nights a week. All our office extensions fall somewhere in the range of 1001 to 1999. I do not want the extensions in the 2000 range to be able to call the extensions in the 1000 range and vice-versa.

I believe this can be done using custom contexts, but I was wondering if there were any other alternatives. I then had a big brainstorm and thought I figured it out … I said to myself “I already have an outbound route called BARRED that blocks a bunch of blacklisted numbers, so I will block the extensions that route with a dial pattern!”

So, for example, to block extension 2001 to 2003 from calling extensions in the 1000 range, I entered 1XXX/_200[123] in the dial patterns section of my outbound BARRED route. Talking to myself again, I said “Boy, am I smart!”. I then tested my brilliant idea, only to find out I was not as smart as I thought I was … it did not work!

Now correct me if I am wrong, but I am thinking it did not work because internal-to-internal calls don’t use outbound routes (seems pretty obvious to me now)! They probably get checked to see if they are internal and get routed internally long before they ever reach any kind of outbound route.

So now comes my thought on an alternative to custom contexts…

Is there anyway to check all internally routed calls against a dial pattern, and if the dial pattern matches send it to a recording (like “wrong-try-again-smarty”) and then hangup. If there is no match to dial pattern, then the call would just carry on as normal.

The reason I am asking, is that I like dial patterns, and I find them VERY easy to use and setup … being able to check an internally dialed call against a dial pattern is a whole lot easier (for me anyways) than trying to setup custom contexts.

If anybody has any thoughts on this I would like to hear them.


Once upon a time I stumbled across a FreePBX How-To page that showed how to do all sorts of unusual things like this, go to Documentation (in the right hand column) and you should find a link to the How-To page there. Look at anything that even seems remotely similar to what you want to do, it might give you some ideas.

Thanks sir_sip … I checked the how-to’s and read a bunch of the articles the other day actually, and I don’t see anything along the lines of what I am trying to do.

I think what I want to do will require a little custom modification, but I haven’t got into learning the asterisk language yet, so I thought maybe somebody had already done it or thought of it.

I use dial patterns with my outbound routes and they are very powerful, so I thought it would be a good idea to use them for internal calls as well!