Vanilla chan_pjsip
No custom modules, no patches. Pure standards-compliant SIP.
Add DIDHub as a SIP trunk in Asterisk via chan_pjsip, full pjsip.conf and extensions.conf examples below. Works with Asterisk 18, 20, 21 and beyond.
Asterisk is the open-source telephony framework underneath FreePBX, Issabel, AsteriskNOW, and many commercial PBXs (FusionPBX, by contrast, is FreeSWITCH-based). DIDHub connects via the standard chan_pjsip driver, vanilla SIP, no custom modules. If you're running Asterisk directly without a GUI, this guide gives you the bare config you need.
Most direct-Asterisk users come to DIDHub for embedded telephony in software products (a SaaS that needs to make/receive calls), for AI voice agent infrastructure built on Asterisk + LLM stacks, or for in-house contact-center builds where a GUI like FreePBX would be more constraining than helpful.
chan_pjsip-based config. Five steps from a fresh Asterisk install to a working DIDHub trunk.
module show like pjsip, should list res_pjsip, chan_pjsip, res_pjsip_session loaded.
Add transport, endpoint, aor, auth, identify, registration sections (see config below).
Add a context that matches inbound DID and an outbound dialplan that uses the DIDHub endpoint.
asterisk -rx 'pjsip reload' and 'dialplan reload'. Check 'pjsip show registrations' for OK status.
Call into the DID; have the dialplan exec to a Playback or to a SIP/extension. Place an outbound through the DIDHub endpoint.
The exact trunk values DIDHub provisions for your account. Pre-fill these in the Asterisk trunk-config UI:
; pjsip.conf, DIDHub trunk endpoint [transport-tls] type=transport protocol=tls bind=0.0.0.0:5061 cert_file=/etc/asterisk/keys/your-cert.pem priv_key_file=/etc/asterisk/keys/your-key.pem [didhub] type=endpoint transport=transport-tls context=from-didhub disallow=all allow=ulaw,alaw,opus outbound_auth=didhub-auth aors=didhub from_user="didhub_xxxxxx" from_domain=sip.didhub.io media_encryption=sdes rtp_symmetric=yes force_rport=yes rewrite_contact=yes direct_media=no [didhub-auth] type=auth auth_type=userpass username="didhub_xxxxxx" password="(provisioned)" [didhub] type=aor contact=sip:sip.didhub.io:5061;transport=tls [didhub-reg] type=registration transport=transport-tls outbound_auth=didhub-auth server_uri=sip:sip.didhub.io:5061 client_uri=sip:[email protected]:5061 [identify-didhub] type=identify endpoint=didhub match=sip.didhub.io ; extensions.conf [from-didhub] exten => _X.,1,NoOp(Inbound DID: ${EXTEN}) exten => _X.,n,Dial(PJSIP/100,30) exten => _X.,n,Hangup() [from-internal] exten => _NXXXXXXXXX,1,Dial(PJSIP/${EXTEN}@didhub,60) exten => _NXXXXXXXXX,n,Hangup()
The pjsip endpoint uses outbound auth tied to your DIDHub-provisioned credentials. Replace didhub_xxxxxx with the username DIDHub provisions (visible in your DIDHub dashboard under Trunks). For TLS, you'll need a cert/key pair, DIDHub accepts standard public CAs.
No custom modules, no patches. Pure standards-compliant SIP.
Encrypted signaling and media via standard pjsip transport-tls + media_encryption=sdes.
All currently-supported Asterisk LTS lines work.
Asterisk Manager Interface and Asterisk REST Interface emit standard events for DIDHub trunks, wire to your monitoring.
AGI scripts and Stasis applications work normally for advanced dialplan logic.
DIDHub injects SHAKEN identity headers on US outbound; Asterisk's AddHeader can be used for compliance customization.
Asterisk 18 LTS, 20 LTS, or 21+. chan_pjsip is the only supported driver. chan_sip is removed in 21.
Technically yes for older Asterisk, but strongly discouraged. chan_sip lacks modern NAT handling, SRTP via DTLS, and is removed from Asterisk 21.
No. DIDHub handles NAT-traversal via standard SIP rport / Symmetric RTP. Asterisk behind NAT works fine, just set rtp_symmetric=yes, force_rport=yes, rewrite_contact=yes on the endpoint.
Multiple endpoint sections in pjsip.conf, one per country. Each has its own auth + aor + registration. The dialplan picks which endpoint to dial out via.
Yes. DIDHub speaks standard RFC SIP; any framework that integrates with chan_pjsip works.
FreePBX · FusionPBX · 3CX · Softphones
Connect 3CX to DIDHub as a SIP trunk provider. Full step-by-step config: trunk template, inbound rules, outbound caller ID, registration. Nu
DIDHub integrates with every major AI voice platform: Vapi, Retell AI, ElevenLabs Conversational AI, Bland AI, Synthflow, LiveKit Agents, Pi
Connect DIDHub SIP trunk to AssemblyAI Universal-Streaming + LeMUR for voice agents. STIR/SHAKEN A-attestation, regional ingress, 136-countr
Bland AI phone number integration via DIDHub SIP trunk. STIR/SHAKEN A-attestation for outbound campaigns, DID pool rotation, multi-country r
Pick a DID in 130+ countries from $1.99/month. Activates instantly on most numbers.