*** SERIOUS WARNING
*** HIGLY EXPERMANTAL STUFF HERE
*** LEAVE IMMEDIATELY IF YOU ARE UNWILLING TO GET YOUR HANDS DIRTY

Attention: This is the README file for the present RPM package, and its companion mudules RPMs. The README of the original FreePBX software is in the file README.original.FreePBX.
Before going on, please note the difference between the original FreePBX software, and this RPM packages which contain both code from the original FreePBX software, along with patches and other related files made by me.
I (the author of the RPM packages and the patches and related files) am not affiliated in any way with Sangoma Technologies or the original FreePBX team. For this reason the two entities should not be confused. Please don't bug Sangoma Technologies or the FreePBX forum for errors, questions, problems due only to my packages. If this distinction is clear, then we can go on.

First of all, a heartfelt thank to the whole FreePBX team and contributors: I think that over the years, they have actively contributed to make it possible to create functional and manageable software PBXs.
I myself have used it for years with great satisfaction: it is beautiful, functional, complete. Thank you.

That said, I'm here to try to address a small portion of FreePBX I do not like.

While being a great software piece, FreePBX has, in my opinion of a Linux sysadmin, some major disputable issues from the point of view of the installation and the interaction with the underlying system. FreePBX is distributed, installed and updated, in short it behaves in a way, just as if it was always the only important software on the system. This can be pretty comfortable for people who just want to have a working full-featured PBX. In this case, FreePBX takes over your Linux system and turns it into a magnificient, modern PBX system.

But this is simply not my case. I have running Linux systems, with email, file sharing, web services, DNS, FTP etc on it. I just want to add the PBX service, and it has to coexist with other applications, just like when I add the DHCP service to one of my systems. I can't run a batch installer which makes so profound changes to the system like the one provided with FreePBX. I still remember the first time I tried to install FreePBX years ago on a test server. Suddenly, the website and several virtual hosts it managed were no longer functional: that time, it was because FreePBX had changed the Apache User and Group for the whole server. It behaved exactly as if the PBX service was the only one that had to work on that Linux system. Simply, that was not my case, and it was not exactly the way I wanted a web frontend to behave on my systems.
As I looked further into it, I noticed that the permissions associated to the files of entire directories had been changed, without notifying what they previously were. A big mess, of which, among other things, no precise log was recorded for every single action done on the server. I had to restore the server from a backup of the day before, just to make sure no unnoticed changes remain. That was not a big deal, the machine was a test, but it gave me an idea, later confirmed many times, of the way FreePBX behaves on the underlying system.
Such behaviour, in my opinion, is appropriate for those accustomed to dealing with traditional PBXs, in which a single machine does just that, and therefore it is acceptable that FreePBX takes over the machine and turns it (I would rather say rape it:) according ruthlessly to its own targets.
On a machine that already runs a number of different services, and/or where you don't want to give up with SELinux, or where you simply want to know what is going on, such a behaviour can be unappropriate. In my opinion, it's much more desirable to distribute the software through the package manager, and to confine administrative activities in a way that is limited to known areas of competence of FreePBX. Nothing difficult: there are hundreds of modular web-based software: this can be done in a simple way.

Too bad, I must say, that the FreePBX team is not interested in making its software natively compatible with a package manager and with a rational management of its coexistence on a par with other software. Asked several times on the forum, both by me and by others over the years, the answers have always been rather evasive. It was cited the need for FreePBX to be able to self-update its modules. This would certainly not prevent a rational and tracked distribution of its updates themselves. Oh well the world isn't perfect, and I would like to emphasize this another time: FreePBX remains a great software, but distributed in a way that I, as a sysadmin, don't like.

The RPM packages I built represent an attempt, certainly not of a professional level and maybe quite unrealistic, to overcome these problems. For this reason they are to be considered an experimental product, of alpha level. And I fear that due to the nature of the problems described above, they will remain forever highly experimantal.  For example, it could easily happen that some new FreePBX update throws a new chown -R asterisk:asteisk /some/where. Such a behaviour, and the logic leading to its adoption, will have to be tracked and patched. Or it could easily happen that an entire new FreePBX feature will break everything tomorrow, leading to an in-depth review of these packages. So if you are looking to build a professional grade rugged PBX, I don't think these packages are for you, and probably they will never be. If you want a professional-grade PBX, the FreePBX distro can be a great solution: it does everything itself, it does that and only that, and I think it does it well.

