PBX · FreePBX 16/17
Add a DIDHub SIP trunk in FreePBX (pjsip)
FreePBX 16+ uses pjsip as the default SIP driver. This tutorial creates a registration-mode trunk to DIDHub with inbound and outbound routes for a single DID.
Step 1: Create the trunk
Connectivity → Trunks → Add Trunk → pjsip.
| Field | Value |
|---|---|
| Trunk Name | didhub |
| Outbound CallerID | +15551234567 |
| SIP Server | sip.didhub.io |
| SIP Server Port | 5060 |
| Username | trunk_xxxxx (from DIDHub dashboard) |
| Secret | <auto-generated> |
| Authentication | Outbound |
| Registration | Send |
| Codecs | ulaw, alaw, opus (in this order) |
| DTMF Mode | RFC 4733 |
Step 2: Outbound route
Connectivity → Outbound Routes → Add.
Route Name : did-outbound Route CID : +15551234567 Trunk Sequence : didhub Dial Patterns : prepend: "+1" prefix: 1 match: NXXNXXXXXX prepend: "+" prefix: 011 match: .
Step 3: Inbound route
DID Number : 15551234567 Set Destination : Extension → 100 (your test extension)
Step 4: Verify registration via console
asterisk -rx "pjsip show registrations" # Expected output: <Registration/ServerURI..............................> <Auth..........> <Status.......> ========================================================================================== didhub/sip:[email protected] trunk_xxxxx Registered
Step 5: Test outbound
asterisk -rx "channel originate Local/15557654321@from-internal application Echo"
Common pitfalls
- Status:
Rejected: open UDP/5060 outbound; some default firewalls block sustained SIP egress. - One-way audio: set
External IPin pjsip Settings if your FreePBX is behind NAT, and confirm the RTP port range is forwarded. - Registration flaps every 60 seconds: increase
Expirationto 300 in trunk advanced settings.
Ready to get a number?
Pick a DID in 130+ countries from $1.99/month. Activates instantly on most numbers.