All articles
12 August 2026 VoxioTelecom Team

FreePBX SIP Trunk Setup Guide

Configure a VoxioTelecom SIP trunk in FreePBX step by step: chan_pjsip settings, firewall and RTP, outbound routes with Premium CLI tech prefixes, inbound DIDs, caller ID and troubleshooting.

Cover illustration for the article: FreePBX SIP Trunk Setup Guide

FreePBX is the most common PBX we see on the other end of a VoxioTelecom trunk. This guide walks through a complete, working setup: creating the trunk in your portal, configuring a chan_pjsip trunk in FreePBX, writing outbound routes (including Premium CLI tech prefixes), handling inbound DIDs, and fixing the handful of issues that account for almost every failed first call.

Tested on FreePBX 16 and 17 with Asterisk 18/20. The screens differ slightly between versions, but the field names are the same.

1. Create the trunk in the VoxioTelecom portal

Sign in and go to Portal → SIP Trunks → New trunk. You choose between two authentication modes:

ModeBest forNotes
IP whitelistPBX with a static public IPNo registration; we authenticate by source IP. Up to 10 IPs or CIDR blocks per trunk.
Username / passwordPBX behind NAT or dynamic IPSIP digest auth, registration expiry 3600s.

If your FreePBX box has a static public IP, use IP authentication — it is simpler and removes registration as a failure mode. Otherwise use username/password. Credentials stay visible in the portal after creation, and you can rotate the password at any time.

Note the connection details you will need:

  • SIP host / registrar: sip.voxiotelecom.com
  • Port: 5060 UDP/TCP, 5061 TLS
  • RTP: 10000-20000/UDP
  • Codecs: alaw, ulaw, g729
  • DTMF: RFC 2833

2. Open the firewall

Before touching FreePBX, make sure the server can actually talk to us. On the PBX firewall (and any upstream NAT device), allow:

  • UDP/TCP 5060 to and from sip.voxiotelecom.com
  • UDP 10000-20000 both directions for RTP

In FreePBX → Connectivity → Firewall, add our signalling host to the Trusted zone if the integrated firewall is enabled. A one-way media hole is the single most common cause of "call connects but no audio".

3. Create the trunk in FreePBX

Go to Connectivity → Trunks → Add Trunk → Add SIP (chan_pjsip) Trunk.

General tab

  • Trunk Name: voxio
  • Outbound CallerID: your E.164 number without +, e.g. 493090182000. Leave blank if you set CLI per extension or per route.
  • Maximum Channels: set to your contracted capacity, or leave 0 for unlimited.

pjsip Settings → General

FieldValue
Usernameyour SIP trunk user (leave blank for IP auth)
Secretyour SIP trunk password (leave blank for IP auth)
AuthenticationOutbound (or None for IP auth)
RegistrationSend (or None for IP auth)
SIP Serversip.voxiotelecom.com
SIP Server Port5060
Transport0.0.0.0-udp
Contextfrom-trunk

pjsip Settings → Advanced

FieldValue
From Domainsip.voxiotelecom.com
DTMF ModeRFC 4733 (RFC 2833)
Direct MediaNo
Qualify Frequency60
Codecsalaw, ulaw, g729 only — disable the rest

Set Direct Media to No. With direct media enabled, Asterisk tries to bridge RTP endpoint-to-endpoint and audio breaks as soon as one leg is behind NAT.

Click Submit, then Apply Config.

The equivalent raw pjsip.conf

If you prefer to read the resulting config, this is what FreePBX generates:

[voxio]
type=endpoint
transport=transport-udp
context=from-trunk
disallow=all
allow=alaw,ulaw,g729
outbound_auth=voxio-auth
aors=voxio-aor
from_user=YOUR_SIP_USER
from_domain=sip.voxiotelecom.com
direct_media=no
dtmf_mode=rfc4733

[voxio-auth]
type=auth
auth_type=userpass
username=YOUR_SIP_USER
password=YOUR_SIP_PASSWORD

[voxio-aor]
type=aor
contact=sip:sip.voxiotelecom.com:5060
qualify_frequency=60

4. Verify the trunk is up

From the Asterisk CLI:

asterisk -rx "pjsip show endpoints"
asterisk -rx "pjsip show registrations"

The endpoint should show Avail and, for registered trunks, the registration state should be Registered. If it shows Unavailable, the problem is almost always firewall or a typo in the SIP server field — not credentials.

5. Outbound routes and number format

We expect E.164 without the leading +:

  • 4930901820 → Germany, Berlin
  • 12125551234 → USA, New York
  • 18005551234 → USA Toll-Free

Go to Connectivity → Outbound Routes → Add Outbound Route.

Standard route

  • Route Name: voxio-out
  • Trunk Sequence: voxio
  • Dial Patterns:
    • prefix +, match X. — strips the plus that most clients send
    • match X. — catch-all for everything else

That is enough for standard termination.

Premium CLI routes (tech prefix)

