https://retellai.com/?utm_source=discord&utm_medium=seo logo
im still having issues with the sip trunk set up, ...
# ❓・ai-evy-support
c
@AI Evy im still having issues with the sip trunk set up, the only error retell shows in the call history is telephony provider permission denied , how can i know what exactly is wrong? because i check all credentials and all is 100% correct... im using twilio with brazil phone numbers, but should also work for all
a
Thanks for tagging me @Client Nexus. I'll look through relevant sources and get back to you shortly.
### Answer The
telephony_provider_permission_denied
error means the SIP trunk authentication failed between Retell and Twilio. [(1) ]() [(2) ]() Common causes and things to check: 1. Verify username/password are correct — The username in Twilio is different from the "friendly name." Double-check you're using the actual credential username, not the display name. [(3) ]() 2. Check for spaces in the Termination SIP URI — Remove any accidental spaces. 3. IP Whitelisting issues — If you're using IP-based authentication instead of credentials, ensure you've whitelisted all required IP ranges: -
18.98.16.120/30
(All regions) -
143.223.88.0/21
(United States only) -
161.115.160.0/19
(United States only) [(4) ]() One user resolved this exact error by adding the additional IP ranges
143.223.88.0/21
and
161.115.160.0/19
. [(5) ]() 4. Geographic Permissions in Twilio — For Brazil numbers, ensure you've enabled Voice Geographic Permissions for Brazil in your Twilio account. Search "geo" in Twilio to find "Voice Geographic Permissions." [(3) ]() [(6) ]() 5. Check Twilio logs — The detailed error from Twilio's side will give you more specific information about why authentication is failing. [(2) ]() [(7) ](
​ To learn more, see the sources I considered: [[1] Debug call disconnection](https://docs.retellai.com/reliability/debug-call-disconnect) [[2] Debug outbound connection issues](https://docs.retellai.com/reliability/debug-outbound-call) [[3] I’m trying to use a toll-free number (connected from Twilio through a SIP trunk)](https://retell.discourse.group/t/i-m-trying-to-use-a-toll-free-number-connected-from-twilio-through-a-sip-trunk/127) [[4] Custom Telephony Overview](https://docs.retellai.com/deploy/custom-telephony) [[5] "Telephony Permission Denied" (Twilio)](https://discord.com/channels/1186424376300679209/1446239879112556625) [[6] Telephony Provider Unavailable](https://discord.com/channels/1186424376300679209/1417453291922526270) [[7] Outbound sip call getting Telephony_provider_permission_denied error](https://discord.com/channels/1186424376300679209/1433144721429106738) ​
300679209/1433144721429106738) Next steps: - Check the detailed call logs in Retell for the SIP error code [(2) ]() - Review Twilio's logs for the specific rejection reason - If using credentials, try removing any IP ACL whitelists (you only need one or the other) [(5) ]()
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy what the termination uri should be?
a
Thanks for the follow-up, @Client Nexus. I'll get back to you soon.
### Answer The Termination SIP URI comes from Twilio, not Retell. [(1) ]() When you set up your Elastic SIP Trunk in Twilio, the termination URI is generated by Twilio and typically ends with
.pstn.twilio.com
. Key points: - You should use a localized termination URI that's near your region for better performance. - You can find your localized URIs by expanding and viewing them in the Twilio console. - Make sure there are no spaces in the termination URI. For origination (inbound calls to Retell) , you set Retell's SIP server address:
sip:sip.retellai.com
[(1) ]() [(2) ]() So to summarize: - Termination URI (outbound) : Get this from your Twilio Elastic SIP Trunk settings - Origination URI (inbound) :
sip:sip.retellai.com
[(2) ]() When importing the number to Retell, you'll supply the Twilio termination SIP URI you configured in your trunk. [(1) ]()
​ To learn more, see the sources I considered: [[1] Twilio](https://docs.retellai.com/deploy/twilio) [[2] Custom Telephony Overview](https://docs.retellai.com/deploy/custom-telephony) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.