sip transfer on call creation
# support
m
ON a sip number imported via twilio I have a use case where on assistant creation I want to skip creating and assistant and transfer the call immediately. My issue is that this cause the call to fail every time. this is strange because using the sip destination transfer in my assistant work perfectly but only after the call has been established. I can provide additional logs if needed.
Using wireshark on some of the failed call logs, I see that I'm getting a 603 Denied from Twilio.
v
Hi, I can help you with this issue. The 603 Denied usually happens when trying a SIP transfer before the call is fully established. I’ve solved similar cases by ensuring the initial call leg connects before triggering the transfer. Could you share your current TwiML or VAPI flow so I can suggest the exact fix? @mike
m
Yeah, I have the SIP number imported from Twilio and then I have a server webhook which just returns the transfer destination with the SIP URI during assistant creation and yeah, this is when it's failing. returned from server destination: { type: "sip", sipUri:
sip:${phoneNumber}@${sipUri}
, callerId: phoneNumber, sipHeaders: { Diversion:
<sip:${phoneNumber}@${sipUri}>;reason=unconditional;privacy=off;screen=no
, }, }, I tried adding the caller id and sip header to maybe override issue with the referrer being incorrect
@Vercel thank you for offering!
v
Thanks for sharing those details — that helps a lot. The issue likely happens because Twilio rejects the transfer when the SIP leg is initiated before the session is fully established, even with the Diversion header. In similar setups, I’ve fixed this by delaying the transfer until Twilio confirms the call is connected or by adjusting the SIP headers order. Could you share a short snippet of your server’s response logs or the exact VAPI event sequence right before the transfer fires? That’ll help pinpoint whether it’s a timing or header mismatch issue. @mike
3 Views