Custom Failover for Trunk on Outbound Routes


I have the following case. I have a virtualized FreePBX on cluster of ESXi but since the provider delivers over PRI I have to use telephony card on each host.

So I created a separate “basic pri pbx” (aka PBX just to handle telephony cards and only job is to act like passthrough for delivering inbound/outbound through PRI) , so I can leverage replication/vMotion etc on the main pbx (aka the one that handles everything BUT the cards).

So, it’s a single main pbx plus 1 pri-pbx on each esxi host with telephony card.

Which means I have a trunk between main pbx and each pri-pbx.

The problem is that the PRI cable physically is a single cable which at any time is connected to only a single host. So if i have to failover to another esxi host, i have to physically change the cable from one telephony card to another telephony card.

On outbound routes on main pbx, i have set the pri-pbx trunks as failover.

NOW, my problem: Let’s say on Outbound Route on main PBX, I have Host-1 pri-pbx trunk first, Host-2 pri-pbx trunk second.
When I change the cable from telephony card Host-1 to telephony card on Host-2, inbound routes work as intended. Outbound Routes however don’t because the calls are still sent to Host-1 due to it not being actullay offline.

Any ideas how to overcome this? At the moment I manually disabled the Host-1 trunk so that the Outbound Route actually failovers to Host-2, but I ultimately want to avoid this.

You will need to have a cron job run frequently to detect the pri is down and disable the trunk
fwconsole trunks —disable 1 if the trunk is 1

Same to reenable

To could use dahdi ‘dynamic eth spans’ which are layer two ‘things’ between the physical device machine and dahdi installed on the various PBI, you don’t need asterisk on the hardware host, just stopping dahdi on the machine destined to going offline and starting it on the newly active machine and no cable switching needed.

Thank you for the answers!

I will research a bit about both options and see what can work, because frankly right now I’m not sure where to start searching about either of them.

I mean, for one, I am not sure how to detect if PRI is down (as in PRI-PBX is working but the cable is not connected). I would assume something like (for wanpipe1):

asterisk -rx 'dahdi show status' | grep wanpipe1 | tr -s " " |  cut -d " " -f 4

And for dahdi ‘dynamic eth spans’ I have to read about it first because I haven’t encountered it so far.

For dahdi, dahdi-tool will show spans being up or down in a gooey fashion, (believe it)

such layer 2 dynamic spans are ideal for virtualizations such as yours , fast and furious, way easier to set up than layer three trunking. Not so well documented, but neither is the other clever shit that dahdi can do.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.