
- Details
- Category: Technology
So you have your brand new cluster! You keep feeding it with your dialplans and start moving some customers there. All good so far!
Wait! You have to modify a dialplan; some servers get it while others don't. What is happening?
FusionPBX Caching Engines Explained
Memcache Engine
Since release 4.2 (maybe before), FusionPBX has supported Memcached. Memcache is a fantastic caching engine with the following features:
- LRU algorithm,
- Auto-expiring objects,
- 100% memory, zero I/O,
- Outsourcing is possible, and
- Key based.
However, the biggest challenge that Memcached presented (until today) was the difficulty of reading what was inside it.
File Engine
Since release 4.4, FusionPBX introduced field-based caching and made it its default engine. Yes, it resolved the issue of an easy way of knowing the cache content, with a trade of the following:
- objects won't auto-expire,
- there is always I/O, and
- cache can't be outsourced (as it writes into a local directory).
Where is the issue? If your deployment is a low-volume stand-alone server, none. If your deployment is a medium to high-volume cluster, you will notice that when you make a change in the UI, one server may take it but the rest nodes won't. The only workaround for this is flushing all the content in the /var/cache/fusionpbx directory. You will find that the more nodes you have, the more tedious this becomes (especially when debugging).
Why Don't We Have the Best of Both Caching Engines?
That is a good question, and frankly, I have no idea why this hasn't happened until now. My solution is as next:
- Switch back to the Memcache caching engine,
- Install memcache-fs (if you are under Memcached 1.4) or memcached-fs (if you are under Memcached 1.6), and
- Mount the memcache(d) FUSE filesystem on /var/cache/fusionpbx.
You will get the best of both worlds:
- You can outsource the Memcached (by default is localhost),
- No I/O at all,
- Auto-expiring objects (all nodes will get the changes),
- Easy way to sync all the servers by triggering a flush cache from the UI, and
- You can see the cached content.
Good luck!

- Details
- Category: Technology
A multi-home server is a server that has more than one interface and each interface is capable of routing. This sounds very exciting, especially if you are into low-budget high-availability. As sexy as it sounds, multi-homed systems are not as easy and transparent to configure.
Where is the catch? In Linux, multi-homed routers are possible, however, it is not what people think. Most may think a packet entered through eth0 will go out through the same interface. This is a false assumption. Each time a packet enters the interface, it is evaluated against rules and routing tables, and each time a packet (even from the same connection) is going out, it is re-evaluated against rules and routing tables.
That is the way it is. So here is how I did it on a RHEL
Ah, I forgot, in my example:
- ens18 faces the LAN,
- ens19 faces one ISP, and
- ens20 faces to another ISP.
- Details
- Category: Technology
The LCR for FusionPBX is an in-app for FusionPBX/CoolPBX that will allow you to not only add fault tolerance in your termination routes (outgoing calls) but to prioritize the routing (usually by cost). This software is not open-source yet, there is a campaign for that purpose.

- Details
- Category: Technology
STUN is used in several different network implementations, one of which is VoIP. The most common use case for STUN is to discover clients' public IPs behind a NAT. It is also useful to punch a pinhole behind a NAT and let incoming UDP traffic come.
As a PHP coder, I needed to find a PHP library to handle the STUN easily. I found this class, I am just documenting it here for convenience.

- Details
- Category: Technology
As I am stripping out specific PostgreSQL functions from CoolPBX, one of the things I found is using the field timestamptz. This kind of field saves a timestamp in ISO 8601 format, which stores the date, time stamp and timezone.
Sadly, SQLite and MySQL/MariaDB lack this. But who needs this if we have Unix time.