FusionPBX is a multi-tenant PBX system based on FreeSwitch.
I thought it might be interesting to look at the dialplan source code to find out how someone had built a working system using FreeSwitch (whose documentation is poor, to put it mildly).
Note: The following instructions are not yet complete - they do not yet result in a working FusionPBX installation.
I had expected that the instructions for downloading and installing it on Debian would have the same expectation that systemd is installed as FreeSwitch itself does, however somewhat to my surprise the FusionPBX installer build FreeSwitch from source instead of installing it as a package.
The result appears to work, as you get to see the FreeSwitch CLI "logo" shortly before the end of the FusionPBX installation.
However, there are in fact problems which do not get reported by the installer.
The main reason turns out to be that the file /usr/src/fusionpbx-install.sh/debian/resources/environment.sh identifies the Debian release name (eg: "stretch", "buster" and "bullseye") and various further scripts then use this text information to install things such as PHP and FreeSwitch.
The problem is that if the output of lsb_release -cs doesn't match any of these names, some things either don't get installed at all (eg: PHP) or else get mis-configured (eg: nginx is told to expect to use php8.1 files, even though PHP itself hasn't been installed at any version whatsoever).
No error message is generated if the release name found on the system does not match one of the expected values.
The solution is to:
Amended instructions are (see below for a script to do all this for you):
[ "$os_codename" = "ascii" ] && os_codename=stretch [ "$os_codename" = "beowulf" ] && os_codename=buster [ "$os_codename" = "chimaera" ] && os_codename=bullseye
Section: misc Priority: optional Standards-Version: 3.9.2 Package: systemd-tmpfiles Description: something to allow PHP 8.1 to install
The following script will perform all the above steps:
#!/bin/bash # Download the FusionPBX installer, modify it so that it works, then execute it wget https://raw.githubusercontent.com/fusionpbx/fusionpbx-install.sh/master/debian/pre-install.sh chmod +x pre-install.sh ./pre-install.sh aptitude -y install equivs echo -e "Section: misc\nPriority: optional\nStandards-Version: 3.9.2\n\nPackage: systemd-tmpfiles\nDescription: something to allow PHP 8.1 to install" >systemd-tmpfiles equivs-build systemd-tmpfiles dpkg -i systemd-tmpfiles_1.0_all.deb cd /usr/src/fusionpbx-install.sh/debian grep -q beowulf resources/environment.sh || sed -i 's/#cpu details/[ "$os_codename" = "ascii" ] \&\& os_codename=stretch\n[ "$os_codename" = "beowulf" ] \&\& os_codename=buster\n[ "$os_codename" = "chimaera" ] \&\& os_codename=bullseye\n\n#cpu details/' resources/environment.sh sed -i 's#/usr/bin/fs_cli#/bin/fs_cli#' resources/switch/source-master.sh sed -i 's/`lsb_release -sc`/$os_codename/; s/$(lsb_release -sc)/$os_codename/' `grep -rl lsb_release .` sed -i "s/sh -c '//; s/php.list'/php.list/" resources/php.sh resources/upgrade/php.sh sed -i 's#/usr/bin/##' `grep -lr /usr/bin/ resources` ./install.sh
20 minutes and 27 thousand lines of output later, and you still get a 502 Bad Gateway error in your browser (but at least PHP is now installed).
Go up
Return to main index.