### Answer
Custom Twilio SIP trunks are supported in Retell AI, and you can import Twilio numbers using the Import Phone Number API. Your payload structure is correct for importing a number. Key requirements include the phone number in E.164 format, a valid termination_uri (which for Twilio should end with .pstn.twilio.com) , and optional authentication credentials if needed [(1) ](
) [(2) ](
) [(3) ](
) .
A 500 Internal Server Error can indicate a configuration issue or unsupported scenario. Common causes reported include issues with the SIP trunk configuration or the format of the termination URI [(4) ](
) . There’s no documentation stating that custom Twilio SIP trunks need whitelisting, but some SIP trunk providers may require IP whitelisting for security, even though Retell AI does not provide a static IP for its SIP server [(2) ](
) [(4) ](
) .
If you continue to receive a 500 error after confirming your SIP trunk is set up correctly, try the following:
- Double-check your termination_uri for typos or unsupported parameters (e.g., avoid extra transport parameters) .
- Ensure your Twilio SIP trunk is active and correctly configured for both inbound and outbound.
- If your trunk requires authentication, add the sip_trunk_auth_username and sip_trunk_auth_password fields [(1) ](
) .
- If the issue persists, you may need to consult your SIP trunk provider for possible