How to Install FreePBX 15 on CentOS 7 with Asterisk 16

1 Comment

Here is an easy way to try FreePBX 15 on GCP: I took the instructions at »wiki.freepbx.org/display ··· CentOS+7 and assembled them into a script, adding modifications for GCP and automating all interactive steps.

The platform includes hardware firewall protection, snapshots, ease of creating / moving / destroying servers on demand, as well as many other management features.

Once you’ve signed up, go to »console.cloud.google.com .
Select Compute Engine -> VM instances.
Click Create Instance.
Choose a name, select zone; free options are us-east1 (South Carolina), us-central1 (Iowa) or us-west1 (Oregon).
If you’re not sure, check at »www.gcping.com/ (test takes about 30 seconds to run, actual ping time is ~12 ms less than HTTP time reported).
(Leave default Machine type for faster build — we will change to a free one later.)
Change Boot disk to CentOS 7, press Select.
Under Firewall, click Allow HTTP traffic. Click Create.
On the VM Instances page, under Connect, click SSH (need to click twice if blocking popups). A console window will open (takes ~30 seconds).
Paste the code below into the console window.

1
2
3
4
5
6
sudo -i
curl http://x-sc.com/fpbx14.sh > fpbx14.sh
chmod +x fpbx14.sh
./fpbx14.sh
 

When the script is done (about 20 minutes), “You have successfully installed FreePBX” should appear in green. If a minute goes by with no activity, it has probably stopped on an error.
Open the external IP address in your browser.
Set up admin account as requested, log in, set timezone, etc. Apply Config.
With luck, there will be no errors shown in the System Overview.

Go to Settings -> Asterisk SIP Settings. Click Detect Network Settings. The External Address field should populate. Click Submit then Apply Config.
In the cloud Console tab (not the SSH console window) go to VPC network -> Firewall rules, click Create Firewall Rule.
Give it a name e.g. sip. Under Target tags, type a tag name, e.g. sip.
Under Specified protocols and ports enter “udp:5060; udp:5160; udp:10000-20000” (without the quotes and assuming default FreePBX 15 settings). Under Source IP ranges, enter 0.0.0.0/0 (or a restricted range if desired), then click Save.
Go to VPC network -> External IP addresses. For your instance, change the Type from Ephemeral to Static. Give it a name, e.g. mypbx. Click RESERVE.
Go back to Compute Engine -> VM instances. Select your instance, click EDIT. Under Network tags add sip or whatever tag you chose above. Click Save.
Reboot (needed after network settings changes, also to confirm that automatic startups are working). You can reconnect to SSH server after one minute.
In the FreePBX 15 UI, configure an extension. Set up a VoIP device or app to use it.
Call *43, confirm that the echo test works and latency and quality are ok.
In the FreePBX UI, configure a trunk and an outbound route.
Confirm that you can make a call and that latency and quality are ok.
Restrict access to the FreePBX GUI. For example, remove the http-server tag and add a rule that only grants access to your PC.
Close the SSH console window.
In the Console, stop your instance. Go to Snapshots. Click CREATE SNAPSHOT.
Give your snapshot a suitable name, e.g. as-built. Under Source disk, select your instance’s boot disk. Click Create.
Edit your instance, change Machine type to micro (will become free if in qualifying zone), click Save.
Start your instance up again.
In the FreePBX 15 UI, go to Module Admin. Click Check Online, select desired Repositories, install modules as desired.
Configure FreePBX15 for your application.
Take another snapshot.
Enjoy.

I’m aware of two problems with this build:

1. It can’t send mail (such as voicemail notifications), because Google blocks outgoing ports 25, 465 and 587. My mail provider, Fastmail, has a proxy that avoids this issue. I’ll try some of Google’s suggested general purpose workarounds and will post an update if successful.

2. It crashes after configuring a Google Voice account. An apparently good motif.conf is created but Asterisk segfaults after reading it. I had the same problem with a FreePBX 13 / Asterisk 13 build. If you just install the FreePBX 15 module without an account (creating dummy motif.conf and xmpp.conf files) and reboot, Asterisk will read those and start running the respective modules. I have no idea what may be wrong and would appreciate it if a GV expert could take a look. Create a snapshot just before attempting to add a GV account.

About Me: I'm the digital marketing specialist, competent in SEO (Google, Yahoo & Bing), Google Adwords (Search, Display, Google Shopping etc.), Facebook & Instagram Advertising etc. I can work in all platforms of digital marketing & advertise the legitimate products/services in a specific country, city or all over the world. I am very confident, dynamic, energetic, enthusiastic & dedicated freelancer as I want to build my career as a full time professional freelancer for long time. I prefer quality work rather than quantity & hard working is my way to become successful. If you hire me, then I will provide you my best quality services for your project until you achieve your goal with complete satisfaction. Expertise I do have: ✓ Managed AdWords and PPC for diversity of companies with a budget up to $500,000 per annum. All campaigns with a positive ROI. ✓ Successfully increased organic (SEO) traffic for websites with 1,000,000+ unique visits every month. ✓ In-depth Google Analytics analysis (and other tools) to make appropriate suggestions and drive positive change. ✓ Easy to understand reports and full transparency on everything I do and everything your budget is spent on. Let's get started! Contact me to discuss your plans.

About us and this blog

We are a digital marketing company with a focus on helping our customers achieve great results across several key areas.

Request a free quote

We offer professional SEO services that help websites increase their organic search score drastically in order to compete for the highest rankings even when it comes to highly competitive keywords.

Subscribe to our newsletter!

More from our blog

See all posts

Leave a Comment