gphan.
03/29/2026, 2:43 AMAI Evy
03/29/2026, 2:43 AMAI Evy
03/29/2026, 2:43 AMAI Evy
03/29/2026, 2:43 AMAI Evy
03/29/2026, 2:43 AMsip:1700@[mysip].sip.twilio.com) is being routed back through the trunk, which treats 1700 as a PSTN number rather than an internal extension . This causes the 32009 error you're seeing.
## Supported Architecture
The recommended approach is to transfer the call back to your PBX via a dedicated DID or SIP trunk, then let the PBX route internally using IVR logic, language flags, or call context .
Specifically, your PBX needs to expose routing numbers (DIDs or equivalent) that map to specific extensions or queues . When the AI hands off the call, it's sent back to one of those numbers, and the PBX handles the internal routing .
## Alternative: Custom SIP Headers
If your PBX supports SIP headers, you can pass intent or language metadata and route dynamically . Retell supports adding custom SIP headers for outbound calls, which are forwarded to your SIP provider on the SIP INVITE and can be used for custom routing, tagging, or metadata .
## Why SIP INVITE Mode Doesn't Work
The sources don't provide specific details about why sip_invite mode isn't reaching Twilio in your case, but the fundamental issue remains: Retell cannot transfer directly to internal extensions . The transfer must go to a full PSTN number or a properly configured SIP entry point that your telephony provider recognizes.
## Recommended Solution
Configure your Twilio setup so that specific DIDs route to your extensions, then have Retell transfer to those fulAI Evy
03/29/2026, 2:44 AMgphan.
03/29/2026, 4:37 AMAI Evy
03/29/2026, 4:37 AMAI Evy
03/29/2026, 4:37 AMinbound_webhook_url on a Retell-owned number [(1) ]() . The webhook allows you to override agent ID, set dynamic variables, and configure other fields specific to that call . When configured, this webhook is triggered for inbound calls before routing to an agent .
You can set this via the Update Phone Number API with the inbound_webhook_url parameter :
javascript
inbound_webhook_url: "<https://example.com/inbound-webhook%22>
## Inbound Webhook Payload
When an inbound call arrives, the webhook receives information including the caller's number [(2) ]() :
{
"call_inbound": {
"agent_id": "agent_12345",
"from_number": "+12137771234",
"to_number": "+12137771235"
}
}AI Evy
03/29/2026, 4:37 AMAI Evy
03/29/2026, 4:37 AMAI Evy
03/29/2026, 4:37 AMgphan.
03/29/2026, 4:51 AMAI Evy
03/29/2026, 4:51 AMAI Evy
03/29/2026, 4:52 AMinbound_webhook_url should fire for regular inbound calls to a Retell number [(1) ]() . However, the sources don't explicitly address whether this webhook fires when a call arrives via PSTN transfer versus through Retell's internal routing.
## Inbound Webhook Configuration
The inbound_webhook_url can be set on any phone number (including imported numbers) via the Update Phone Number API :
javascript
inbound_webhook_url: "<https://example.com/inbound-webhook%22>AI Evy
03/29/2026, 4:52 AMfrom_number and to_number [(2) ]() . According to community sources, this webhook fires when calls start and provides the caller's number in the payload .
## Transfer Limitations with Elastic SIP Trunking
When using Elastic SIP Trunking with Twilio, transfers face specific constraints. For cold transfers with "Transferee's Number" selected, Retell uses SIP REFER protocol, which requires your telephony provider to support SIP REFER, enable transfer to PSTN, and set caller ID as transferee [(3) ]() . However, Twilio does not honor custom SIP headers in REFER requests for cold transfers .
The sources indicate that when using custom telephony via Elastic SIP Trunking, Retell does not directly make or receive calls but relies on your system to dial calls to the respective SIP URI [(4) ]() . Transfer functionality depends on your SIP trunk configuration .
## Architecture Gap
The sources don't provide a documented pattern for transferring from a Retell agent to internal SIP extensions when using Elastic SIP Trunking without purchasing additional numbers. The transfer call feature requires proper SIP trunk configuration to allow SIP REFER and PSTN transfer .
I'd recommend checking out these potentially useful sources: [Custom Telephony Overview]() , [Update Phone Number]()
Would you like a general answer based on my knowledge instead?AI Evy
03/29/2026, 4:52 AMAI Evy
03/29/2026, 4:52 AM