https://retellai.com/?utm_source=discord&utm_medium=seo logo
<@1145576664366055464> I am facing difficulty in s...
# ❓・ai-evy-support
p
@AI Evy I am facing difficulty in setting up call forwarding on an agent I created. This agent is using a canadian number from Twilio, imported into retell by SIP trunking
a
Thanks for tagging me @pavankalyan2312. I'll look through relevant sources and get back to you shortly.
### Answer Call forwarding (transfer) with SIP trunking should work when properly configured [(1) ]() . For Elastic SIP Trunking with Twilio, you need to ensure your SIP trunk allows SIP REFER and PSTN transfer, with the transferee's number showing as caller ID . When setting up your Twilio Elastic SIP Trunk for call transfer functionality, make sure to enable code transfer and tick the "Enable PSTN Transfer" checkbox in your trunk's general settings [(2) ](

▾

) . For call forwarding via websocket, you can use the native transfer feature by sending a response with the transfer_number field [(3) ]() :
Copy code
javascript
const forwardRespone: ResponseResponse = {
  response_type: "response",
  response_id: responseId,
  content: message,
  content_complete: true,
  transfer_number: phoneNumber,
  no_interruption_allowed: true,
};
this.ws.send(JSON.stringify(forwardRespone) ) ;
However, there have been reported issues with call transfer reliability when using SIP trunking [(4) ]() [(3) ]() . Some users have experienced intermittent failures where transfers don't complete properly, with calls reaching maximum duration or failing to connect the transferred party . If you continue experiencing issues, check your Twilio termination settings and ensure your SIP trunk configuration allows for proper call transfer functionality [(5) ]() [(1) ]() .
​ To learn more, see the sources I considered: [[1] Custom Telephony Overview](https://docs.retellai.com/deploy/custom-telephony) [[2] Retell AI - Connect to your own Twilio - Using Sip Trunking](

https://www.youtube.com/watch?v=JC3PV_R-Z1Y▾

) [[3] CALL FORWARDING ISSUE](https://discord.com/channels/1186424376300679209/1378495407822340208) [[4] SIP TRUNK CALL TRANSFER ERROR](https://discord.com/channels/1186424376300679209/1377021475143286927) [[5] Twilio](https://docs.retellai.com/deploy/twilio) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
2025-07-28 21:04:55.604 call_7d3c27f3b9cef99ad16cd884b4a info: custom sip headers {} 2025-07-28 21:04:56.799 call_7d3c27f3b9cef99ad16cd884b4a error: Error transferring call, SIP status code: undefined SIP error category: unknown Error: twirp error unknown: server required auth, but no username or password was provided 2025-07-28 21:04:56.799 call_7d3c27f3b9cef99ad16cd884b4a info: transfer call result false here are the call logs @AI Evy
a
Thanks for the follow-up, @pavankalyan2312. I'll get back to you soon.
### Answer Based on your error logs, the issue is clear: "server required auth, but no username or password was provided." This indicates your SIP trunk authentication is not properly configured for call transfers. For Twilio Elastic SIP Trunking with Retell AI, you need to configure authentication credentials when importing your number [(1) ]() . When you set up your Elastic SIP Trunk, you have two options for accepting outbound requests : 1. Whitelist IP addresses - Currently not recommended since Retell SIP server does not have a static IP 2. Create authentication with username and password - This is the recommended approach To fix your authentication issue: 1. In your Twilio Elastic SIP Trunk termination settings, ensure you've created credentials with a username and password 2. When importing the number to Retell, provide these authentication credentials [(2) ]() :
Copy code
javascript
const phoneNumberResponse = await client.phoneNumber.import({
 phone_number: '+14157774444',
 termination_uri: 'someuri.pstn.twilio.com',
 sip_trunk_auth_username: 'username',
 sip_trunk_auth_password: '123456'
}) ;
Additionally, for call transfers to work properly with SIP trunking, you need to configure your Twilio trunk to [(3) ]() : - Enable SIP REFER - Enable transfer to PSTN - Set caller ID as transferee The error you're seeing suggests the authentication credentials weren't provided during the number import process or weren't configured correctly in your Twilio trunk termination settings.
​ To learn more, see the sources I considered: [[1] Twilio](https://docs.retellai.com/deploy/twilio) [[2] Import Phone Number](https://docs.retellai.com/api-references/import-phone-number) [[3] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.