IT-LINUXMAKER, OpenSource, Tutorials

Configuring your own telephone system with FreePBX

From this point on, the configuration is carried out regardless of whether a Raspberry Pi was previously used as the computer for the VoIP server as described or whether you installed FreePBX on a bare metal server or a VM (virtual machine) using the available installation image.

If your Asterisk is behind your firewall in a private network, you should be aware of Nat-Sipping on your router. If it's on the internet, you should definitely install a firewall such as iptables or the easier-to-use UFW under Debian/Ubuntu Linux on the host. Alternatively, you can later install the "System Firewall" module of an integrated firewall from Sangoma Technologies Corporation in the FreePBX administration interface. However, this currently only works with RHEL 6 and RHEL 7-compatible distributions, so it would be pointless on a Debian-based system like this one anyway. Therefore, the only option left is to configure your own firewall.

Description of the installation scenario

Our goal is to set up a telephone system on a Raspberry Pi—or any other option as a VM or separate bare metal host—behind our router with a firewall, instead of the typical black-box solutions with Speedport, Xyxel, and Fritzbox devices used by telephone providers. This graphic serves this purpose.

We assume that our provider provides us with three public phone numbers (trunks) and that we can register with the telephony provider via our router using NAT sipping. Don't worry, Asterisk does this for us; we just set it up. VoIP-enabled phones (Snom, OpenStage, softphone) are connected to the Asterisk PBX. Ideally, a separate phone for each phone number is required, although phones like the Snom D385 can also handle multiple identities and thus multiple phone numbers.

If you are unable to install NAT sipping/NAT helpers because your router doesn't allow it, sensible alternatives would be to host Asterisk/FreePBX on an external server (e.g., HetznerOnline) or in a cloud, or to use STUN/TURN servers. STUN helps clients detect their public IP and open ports through NAT, and TURN provides relay services.
However, this scenario is not covered in this how-to.

  • First, we set up the basic installation of our telephone system directly after installing FreePBX.
  • The second step is to set up the trunks to communicate with the telephone provider.
  • And so that Asterisk knows how to handle outgoing calls, outbound routes are needed.
  • We then provide the extensions for our end devices.
  • And to know how incoming calls should be handled, we need the inbound routes.

IT-LINUXMAKER, OpenSource, IT-Support, IT-Consulting

© IT-LINUXMAKER 2025