27 Jun

Configure Raspberry Pi Session Border Controller for 3CX

Following is a step by step guide to configure Raspberry Pi Session Border Controller for 3CX. If Noobs is not installed on your SD Card please see my post on installing Noobs.

Step 1: Install Raspbian OS

When you power up your Raspberry Pi for the first time you will see a window open up as shown below.

Select the first option, “Raspbian (RECOMMENDED)” and click install.

It can take 10-15 minutes for Raspbian to install. Once installed, the Raspberry Pi will reboot and you will then see the raspi-config window open up as shown below.

Step 2: Change the Default Password

Select 2 Change User Password then enter the new password at the prompt.

Step 3: Enable Boot to Desktop

Select 3 Enable Boot to Desktop then enable boot to desktop.

Step 4: Set Timezone

Select 4 Internationalisation Options and then select I2 Change Timezone and then Australia and save.

Step 5: Change the Hostname

Select 8 Advanced Options then A2 Hostname and enter a new hostname at the prompt and save.

Step 6: Enable SSH

Select 8 Advanced Options then A4 SSH and enable SSH.

Now select Finish on the main menu and select Yes to reboot.

Step 7: Change the Root Password

After the device has finished rebooting, Open up a terminal and type the following command:

sudo passwd root

Then enter a new password at the prompt.

Step 8: Update the Firmware

Install the firmware updater, run the following command (this only has to be done once per Pi. When the tool is installed you can use the rpi-update command to easily update your  Pi firmware).

sudo apt-get install rpi-update

Now to update the firmware on your raspberry pi use the following command:

sudo rpi-update

Once the update is complete you will need to reboot your Pi for the new firmware to take effect.

reboot -t now

Step 9: 3CX Install Session Border Controller

First, search for Raspberry Pi software updates using the following command

sudo apt-get udpate

Then add the 3CX Session Border Controller repository link to the sources list

echo “deb http://downloads.3cx.com/downloads/sbc /” >> /etc/apt/sources.list

Now add the digital signature key so that the software is recognised as coming from a trusted source

wget -O – http://downloads.3cx.com/downloads/sbc/public.key | apt-key add –

Now check for software updates again so that the 3cxsbc software is included

sudo apt-get update

Then install 3CX Session Border Controller

sudo apt-get install 3cxsbc

Now update all other Raspberry Pi software for which an update is available

sudo apt-get upgrade

Now the Session Border Controller has been installed and started automatically. We need to stop the 3CX Session Border Controller Services before configuring the software

service 3cxsbc stop

service rsyslog stop

Now it’s time to configure the 3CX Session Border Controller

nano /etc/3cxsbc.conf

3cxsbc.conf3

Change the Level to Level = NONE. This will stop SBC logging.

Enter the tunnel password. The tunnel password can be found in the 3CX Cloud Server. Go to the tenant and then go to Settings > Network > 3CX Tunnel.

Then enter the tunnel address. This is the external IP address of your 3CX Cloud Server. Now enter the tunnel port. This will relate to the tenant that this tunnel belongs to.

Eg..

Tunnel Port 5090 – Tenant 1

Tunnel Port 6090 – Tenant 2

Tunnel Port 7090 – Tenant 3

Now enter a name for the Tunnel. This name will be used in 3CX logs so if you have more than one RPi for this tenant use a name that will easily identify the RPi.

Enter the Pbx SIP IP – this is the internal IP address of your 3CX Cloud Server. Then enter the  SIP port for the tenant.

Eg..

SIP Port 5060 – Tenant 1

SIP Port 6060 – Tenant 2

SIP Port 7060 – Tenant 3

When finished hit Ctrl+X to exit the file. Then press Y to save and hit enter.

Run the following commands in order for your changes to take effect

service 3cxsbc restart

service rsyslog restart

Step 10: Put Your RPI on a Static IP Address.

This is important because if the address of your Session Border Controller changes your phone will not be able to register.

nano /etc/network/interfaces

Remove the contents of the file and add the following. Ensure that the static ip address you enter is on a range you are currently using otherwise you RPi will not have connectivity to the network.

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.220
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

The netmask and gateway can be found in your network settings on any machine connecting to the same network. These are site specific so please do not just copy the information above.

Ctrl +X exit the file and then Y to save, then press enter.

Now restart the networking service to put these changes into effect.

service networking restart

Now you can start configuring your phones in the network to register with the 3CX via the outbound proxy (the Raspberry Pi). Phones registering via the Pi need to communicate on port 5060 and the Raspberry Pi IP address should be used as the Registrar Server, The Proxy Server and the Outbound Proxy Server, in the telephone configuration.

One thought on “Configure Raspberry Pi Session Border Controller for 3CX

  1. Amanda Bartley

    Rapberry Pi default /etc/network/interfaces file

    auto lo

    iface lo inet loopback
    iface eth0 inet dhcp

    allow-hotplug wlan0
    iface wlan0 inet manual
    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
    iface default inet dhcp

    You can revert back to this if you are having issues putting the Pi on a Static IP address.

Comments are closed.