If, on the other hand, you are a medium skilled admin who want to try to add the PBX service to your server that is already running for other reasons, you have no claims of absolute continuity of the service and you are not afraid of getting your hands dirty, I think that maybe you will find these packages interesting. For me, they have been the only acceptable way to use FreePBX for many years. For a few years I had committed to a v12. But today I'm newly starting from scratch on a CentOS 8. For this reason, it's also more likely that there will be problems, smaller or bigger I don't know now. It will be fun, at least generally it is.

Unilikely other FreePBX RPMs I found around over the past years, theese are not merely a packaging of the FreePBX installer, which upon install gets run and does all its mess all the same as without rpm.
In this case, I installed the original FreePBX on a test system, had a look at what the installer does (and the module updaters do, and what is done every time the config is saved and some hook is called) and tried to produce packages which clearly separate install time (distribution of files, chowning, chmodding etc) from runtime to make use of the RPM functionality and keep the system clean.

With these packages, module installation, updates etc. are done via rpm. I tried to remove what can be misleading with the web and cli interface, so for example you can not (apart from my mistakes and oversight) download and update modules from the web interface or via the fwconsole command: sw distribution is done via rpm. This effort is ongoing, there are certainly other things to remove because stock FreePBX tries hard to auto-update itself without the admin intervention, and/or without any package management.
Likewise, I tried to remove the major part of the wild chowns/chmods that are scattered around everywhere in the stock FreePBX. A small minimal set of these chowns is really needed and desirable (for example, when you run fwconsole ma install from root, config files are to be created as asterisk, so the web interface will be enabled to modify them). But what the stock FreePBX does in this case looks very indiscriminate to me, acting on all files without any attempt to keep changes as few as they are really needed. I don't like it and I remove all the unnecessary stuff, when I stumble on it. This effort is ongoing. You'll likely find something I did notice. Please feel free to drop me corrections and suggestions. They are very appreciated.
I removed the GPG code signing and verifying too. IMHO, it is useful and desirable ito have a cryptosign mechanism to verify that what you download on your machine is coherent with what the developer publighed. But there are limits to the number of chains we want to use to bind our own hands. I don't want something that continuously verifies and bugs me with warnings that my modules are tampered. I know it: I modified them. We're on Linux, no? If we're are not welcome to modify, hack, tinker the code, I just wonder why we should choose to use Linux at all. Because it costs no money? Neah. For these reasons, I removed the whole GPG class, and the references to it as long as I stumble on them. The code signing/verifying provided here is the one inside RPM. Obviously, you as the sysadmin are free to add other system integrity facilities, maybe integrated with your whole server, and not only in FreePBX.

A word about me: for any question, bug, patch, improvement, you can drop me an email. I'll be happy to reply back. Again, I work on my own, have a private life, so I can not guarantee any professional level in the results. Even this documentation is very far from being complete, and it somewhat requires to be familiar with Linux as a sysadmin. But I'll be happy to try to help, in a perfect free software fashion.

A word about the license: while the original FreePBX and its modules are mostly distributed by their respective owners under the GPL or other free license, for what regards my RPM packages, at least for now they are released for an exclusive non-profit use. They can only be used in non-commercial environments and cannot be used for any purpose that involves, directly or indirectly, making or receiving any payment in any form. The only exception, at least for now, is made for Sangoma Technologies and the FreePBX developer team itself (should they ever be so crazy to be interested in this effort). Just to be clear, I don't want to favor some commercial subjects who make money on free software, without ever giving anything back. If you're a commercial subject with interest in this effort, it will be enough to guarantee that your development is freely published and effectively made easily available in a complete, up-to-date source form as free software, to have an exemption too. If in doubt, you can drop me an email.

A final word: again, I would like to thank Sangoma Technologies and  all those who contributed to FreePBX in the past and in the present. While I don't like some details about how it is distributed and updated, FreePBX itself is great software: like Gnu, Linux, Asterisk among the others, it is big fortune that it's free.

Now, if you still want to go on with this experiment, you can continue with the INSTALL doc.

Luigi Iotti asterisk@iotti.biz
