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:trunk_xxxxx@sip.didhub.io 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.
More tutorials
3CX SIP Trunk Setup with DIDHub
How to add a DIDHub SIP trunk in 3CX v18 / v20 using the generic SIP trunk template. DID inbound rule, outbound rule, and codec order includ
Asterisk pjsip Trunk to DIDHub
Minimal copy-pasteable pjsip.conf and extensions.conf for an Asterisk 18+ trunk registered to DIDHub with inbound + outbound routing.
Connect Vapi BYOC SIP Trunk to a DIDHub Phone Number
Step-by-step tutorial for Vapi BYOC: create a DIDHub SIP trunk, register it in Vapi, import a DID, and test inbound + outbound. Cuts Vapi te
SIP Trunk Failover Across DIDHub PoPs
Set up SIP trunk failover across DIDHub PoPs in 8 regions (US East/West, EU, MENA, India, APAC, ANZAC, LATAM, Africa) with DNS SRV, primary
Ready to get a number?
Pick a DID in 130+ countries from $1.99/month. Activates instantly on most numbers.