Anyone had recent experiance with getting Asterisk and FreePBX going?
I was hoping someone may have the magic bullet for this one because I'm at a loss of what to do.
I'm currently following the guide provided at
It's all going well up until I try to install FreePBX, then the system starts spitting errors out left and right. The biggest issue I'm having is that my asterisk database dosen't appear to be connecting.
FATAL ERROR DB Error: connect failed Trace Back /var/www/html/admin/libraries/db_connect.php:71 die_freepbx() : DB Error: connect failed /var/www/html/admin/bootstrap.php:85 require_once() : /var/www/html/admin/libraries/db_connect.php /etc/freepbx.conf:9 require_once() : /var/www/html/admin/bootstrap.php /var/www/html/admin/config.php:99 include_once() : /etc/freepbx.conf
I tried to reload the AMPORTAL to see if maybe it just needed the configurations reset, but then I got this.
[email protected]:/var/www/html# amportal restart Fetching FreePBX settings with gen_amp_conf.php.. /usr/local/sbin/amportal: line 49: [FATAL]: command not found /var/lib/asterisk/bin/freepbx_engine: line 98: [FATAL]: command not found **** WARNING: ERROR IN CONFIGURATION **** astrundir in '/etc/asterisk' is set to but the directory does not exists. Attempting to create it with: 'mkdir -p ' mkdir: missing operand Try `mkdir --help' for more information. **** ERROR: COULD NOT CREATE **** Attempt to execute 'mkdir -p ' failed with an exit code of 1 You must create this directory and the try again. [email protected]:/var/www/html#
It seems to be referencing a non existent directory, but I can't figure out what it wants or where it's getting it's information from.
Has anyone had any experience with this who could help me figure this out?
Thanks for replying. I really have no idea. I have a very baseline understanding of all of this. One of the reasons I was wanting to build this is because I wanted to learn more about running this on a real server. Up to now I had been running a prebuilt virtual machine where the base OS (CentOS), FreePBX, and Asterisk was already installed and configured so you just had to setup trunks, users, and extensions. I'm pretty knowledgeable about it once it's up and running but getting it to that point is something I've never done myself before.
I'm thinking I'm missing something in the guide provided by linode or something has been upgraded in 12.04 since the guide was written.
Can you give me some pointers on exactly what locations, files, and variables I should be looking at?
I've got a full FreePBX 14 Distro (lastest Sangoma offers on the website) going, with full OpenVPN, ext to ext video calling, TLS, SRTP and cross platform compatibility. All calls in and out of the PBX work as well. How may I help you?
For starters, you'd be better off using the default FreePBX pre-packaged distro with CentOS 7. (amportal) is no longer used. The command is (fwconsole) without the ().
@kryptosis Do you have basic instructions on how you completed this. I am having to move FreePBX Distro from in-house to another facility and would like to use commercial modules from the Distro.
It has been about a 3 year long process but I'll try to compress what I've learned into this doc. My setup may not be like yours so different hardware requirements aside, your mileage may vary. My linode started as a nano and ran fine but I went to the 2gb after PoC (proof of concept) was completed because I'm greedy and want more memory/storage space and transfer. I first set this server up on manager.linode.com not the new 'cloud' one so if you have a specific question I'll guide you best I can.
This project began as an experiment just to see if I could get it running on a linode since my dev buddies were telling me it absolutely couldn't/shouldn't be done. So after assuring the dev buddies that we can still be friends and guiding them on how to kindly f^ck off, I got to work.
I noticed after a few months of tinkering with it that there is some proprietary '11 herbs and spices' that linode uses for their virtualization platform which might make freepbx deployment difficult, mainly the block storage and their linode imaging/backup methods that don't like to be run on a "RAW" (non-linode managed) filesystem, rather they seem to prefer handling kernel settings, block allocations, kernel helpers and so on. None of the stack scripts did any good, often not working properly so I built my FreePBX from scratch
So my server is running Sangoma 7 with FreePBX 14.0.11 (soon to be 15, god willing) plus a nice KDE X GUI on top of the CentOS7 core that looks pretty great while running GLISH (if i initiate GUI running startx in console). Everything is legit and activated thru Sangoma. Sysadmin and all commercial modules I use are also running flawlessly. Backups are done via direct FTP connection to a NAS at my home office server. Restore is done in reverse, essentially by inflating backups via the FreePBX GUI. I can reinstall a fresh FreePBX 14/15, run the restore function and be operational within minutes, not days.
MY END USER SETUP:
All my extensions use either GS (grandstream) Wave on Android (4.0+) or MicroSIP for Windows. Both programs can talk to each other thru either Video or Audio using Legacy SIP (Not pjsip). Outbound and Inbound PSTN calling works great thru SIPSTATION. For Video I use H.264 because it's supported by all my client software packages. Audio uses uLaw then aLaw, gsm, and so on. When setting up your software clients, you need to make sure your bit rates match between client and server. I also recommend the use of Google's STUN servers and NO NAT. I have two hardware clients. One is an ATA adapter linked to a chan_sip extension that terminates to a fax machine, the other is a refurb Cisco Telepresence system I was able to acquire for FREE99 from a client that was upgrading to latest/greatest. Only thing wrong was a bad/sticky tracking camera motor.
Enough of that, here's the meat of her.
LINODE ASTERISK FREEPBX BASICS
To start, your linode has to be configured for Direct Disk Boot Kernel ONLY. Even if it does work for a while on a different kernel, it'll kernel panic horribly eventually when you install modules (or insult it's mother or whatever). Use ONLY FULL VIRTUALIZATION (not paravirt cause we're doing weird things lol), NO INITRD and DEFAULT run level. Enable ALL kernel helpers EXCEPT 'Auto-configure Networking'. This needs to be the only one that is disabled. Reason being is simple. FreePBX handles all routes you give it. No need for more bounces with the linode manager messing with the network stack. It does really weird things to the routes that asterisk don't like at all.
For Block Device Assignments, SDA (boot) is my "FreePBX Server image" and SDB is my "512MB Swap". Under Linode, it sees the filesystem as raw because FreePBX setup handles partitioning inside so-called 'SDA disk'.
To install freepbx, I used finnix recovery to download and install the package via GLISH. At one point, I believe I was able to mount the full ISO from sangoma and boot eventually as well but as of this writing I cannot locate the guide I wrote to do it. Keep in mind: The version you run currently (Freepbx 11,12,13,14) needs to match one installed on the linode. If they don't match, your restore (if it completes) will be a mess once it reboots.
Once it is installed and operational, you will be able to bind the linode ip to your DNS name thru your DNS manager. Next, you'll want to login to sangoma management to remove the deployment id so you may obtain a new one. This will allow your to use Commercial Modules. The very first one I recommend buying is Sysadmin Pro which has the VPN server plus a whole bunch of little features that just make it so much easier to manage. Generate your certificates ONLY after activation and success with DNS testing, to minimize headaches. After enabling HTTPS, I recommend setting your HTTP to 8080 (leave Let's Encrypt at 80) and leaving all HTTPS default, so as to auto connect to https management.
I'm also offering a live demo to anyone who wants.. You can email me at email@example.com for further assistance and to request a consult. Free 30 minute consultations via telephone/webex are available!
EDIT: Added preface, more formatting and some ramblings, will be adding links to pictures of setup soon -060219KT