FreePBX with multiple Companies


I wonder if there is any way to use mutiple companies in one PBX. For example having compony A with IVRs inbound rule would be easy, but what about the outbound rule?

I know lets say 9 digit for comp A dialing out 999-xxx-xxxx compB 8 for dialing out 888-xxx-xxxx and C 7 777-xxx-xxxx

What about if all wants to use same dial plan for all phone? Do I need special modules for that or can do with existing in FreePBX 14?

1 Like

ahhh yes:

FreePBX doesn’t have true multi-tenant capability. You can emulate it to some degree, however. Incoming is easy, just have separate DID’s for each company and have separate destinations (IVR, etc.) for each DID (use Inbound Routes to select the destinations). Outgoing is harder - the semi-difficult part is forcing each extension to use only the trunks purchased by that company. For that you can use Rob Thomas’ new Outbound Route Permissions module, or one of the other techniques described in How to give a particular extension different or restricted trunk access for outgoing calls .

What you cannot do is assign the same extension numbers to both companies - that is, you can’t have an extension 1101 for both company A and company B. You can assign extensions in Company A extensions in the 1000-1099 range and for Company B use extensions in the 1100-1199 range (just as an example) but unless you take steps to prevent it, each company will be able to call the other’s extensions just by dialing the extension number (which in most cases isn’t a problem, but it could be in some unusual situations).

I hope this answers your question. FreePBX just wasn’t designed to be a multi-tenant solution. What I think some people have done is to run “virtual machines” and then run an instance of Asterisk and FreePBX in each VM, however that probably bings its own set of problems and issues, so I don’t really recommend that either.

1 Like

As already stated, FreePBX is not a multi-tenant solution.

I dont care about same extension for 2 or 3 companies. Like in other posts is “you can emulate it to some degree” and I am looking for that degree. Is there any module so I can use for one trunk and some extensions use just different outbound DID. I have one trunk with multiple DID and inbound is easy.

Is there any pay module I can use for some extension to use outbound for example 888xxxxxxx and others 777xxxxxxx using only one trunk?

It would be easier having multiple trunks but I have only one. Thank you

This is what Extension Routing or Class of Service is for. To make it so only certain extensions can dial certain things and only use assigned outbound routes.

You are going to very limited on things doing it this way. All the recordings are saved in the same locations. Blacklists are global, mean that is User A blacklists a DID because they don’t want calls from it, it means it is blacklisted for all users including those that want calls from it. Speed Dials/Asterisk Phonebook is global so again if User A creates a speed dial of 1 then all users have that speed dial. If they add a DID to the phone book with a specific name for CallerID, all users get that name if your dipping into the phonbook as a CallerID source.

The other fun caveats, if User A misdials and does something like *211000 to activate FM on their account and they are actually 100 and misdialed if you have a user 1000 they now have FM activated without even knowing about it because a user from a completely unknown company activated on their account by accident.

If user dials *98 and enters the wrong mailbox and that maibox happens to have a basic password like “1234” that happens to be the same password the user calling VM has they could end up in someone else’s voicemail.

There is more to this then making sure Company A can dial certain Outbound Routes or not dial certain extensions from Company B since every user has access to all the apps, feature codes and other global system items that have no real access control via modules because that’s not how FreePBX was designed.

So yeah, when people say you can “emulate it to some degree” they are saying it’s a half-assed implementation that has so many caveats you have to watch for it is a pain in the ass to deal with. And really, do you want your customers figuring out that not only can they get access to other customers users/voicemail/features but also that those other customers have access to their stuff?

Experience is going to dictate no, they would not be happy and it could cost you customers.

If you design your extensions and blocks it’s also very easy to handle your outbound calling with pattern matches in the outbound route and no modules needed. I’m driving I can try and get screenshots later today as I do this for one client to separate the calling for their branch offices into separate billing packages.

In addition to the solutions offered, there is the commercial module CID Management

These are all great solutions when you are considering a PBX for a single company that may have multiple locations, remote workers or even a company that has multiple brands. The one thing these all share is the fact that all the users are together. Sure you can use some CoS or other items to help control what those users can do but there is generally no worries about “cross-contamination” because at the end of the day, they are all part of the same corp.

In a “Hosted Voice” a.k.a Mult-Tenant solution that places like RingCentral, Jive, Vonage and basically any Telecom out there that offers this type of solution the one single expectation that exists for this is that the “tenant” is private. That means the client basically has an PBX to themselves and the freedom to do as they wish with it. This is like any other established voice service out there when you say it is “X type of service” then there are going to be Y expectations for that service.

