I stumbled upon this module last night when trying to delimit access to an outbound route per extension. I added a colleague to my PBX who had purchased an account at voip.ms; problem was when he would dial out it would always display my Caller ID and use my trunk (which is bad if he dials international). I guess this is a frequently asked question so I created a video demonstrating the great power of this module – you will be surprised how easy creating permissive contexts can be This video will show you how to install the module and limit access to outbound routes / trunks per extension. The goal is to partition an Asterisk IP PBX in order to host multiple tenants on one system.

The following information is from this site.  Please check it out for download link and changelog / usage.

Possible Uses

  • Restrict access to certain outbound routes or feature codes by a particular extension or group of extensions.
  • Give particular extension(s) priority access to certain outbound routes, such as a particular emergency route associated with their geographic location.
  • Give certain outbound routes top priority for use during “free” or low cost calling periods, while making those same routes lower priority (or disallowing access entirely) during higher cost time periods.
  • Disallow access to outbound routes (with possible exception of Emergency access) to certain (or all) extensions during particular time periods (don’t let night cleaning crew make long distance calls, or disallow outgoing night calls from telephones in children’s rooms, while still allowing emergency number calls).
  • Allow two or more families/companies/organizations to use the same FreePBX box, while still allowing each to have access only to “their” outgoing routes and trunks.
  • If you have a SIP provider that does not send DID (normally a pain to handle because you can’t create a normal Inbound Route), set up a new custom context (call it idiot-provider), give them no access to anything (deny all), and then specify where you want their calls to go in the Failover Destination. Then put context=idiot-provider in that provider’s trunk user details.

Module Description

One feature which was a bit lacking in Asterisk/FreePBX was the ability to easily create multiple tenants.

This module creates custom contexts which can be used to allow limited access to dialplan applications.

Now allows for time restrictions on any dialplan access!

This can be very useful for multi-tenant systems.

Inbound routing can be done using DID or zap channel routing, this module allows for selective outbound routing.

House/public phones can be placed in a restricted context allowing them only internal calls.

Custom contexts can now be used as destinations. An IVR menu, Time Condition, etc. can now send a caller into a custom context. This feature requires FreePBX 2.2.0rc2 (or the latest SVN version if prior to the release of rc2)

(The following are the module author’s comments, “I” refers to the module author, not the original creator of this wiki page).

A number of improvements have been made to freePbx to handle multiple tenants.

1) inbound routing based on zap channel – i used to have to hack it by putting each zap channel in its own context.

2) authtype = database allows for dividing extension ranges

the main problem for me was outbound routing…

I wanted some extensions to dial out one route, and others out another route.

I had to create a custom context for each, then place each in their own custom context, then include all of the contexts which they should have access to. This became a nuisance as each module added its own context to from-internal-additional which could not be included as it also contains outbound-allroutes.

The purpose of this module is to dynamically list all contexts included in any contexts you choose, and allow you to create custom contexts which can include any of these all without config editing.

My power supply came in the mail this week for my Toshiba A200 notebook so I decided to add Windows 7 to the installed OS list (currently booting Leopard 10.5.2 and Ubuntu 9.04).  As always Windows hijacked the master boot record with it’s inferior boot manager – I had to fix this immediately.

GRUB is not as complicated as people make it out to be. In fact it is a very elegant solution to handling multi-boot platforms. Here’s a quick guide to steal your MBR space back from Windows :

  1. Boot into live CD such as Ubuntu or Knoppix – DSL works well and is fast.
  2. Open a terminal, if your live CD boots into a GUI – press ALT+CTRL+F2 to access a different console.
  3. type “cfdisk”

This part is tricky – you must find where GRUB currently lives – in the case of the image below (my rig) sda5 is where Ubuntu is installed – in GRUB this is equal to hd0,4 – since GRUB counts from 0, not 1.

Screenshot

Once you have determined what partition holds grub root files – close cfdisk (q) and type :

grub

root (hd0,X) <– where X is the grub count from 0 to your current Linux installation*

setup (hd0,0)

This will opverwrite Windows MBR installation and give access back to GRUB hooray!  Next step would be adding Windows boot back to grub which has already been covered in my “How To Dual Boot Hackintosh + Ubuntu” article.

* I have a difficult time expressing this simple idea – if Linux is installed on SD5 then grub should say (hd0,4).  If your boot partition is /dev/sda87, GRUB would be (hd0,86) – I hope this helps.

EDIT : I forgot to mention a huge congratulations to Microsoft for making an operating system that looks and feels like Vista with the intermittent stability of XP – huge upgrade IMO.. still far from Leopard.