Run a PBX on a Raspberry Pi with Twilio SIP Trunking
A Raspberry Pi with at least 4GB of memory, a USB keyboard, mouse, and HDMI-equipped monitor is needed to run the PBX. The 3CX software and a license key are also required. A Twilio account is necessary for SIP trunking, and optionally, one or more SIP phones can be used. The Raspberry Pi will host the 3CX PBX software, and before communicating with the outside world, port forwarding in the router needs to be configured for SIP and RTP traffic. The 3CX dynamic DNS service creates a custom domain, allowing phone calls from Twilio to find the home network. A unique Twilio SIP domain is created to associate inbound calls with the Twilio account. Phone numbers are added to the SIP trunk, and Direct Inward Dialing (DID) is configured to associate a phone number with an extension. A dial plan on the PBX directs outbound calls to the Twilio SIP trunk. Emergency calling needs to be enabled in both 3CX and Twilio. The PBX's security should be ensured by blocking IP addresses after multiple consecutive failed attempts and using Raspbian's recommended firewall tools. Secure SIP trunking is not currently supported by 3CX, but it can be made to work for inbound traffic only. Calls forwarded from the PBX to external numbers are limited in Twilio due to security restrictions.
Company
Twilio
Date published
Sept. 22, 2021
Author(s)
Robert Welbourn
Word count
5777
Language
English
Hacker News points
None found.