Skip to content

Latest commit

 

History

History
190 lines (158 loc) · 10.7 KB

README.md

File metadata and controls

190 lines (158 loc) · 10.7 KB

Rasp Pi Rasp Pi OS Asterisk FreePBX

RasPBX

Installation of Asterisk and FreePBX GUI on Raspberry Pi

  • "Asterisk" is a PBX communication server
  • "FreePBX" is a front-end that exposes Asterisk functionality via a web-based GUI
  • "FreePBX Distro" (previously called "AsteriskNow") was a pre-configured bundle distribution of Asterisk/FreePBX system based on CentOS. But now discontinued.
  • "RaspPBX" is a pre-configured bundle distribution of Asterisk/FreePBX based on Raspbian Buster 10, Asterisk 16.13.0, and FreePBX 15.0.16.75. The latest version is from 2020-10-10, but is no longer supported.

So... this repository intends to document the process of creating an up-to-date Asterisk installation on a Raspberry Pi, based on latest releases as follows:

  • Asterisk 22 (2025-01-09)
  • FreePBX 17 (2024-08-02)
  • Rasp Pi OS, Debian 12 Bookworm (2024-11-19)

This guide is based on my own experience combined with snippets from various sources, primarily https://www.dslreports.com/forum/r30661088-PBX-FreePBX-for-the-Raspberry-Pi .

Installation

1.) Install Raspberry Pi OS (20mins)

Disk Imager

2.) Configure OS in Windows (2mins)

  • a.) Once the OS image is burned, the SD card should automically be mounted in Windows Explorer as a partition named "bootfs"
  • b.) Create an empty file in the bootfs root directory named "ssh"
  • c.) We need to create a pi:raspberry user to enable remote access, so create a text file named "userconf" in the bootfs root directory containing the following:
pi:$6$c70VpvPsVNCG0YR5$l5vWWLsLko9Kj65gcQ8qvMkuOoRkEagI90qi3F/Y7rm8eNYZHW8CY6BOIKwMH7a3YYzZYL90zf304cAHLFaZE0

(that's the hash of the "raspberry" password) BootFS

3.) Copy Installation script to Raspberry Pi (2mins)

  • a.) Insert the SD card into the Raspberry Pi (connected to your LAN via ethernet cable) and power on
  • b.) Use WinSCP to create an SFTP connection to:
host: raspberrypi.local
username: pi
password: raspberry
  • c.) Copy install and install.tar.gz from this repository to the /home/pi directory.

WinSCP

4.) FreePBX Installation: Phase 1 (2mins)

  • a.) Use PuTTY to create a SSH connection to:
host: raspberrypi.local
username: pi
password: raspberry
  • b.) Set executable permissions on the install script chmod +x install
  • c.) Run the install script sudo ./install

Putty

  • d.) When prompted...:
    • Set pi user password
    • Set root user password
    • Select FreePBX version
    • Select Asterisk version
    • Use Edge?
    • Disable IPv6 option? ('No' recommended)
  • e.) Review selections as follows:
FreePBX Version: 17.0   (c)
Asterisk Version: 22    (d)
Edge Enabled: Yes       (y)
IPv6 Enabled: Yes       (n)

5.) RaspPi OS Configuration (2mins)

  • a.) System Options->Set Hostname (1/S4) RasPBX
  • b.) Localisation Options->Locale (5/L1) en_GB.UTF-8
  • c.) Localisation Options->Timezone (5/L2) Europe - London
  • d.) Advanced Options->Expand Filesystem (6/A1)
  • e.) Finish/Reboot Now No

The Raspberry Pi will reboot, closing the connection to PuTTY. Rasp Pi OS

6.) FreePBX Installation: Phase 2 (5mins)

  • a.) Create a new PuTTY connection, using the new hostname and/or root credentials set in the previous steps (you may receive a message saying cached key is out-of-date - update it) e.g.
host: raspbx.local
username: root
password: raspberry
  • b.) Having connected successfully, FreePBX installation will continue automatically.

FreePBX Phase 2

The Raspberry Pi will reboot, closing the connection to PuTTY.

7.) FreePBX Installation: Phase 3 (30mins)

  • a.) Restart the PuTTY connection using the same root credentials as in the previous step (right click on the PuTTY menu bar and select "Restart Session")
host: raspbx.local
login as: root
root@raspbx.local's password: raspberry
  • b.) Confirm the selection made in 4d., as follows:
