Bind a phone number to your Retell AI agent (inbound)
Retell AI supports BYOC SIP trunking. This tutorial provisions a DIDHub trunk, registers it with Retell, and routes a DID so your Retell agent answers real phone calls.
Step 1: Create a DIDHub SIP trunk
# Dashboard → SIP Trunks → New trunk Name : retell-prod Mode : SIP digest auth Username : retell_b7e2 Password : "<auto>" Region : us-east, us-west Inbound : enabled Outbound : enabled (for outbound campaigns)
Step 2: Register the trunk in Retell
curl -X POST https://api.retellai.com/create-phone-number \ -H "Authorization: Bearer $RETELL_API_KEY" \ -d '{ "phone_number": "+15551234567", "termination_uri": "sip:sip.didhub.io", "sip_trunk_auth_username": "retell_b7e2", "sip_trunk_auth_password": "<PASSWORD>", "inbound_agent_id": "agent_abc123" }'
Step 3: Bind in DIDHub
Numbers → +1 555 123 4567 → Routing → SIP Trunk: retell-prod. Save.
Step 4: Test inbound
Call the DID. Retell agent should pick up within 1 ring. Logs are visible in both Retell dashboard and DIDHub trunk monitor.
Common errors
- "trunk_auth_failed": username or password mismatch — copy from the DIDHub trunk detail page exactly.
- 404 on phone-number assignment: the DID must be active in DIDHub before Retell registration.
- Caller hears silence for 8 seconds then RTP arrives: set codec preference to PCMU first in the DIDHub trunk — Retell prefers G.711.
Outbound (optional)
curl -X POST https://api.retellai.com/create-phone-call \ -H "Authorization: Bearer $RETELL_API_KEY" \ -d '{ "from_number": "+15551234567", "to_number": "+15557654321", "agent_id": "agent_abc123" }'
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.