Asterisk and FreePBX for a Small Office: Setup and Pitfalls
Advanced4 minInnovialabs editorial team
In short
FreePBX on Asterisk gives an office a flexible phone system with no per-user fees, but it needs an admin, correct NAT settings and strict protection against SIP attacks; without an admin, a cloud PBX is the safer choice.
In short: should you run your own PBX
Asterisk is an open-source telephony engine, and FreePBX is a web interface on top of it. Together they give you extensions, IVR, queues, call recording and integrations with no per-user fee. The price of that freedom is administration: updates, monitoring and security. If nobody in the office looks after it, a cloud PBX is usually safer.
Installation options
- The official FreePBX distro or install script is the fastest path: OS, Asterisk and modules come in matching versions.
- FreePBX installed manually on Linux gives more control but a higher risk of version mismatches.
- Plain Asterisk with config files is for experienced admins: maximum flexibility, but everything lives in text files and the dialplan.
- A hosted VPS or an on-site server: a VPS suits remote staff, while an on-site server makes sense with analog lines or strict rules on where recordings are stored.
For 10 to 50 extensions, a modest server or VM is enough. Recording every call, codec transcoding and conferences need more resources.
SIP trunks
A trunk is the connection to your carrier that carries external calls. Configure it with PJSIP: the legacy chan_sip driver is no longer supported in current Asterisk versions.
When connecting a trunk, check:
- The carrier's auth method: registration with username/password or IP-based trust.
- Number formats for inbound and outbound calls (with or without country code).
- Supported codecs, so you avoid unnecessary transcoding.
- NAT settings: external address, local networks and the RTP port range on your firewall.
"The call connects but there is no audio" or "audio only one way" is almost always a NAT and RTP problem.
asterisk -rvvv
pjsip show registrations
pjsip show endpoints
These commands show whether the trunk is registered and which phones are online.
Extensions, IVR and queues
- Extensions: plan a numbering scheme up front (for example, departments by hundreds) and use long random secrets for every extension.
- IVR: keep menus short, 3 to 4 options plus a way to reach a person. Record greetings at a calm pace.
- Queues and Ring Groups: a queue suits sales or support with hold music and stats; a ring group is for simple "ring everyone".
- Time Conditions: separate business hours from after hours, or night calls will land in an empty queue.
Call recording
Recordings fill disks fast. Decide in advance:
- how long to keep recordings and who can access them;
- where to move older files: a NAS, object storage or your CRM;
- how to notify callers about recording in line with local law.
Set up automatic cleanup or archiving, or one day a full disk will stop the PBX.
Protecting against SIP fraud
A compromised PBX can place many expensive international calls overnight on your account. The minimum set of measures:
- Do not expose SIP to the whole internet: allow only your carrier's IPs and use VPN for remote staff.
- Strong secrets for every extension, never matching the extension number.
- Fail2ban or the FreePBX Responsive Firewall to block brute force.
- Restrict outbound routes: block international destinations you do not need, or protect them with a PIN.
- Carrier-side limits on balance and concurrent calls.
- Regular updates of Asterisk, FreePBX and modules.
When a cloud PBX is wiser
- There is no admin and no budget for ongoing support.
- Staff mostly work remotely.
- You need availability guarantees without your own standby server.
- You have few extensions and no complex call routing.
Your own PBX wins when you need deep CRM integrations, custom call logic, full control over recordings or many users.