Premium routes are selected with a tech prefix in front of the destination — same trunk, same credentials, only the dialled string changes:

DestinationPrefixExample dialled string
Germany Premium CLI11121112 + 4930901820
Netherlands Premium CLI111111 + 31201234567
Standard routenone4930901820

The cleanest way to do this in FreePBX is a second outbound route placed above the standard one:

  • Route Name: voxio-premium-de
  • Trunk Sequence: voxio
  • Dial Pattern: match 49X., prepend 1112

Now anything a user dials starting with 49 leaves your PBX as 1112 + the number and lands on the Premium CLI route, while the rest falls through to the standard route below. Repeat the pattern per country you want on Premium. Your rate deck in the portal lists every premium prefix explicitly, so check it before adding prepends.

Route order matters: FreePBX evaluates outbound routes top to bottom and uses the first pattern match.

6. Caller ID: what we do and do not touch

We never rewrite your caller ID. Whatever you present is what the terminating carrier sees — which also means that if you send nothing, or send a display name instead of a number, the call arrives with no CLI or gets rejected outright.

Rules that make this work reliably:

  1. Put E.164 digits only in the From header user part — no display name, no spaces.
  2. Repeat the same number in P-Asserted-Identity where possible.
  3. In FreePBX, set Outbound CallerID on the trunk, and optionally per extension or per outbound route. The most specific setting wins unless you tick Force Trunk CallerID.

A correct INVITE looks like this:

From: <sip:493090182000@sip.voxiotelecom.com>;tag=a1b2
P-Asserted-Identity: <sip:493090182000@sip.voxiotelecom.com>
To: <sip:4915112345678@sip.voxiotelecom.com>

In the portal, Portal → SIP Trunks also lets you pick a caller ID mode per trunk: pass-through (default, we forward what you send), fixed (we always present one number), or hidden.

7. Inbound DIDs

If you bought a number from us, point it at your PBX like this:

  1. In Connectivity → Inbound Routes → Add Inbound Route, set DID Number to the number in the same format we deliver it (E.164 without +).
  2. Set the Destination to an extension, ring group, IVR or queue.
  3. Make sure your trunk's Context is from-trunk; otherwise inbound calls hit the wrong dialplan context and get rejected with "no matching extension".

If inbound calls never arrive, check pjsip set logger on and place a test call — if you see no INVITE at all, the issue is upstream routing or firewall, not FreePBX.

8. Test call and troubleshooting

Place a test call, then look at the SIP trace:

asterisk -rvvv
pjsip set logger on

The most frequent problems, in the order we see them on support tickets:

SymptomUsual cause
403 ForbiddenSource IP not whitelisted, or wrong SIP username/password
404 Not Found / 503Number not in E.164, or a leading + was not stripped in the dial pattern
Call connects, no audioRTP 10000-20000 blocked, or Direct Media left enabled
DTMF ignored by IVRsDTMF mode not set to RFC 4733/2833
Call arrives with no caller IDDisplay name sent instead of a number, or empty Outbound CallerID
Wrong rate chargedPremium tech prefix missing, or prepend applied on the wrong route

Billing is per second on most destinations and 6/6 on NANP; every call appears in Portal → Call History within seconds, with the SIP user, destination, duration and cost, so you can confirm a test call was rated the way you expected.

9. Production checklist

  • Static public IP whitelisted, or registration confirmed as Registered
  • Firewall open for 5060 and 10000-20000 in both directions
  • Codecs limited to alaw/ulaw/g729
  • Direct Media off, DTMF RFC 4733
  • Outbound routes ordered: premium prefixes first, catch-all last
  • Outbound CallerID set to a valid E.164 number you are authorised to use
  • Auto top-up configured so the balance never blocks live traffic

Once that is in place, switching routes or adding Premium CLI destinations is just another outbound route — no changes to the trunk itself.

Need a hand? Open a ticket in Portal → Support or email office@voxiotelecom.com; our NOC is staffed 24/7 and can read the SIP trace from our side while you place a test call.

Frequently asked questions

Should I use chan_pjsip or the legacy chan_sip driver? Use chan_pjsip. chan_sip is deprecated and removed in Asterisk 21; all settings in this guide assume pjsip.

Do I need to register the trunk? Only if your PBX has a dynamic IP. With a static public IP, whitelist it in the portal and set Registration to None — fewer moving parts and no re-registration gaps.

Why is my call rated on the standard route instead of Premium CLI? The tech prefix was not sent. Check that the premium outbound route sits above the catch-all route and that the prepend value matches the prefix in your rate deck.

Can I use the same trunk for inbound DIDs and outbound calls? Yes. One trunk carries both directions; inbound calls land in the from-trunk context and are matched by your inbound routes.

Which codecs should I enable? alaw, ulaw and g729. Disable everything else so negotiation is predictable and transcoding is avoided.

See the live rate deck

Create an account to browse the full A-Z deck in your portal — Premium CLI and Standard clearly labelled, searchable by prefix or destination.

Create account