These last days of 2020 I have spent hours patching the "soon-to-be" FusionPBX 4.6. One of the things I don't like is the way the cache engine is designed. Since FusionPBX 4.4, there are two ways of doing cache:
I will first talk about how they are now (Dec 30th, 2020) and what my published pull request will fix and enhance.
Available in FusionPBX 4.4 and turned on by default, the file system cache engine writes all its information in the directory specified by the default setting cache - location - text; by default, it points to /var/cache/fusionpbx. Personally, I have never liked the way it is at this point:
Nowadays, hard disks are pretty fast, but they will never be as fast as RAM.
My pull request adds the following:
At this very moment, all the files are stored with the key as a file name. There is no way to specify somehow the expiration timestamp. My solution is simple, by adding a numeric extension with the unixtime (aka epoch time) of when that given object will expire. If an object with the key 'directory:100@mydomain' is created with an expiration date of January 27th, 2021 07:49:00, then the file This email address is being protected from spambots. You need JavaScript enabled to view it. will be created. Let's pretend the following actions:
If you are familiar with my pull requests, you will find a PR that fixes the Azure STT voicemail. The issue here is that because the current file cache engine lacks an expiration mechanism, the authorization token from Azure will expire and the LUA code won't be able to make a difference if it should reuse it or not. If you must use Azure STT, you can use this patch or switch to Memcached.
At this very moment, the PHP and LUA code in FusionPBX connects to the FreeSWITCH event socket and pushes Memcache commands through it. In my opinion, this has a lot of limitations, for starters:
My pull request adds the following:
Please report to me any bug regarding this, I will gladly fix it as soon as possible.
Happy VoIP and good luck!
blog comments powered by DisqusAbout
Read about IT, Migration, Business, Money, Marketing and other subjects.
Some subjects: FusionPBX, FreeSWITCH, Linux, Security, Canada, Cryptocurrency, Trading.