The OP has already said “I don’t care about the same extension for 2 or 3 companies” but you know who will care? The company that has existing extensions that are used by the public and in their contact info on their material/emails/business cards. Now for some companies having to modify/change their extensions won’t be a big deal because in those cases the extensions aren’t really “public”. However, companies that have known extensions that can be direct dialed by the outside world will have issue with having to change everything and just will opt to go someplace else that doesn’t make them change their entire setup.

Also the other fun caveat as everyone as dismissed incoming calls as “easy peasey”. What happens when Company A wants to have Direct Dial enabled on their IVR? Because if you don’t set up the Direct Dial properly guess what happens? The caller can enter any extension and if that extension exists they will be able to call it. So again, they could end up calling Company A, getting their IVR and then doing a direct dial to an extension that used to exist for the company but now has changed and they end up calling another user at another company. Then there is the whole “mis-dialed” issue that callers have and they could mean to enter the proper extension and end up entering the wrong one, it could then just end up connecting to another user in another company.

There is a lot more to making this a “Multi-Tenant” system than just throwing modules, free or commercial, at it.

1 Like

@mst , if you really need lots of small companies on one small server, a long time ago the lack of multi-tenency (among other things) caused asterisk to fork freeswitch, it always lacked a simple usable gui, perhaps now “fusionpbx” is a truly multi-tenant solution ideal for you,

That isn’t a bad suggestion at all. Just keep in mind that how FreeSWITCH does this is with domains so each tenant would have to have an unique domain so [email protected] and then [email protected] so that means you would have to have a domain per company (not a bad idea) but that is just another thing you have to deal with in this type of solution.

Another huge advantage of named based domains is that only truly malicious “inside trader” type exploits will ever get a SIP response, even on UPD:5060 :wink: . Make sure you delete your IP named domain from the gui. Further, SRV records in DNS make for an easy failover solution

thank you all for response - I will look at fusionpbx but this situation is more like “a single company that may have multiple locations” so probably I will wait for Jared screenshots and will test them first before I consider other distro.

I fully understand all pros and cons but in this particular case - outbound calling with pattern matches in the outbound route should be just fine.

really appreciate a lot of responses here thank you

That is not how you presented this at all. If that was how your presented this in your original post and topic name, the thread of conversation would not have veered to also include caveats for every option provided.

sorry - indeed I used “mutiple companies in one PBX” I admit I used misleading words, there are multiple division where there is one owner and even all extensions are located mostly in one place, that may change in the feature. I may look at and probably will look at above solution, but for now I would like to test outbound calling with pattern matches in the outbound route, then maybe paid module to see how it works and finally look at different real multi tenant real distro. I like freepbx since its the most well know product by me and here I treat all new discovered ways as learning something new in freepbx. Even forum here is awesome counting all replies.
I do this for free, not for money in this case, its charity organization I have decided to help so I do what I can, and they understand this so nobody would complains even if preliminary config does not work like it should. I even would pay modules from my own pocket.

Once again thank you for all replies. Awaiting for Jared screenshoots.

1 Like

My humble opinion
Single company, either single or multi-site => Asterisk/FreePBX

Multi-tenant as in several different companies => FreeSWITCH/FusionPBX

Of course you could try and set Asterisk to work for multi-tenant, but that will require a lot of coding and of course only Asterisk, not FreePBX, as it is not designed for multi-tenant.

Create a directory, add extensions to that directory, allow direct dial to that directory. Problem solved.

Yes, I know exactly what the answer was to the scenario I was pointing out. It wasn’t about the solution it was about being aware a solution was needed and why.

1 Like

Here are said screenshots.

Separate trunks because accounting wanted fully separate billing.

Specific inbound routing by full DID

Various outbound routes

Specifying the Called ID with a pattern match to the extensions for each outbound route.
Office 1: ext range 5100 - 5199
Office 2: ext range 5200 - 5299
(that 891 prefix is for testing purposes user have no idea it exists).

To have true multi-tenant, the tenants need to be completely autonomous. Meaning if one tenant goes into night-ring mode, it shouldn’t affect the other tenant. Trunk and station groups are separate. You should even be able to have the same stations on both tenants (say, tenant 1 and tenant 2 both have extension 1000)

There are systems out there that do this (I’m certified on NEC systems, and I know they can do it), but I’m not sure that folks reading this thread are clear on just how much separation multiple tenants are. It’s essentially like having multiple, stand-alone phone systems, all individually customizable, but on the same physical box.

Honestly, if I were going to use FreePBX to do anything like this, I would probably set up virtual machines, each running their own FreePBX on their own network.


Exactly. That is really the only thing to do. Because FreePBX is simply not a multi tenant solution. Just do individual PBX systems.

When someone actually needs multi tenant, I recommend FusionPBX (FreeSwitch).