FreePBX Paid Support


Not Logged in - No Account?

Don't have an account? Registering an account with us allows you to post to the forums, easily track new posts, subscribe to threads, pm (private message) other forum members, and receive periodic news letters (you can opt out if you desire). Once you are logged in this message will no longer appear. If you don't have an account, you can create one by registering here. Lost your password, request a new password. We respect your privacy which means we collect minimal information when you register and we do not resell that information or use it in any objectionable way. You can review our privacy policy for full details.


Multi tenants issue (again???)

dinhtrung's picture

Hi, I'm trying to rewrite FreePBX to support Multi-tenant. I read the milestone of Freepbx, and notice that the program won't support Multi- tenants soon (3.0 won't, too).
My idea is extract 2 first number of extension number, and use that to seperate the context. For e.g, company A want an extension that can be called locally with number 100, so I'll create a regular extension (like Freepbx usually create) number 10100 (10 is the company code). For company, number 100 will be extension 11100 (11 is the tenant code). I also change the context in table sip (or zap) to "from-internal-10" (with device = 10100) and "from-internal-11" (with device = 11100). After that, just rewrite the all the get_config() function from modules I want to be seperate. For e.g
Normally:
$ext->add($context, $extension, $priority, $application);
Will be re-write to
$ext->add('context-'.substring($context.'-'.substring($extension, 0, 2), substring($extension, 2) , $priority, $application);

I also need to re-write the context and extension in $application, if they exist.

That's my idea. Any suggestion?
Sorry for my poor writing.


__________________

QiS Technologies, ltd


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Unfortunately there is way

p_lindheimer's picture

Unfortunately there is way more than that involved in making it multi-tenant. Once you start digging into the code and some of the more complex features, you will find that the task gets pretty complicated pretty quickly.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


why not just use custom context?

jpieren's picture

with custom context you could easily adopt a multi tenant scenario (I did one with 4 tenants).

setup:
Trunk-1: 1000 ctxt-A
Trunk-2: 2000 ctxt-B
Trunk-3: 3000 ctxt-C
Trunk-4: 4000 ctxt-D

I have ring groups for each trunk line.

Everything workfine user dial-out on their number and incoming calls to to the right ring group.

The only issue is:

When for example ring group1 rings and the call is forwarded it always uses trunk-1 to go out.....even that custom context is not allowed to use it (but I guess the system does the forward and not the user).


__________________

Jay longtime VoIP expert


Jay, your forwarding issue

p_lindheimer's picture

Jay,
your forwarding issue is just one example of the complexities that need to be considered, and try the transfer scenario also, you will run into similar issues.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


Yes, I've been digging into

dinhtrung's picture

Yes, I've been digging into the code for 2 weeks. Quite complicated, as I don't usually programming in PHP. :(
The main problem with Customcontext is, if I want to provide a company an extension like 100, I couldn't allow another extension 100 in another company. So, I have to use 10100 and 11100 instead, and then re-construct the dialplan and separate them by context.


__________________

QiS Technologies, ltd


the hard part is not really

p_lindheimer's picture

the hard part is not really the php so much (although that will all have to be dealt with), it's the actual dialplan construction that would be needed (and then all the code to manage it).


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


Parking Lot

SkykingOH's picture

The parking lot is also an issue. A patch exists for Asterisk that allows multiple parking lots. They have to be specified on a per extension basis.

Scott


At least, I have complete

dinhtrung's picture

At least, I have complete the minimum function: allow internal call and voicemail in tenant extensions. But the mailbox is not very "pretty", e.g 10100@default or 11100@default instead of 100@10 and 100@11. The voicemail need to be unique to be usable by throughout the dialplan.
Is there anyone doing similar project? I'd like to co-operate with them.


__________________

QiS Technologies, ltd


We have multiple tenants

Bitnetix's picture

QiS,

We have multiple (small business) tenants using Customcontexts and a specific dialing plan that we assign to clients. We hand out extensions in the 50 block numbers and give out more if we need to. This works well, especially since we have a web-enabled database front-end to the phone provisioning so that we can update the phone's dialing plan to only be able to dial the appropriate extensions. We also set voicemail contexts to be company names and have modified the ARI code so that forwarding cannot occur between different contexts.

Combined with customcontext and the fact that we're dealing with companies that are happy to have us tell them their extensions (instead of them telling us) and it works well.

True multi-tenant capabilities must be addressed (parking lots, call forward trunking issues and other things) before FreePBX is truly capable in this arena, but I love FreePBX and all the work that's been done on it, and support it fully.

Feel free to contact me to discuss what we've done to see if it can help you.


__________________

www.bitnetix.com - info@bitnetix.com - 877.33.VOICE - sip://bitnetix@bitnetix.com


Asterisk is certainly not

olivier1010's picture

Asterisk is certainly not the good choice for such a high complexity project.

Freeswitch would certainly be more friendly. Multiple parking lots are supported and advanced things like BLF and custom devices states are easier to program.

For such big projects, i think that Asterisk is definitely not the Answer because of the amount of work needed to adapt it.

Asterisk scaling, reliability and code uniformity is a problem as well for high call volumes and big systems. Asterisk does not give a clear migration path.

Each time a new version is out, there are lots of compatibility problems. This give a lot of work to programmers to re-enable previous custom applications.

I would be happy to see a community starting a FreePBX project for Freeswitch. Should be a very interesting story.

Olivier.