What is the best way to connect multiple FreePBX together?

Oh really, like what?

Well now we’re getting into a realm of research which I can’t do for you because I do not know many of the factors that would determine if a solution is right for you or not. It just seems that part of the criteria for this solution has to account for doing most of the logic for you. Basically plug and play, for a lack of a better term.

It sounds like you guys are following more of a Tier IV model, which is basically deploying and selling pre-designed solutions, either by the platform or by the vendor. Mainly meaning, your services are limited to and subject to the limitations of the solution you’ve deployed. Like FreePBX.

I follow a more Tier II/III model which is I use vendors for their infrastructure and service delivery but I build all the products/services the end user receives. Sure I use FreePBX but it’s just a piece of the overall solution and I’ve had to make it so FreePBX can work with all parts of the overall solution it needs to.

NOC System x 1
SMTP Relay Server x 1
Digital FAX Appliance x 1
Kamailio as Class 4 Switch x 2
MySQL Servers x 2 (Master/Slave failover)
Name Servers x 2 (Primary/Secondary)
Kamailio as Class 5 Switch x 2
–> XMPP Services
–> SMS Services
Core FreePBX Systems x 6 (FreePBX in all cases heavily modified and overridden using existing methods for such purposes)

That is everything in place just for the voice services, not counting straight up hosted PBX systems. “Core FreePBX” are because two of them act as “Media Gateways” providing voicemail services for Resi/SOHO service users and all calls do flow through them so I can have control of the media before sending it to the carriers. This is really a bandaid until budget permits a real SBC solution to be put in place so I can see handle media but not have to answer and open a new channel to do it.

The rest of the FreePBX systems act as “hosted voice” systems and thus are heavily modified in the sense a lot of the custom file options are used for adding SIP settings to extension configs, interjecting a wide range of custom dialplan contexts and using the extensions_override to make small tweaks to existing macros. I create custom “from-internal” style contexts for each “hosted” instance and set that for the context of those extensions. It mimics what from-internal does and just calls on dialplan contexts in the order I want them to be traversed. In some cases certain contexts are not accessible for a user but it allows me to include my custom contexts into the dialplan and hook into all the existing dialplan.

Wait, what about end users with the same extensions?!! That is why they have their own custom context to be called on. To the end user, they are registering to Kamailio which is based on user@domain so instead of an IP they are giving FQDNs so 110@domain1 is completely different than 110@domain2. What I assign as the “extension” number in FreePBX is arbitrary but I try to make it close as possible if there is conflict. Because they have their own custom context I can say 110 dials the 7110 peer which did require the dial macros to be adjusted to send a dial string format that includes FQDNs and modifies the TO/FROM headers properly.

Things like IVRs, Ring Groups, Queues, Conferences, etc those are all still managed normally by FreePBX just that my custom contexts for users just don’t give full access to those contexts. I just jump to the proper ones needed from within their custom context.

One of the great things behind all this is that if a PBX providing hosted voice services does crap about, I can kick in a spare and the Kamailio servers will detect that quickly. Even if there isn’t a ready spare of that particular instance, Kamailio will send the inbound calls to one of the media gateways that will route the calls to Class 5 Kamailio server where the devices are registered. Sure they enter a general ring group style or single extension destination but they are still getting calls and all devices can still make outbound calls because Kamailio will route them out a media gateway. And since it takes like under 10 minutes for a new instance to be spun up it’s not a bad “OH CRAP” solution.

The real question is how serious are you about providing services? What is the “Standards Bar” to meet for your services? As you can see, I’ve spent a lot of time putting together an entire network to support and deliver services as high level as possible.

I can’t help but think that an SBC might be a good fit here:

1 Like

Seems that is a security implementation, rather than a SIP call router / isolator?