FreePBX Version: 17.0   (c)
Asterisk Version: 22    (d)
Edge Enabled: Yes       (y)
IPv6 Enabled: Yes       (n)

This step will take some time. Also, it does not appear to finish cleanly. My PuTTY connection timed out, with the following as the last message received:

Putty

The Raspberry Pi will reboot, closing the connection to PuTTY.

7.) FreePBX Installation: Phase 4 (2mins)

  • a.) Restart the PuTTY connection using the same root credentials as in the previous step for one last time (right click on the PuTTY menu bar and select "Restart Session")
host: raspbx.local
login as: root
root@raspbx.local's password: raspberry
  • b.) The FreePBX installation should continue as in previous steps, and will complete with the message FreePBX Installation Complete

Debugging

By default, Asterisk will run in the background. However, it can be useful to attach a remote console to the running process by calling the -r option. You can also specify a level of verbosity using the -v option.

  • a.) Use PuTTY to log in to the Raspbery Pi that is running Asterisk, as the root user.
  • b.) Issue the command asterisk -rvvv to connect a console to Asterisk

Asterisk -rvvv

FreePBX Configuration

8.) FreePBX Settings

  • a.) Log in to the web GUI in a browser by going to raspbx.local
  • b.) Assign an administrator account credentials. I'll choose asterisk, asterisk

FreePBX Administration

  • c.) Go to Asterisk - SIP Settings and click Detect Network Settings. Ensure that this fills in the Local Networks address (failure to do this will mean that any call will be cut-off after 30 seconds)

FreePBX NAT settings

- d.) **IMPORTANT** to save changes, click both the Submit button AND the Apply Config button!

9.) Create Extensions

An “extension” is the name for any destination on the Asterisk phone network – it defines the number that is dialled to call a physical telephone, a “virtual” software telephone, or access a “feature” service (like the speaking clock or an automated message line). Every number that you want players to be able to dial a number and have something happen needs to have an associated extension. To create a new extension associated with a telephone, perform the following steps:

  • a.) Go Connectivity->Extensions
  • b.) Add Extension + Add New SIP [chan_pjsip] Extension
  • c.) There are several options, but only three are required:
    • User Extension is the phone number that users will dial to call this extension
    • Display Name specifies the name associated with this extension within FreePBX, and will also be sent as CallerID for outgoing calls
    • Secret is the password used by devices that connect to this extension
User Extension: 1000
Display Name: Handset
Secret: 82f5d5f5e4410fc003bd4c120bb06b6c
  • d.) IMPORTANT to save changes, click both the Submit button AND the Apply Config button!

Connecting a Phone Handset to an Extension

To connect a regular analog phone to the network requires a VoIP phone adaptor. This section explains how to configure the Linksys PAP2T device to map the handset plugged into Line 1 to the extension created in the previous section. Note that if you use a different ATA your settings may differ slightly, but the general approach should remain the same.

  • a.) Open a web browser and navigate to the web interface for your ATA device.
  • b.) Log on to the management screen (click the Admin Login link at the top right of the page), and click on the Line 1 tab to configure the device plugged into Line 1.
  • c.) Change the following settings:
    • Proxy: This should be set to the static IP address assigned to your Raspberry Pi running Asterisk. E.g. 192.168.1.33.
    • Display Name: This should match the “Display Name” set in the FreePBX extension configuration in the previous section.
    • User ID: This should match the “User Extension” set in the FreePBX extension
    • Password: This should match the “Secret” set in the FreePBX extension

LinkSys Settings

Creating a Virtual Softphone

You can also make and receive calls using a software client mapped to an extension. I’m using the free program MicroSIP to simulate a VOIP phone on my PC.

  • a.) Download MicroSIP from https://www.microsip.org/
  • b.) Set up account information as follows:
    • Account Name: This should match the “Display Name” set in the FreePBX extension
    • SIP Server and SIP Proxy: These should both be set to the static IP address assigned to your Raspberry Pi running Asterisk. E.g. 192.168.1.33.
    • Username: This should match the “User Extension” set in the FreePBX extension
    • Domain: This should be set to localhost
    • Password: This should match the “Secret” set in the FreePBX extension

MicroSIP settings

As when setting up the ATA in the previous section, the Username and Password must match the Extension and Secret set up in Asterisk The SIP Server and SIP Proxy should be the IP address assigned to the Raspberry Pi that is running Asterisk. Domain should be set to “localhost”