https://retellai.com/?utm_source=discord&utm_medium=seo logo
how can i make my ai agent call other countries an...
# ❓・ai-evy-support
c
@AI Evy how can i make my ai agent call other countries and also receive calls? like brazil portugal, france and etc?
a
Thanks for tagging me @Client Nexus. I'll look through relevant sources and get back to you shortly.
### Answer To enable international calling (outbound and inbound) for countries like Brazil, Portugal, and France, you have a couple of options: For Outbound Calls: Retell-purchased numbers support calling to [15 countries]() . [(1) ]() If you need to call additional countries, you'll want to use imported numbers via custom telephony (e.g., Twilio SIP trunk) , where international calling depends on your telephony provider's settings. For Twilio SIP trunks specifically, search "geo" to find the "Voice Geographic Permissions" setting to enable dialing to international countries. [(2) ]() For Inbound Calls: When importing a phone number, you can configure
inbound_allowed_countries
to specify which countries can call your number using ISO 3166-1 alpha-2 country codes. [(3) ]() For example:
Copy code
json
["US", "CA", "GB", "BR", "PT", "FR"]
Similarly, for outbound, you can set
outbound_allowed_countries
to control which countries your agent can dial. Recommended Setup: 1. Set up a SIP trunk with a provider like Twilio that supports international numbers [(4) ]() 2. Import the number to Retell with the termination URI [(3) ]() 3. Configure geographic permissions in your telephony provider for the countries you need [(2) ]()
​ To learn more, see the sources I considered: [[1] Outbound Calls (Make Calls)](https://docs.retellai.com/deploy/outbound-call) [[2] 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) [[3] Import Phone Number](https://docs.retellai.com/api-references/import-phone-number) [[4] Discord message from @jeremy_74581 on 2025-02-21](https://discord.com/channels/1186424376300679209/1294891368505937952/1342288718022574090) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy what can i do to automtized this process? like user byuy from my app the phone number in twiilo, set up is done send and set in retell automatically
a
Thanks for the follow-up, @Client Nexus. I'll get back to you soon.
### Answer To automate the process of users purchasing phone numbers and setting them up in Retell, you can build a workflow using the Retell API: High-Level Automation Flow: 1. User purchases number via Twilio API (in your app) 2. Your backend imports/creates the number in Retell using the API 3. Assign an agent to the number automatically For Retell-Purchased Numbers: You can use the Create Phone Number API endpoint to purchase numbers directly through Retell: [(1) ]()
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
[(2) ]() The Create Phone Number endpoint accepts parameters like
area_code
,
inbound_agent_id
,
outbound_agent_id
, and country settings. [(1) ]() For Twilio SIP Trunk Numbers: If you need international numbers via Twilio, you'd: 1. Purchase the number via Twilio's API 2. Configure your SIP trunk in Twilio 3. Use Retell's Import Phone Number API to register it with Retell (not in the provided sources, but referenced in the thread) Workflow Automation Platforms: Retell AI partners with Make.com and n8n for building automated workflows without extensive coding. These integrations help connect Retell AI with CRMs and other business tools. [(3) ]() Check out these potentially useful sources for the Import Phone Number API: [Import Phone Number]() Would you like a general answer on structuring this automation flow?
​ To learn more, see the sources I considered: [[1] Create Phone Number](https://docs.retellai.com/api-references/create-phone-number) [[2] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[3] Voice API: Integrate Phone AI Agents with Your System | Retell AI](https://www.retellai.com/blog/how-to-integrate-phone-ai-agents-with-your-existing-api-systems) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy yes we need to use the sip trunk because is for brazil, portugal and maybe other countries, so can we do this autoamtically in retell? or do i need to use my software as an intermediator? like buy in my software brazil number from twiilo set what is necessary for tracking and set automatcalliy in retell?
a
Thanks for the follow-up, @Client Nexus. I'll get back to you soon.
### Answer Yes, you'll need your software as an intermediary to handle the Twilio side, but the Retell import can be fully automated via API. [(1) ]() Your Automation Flow: 1. Your backend purchases the number from Twilio (via Twilio API) 2. Configure the number on your Twilio SIP trunk (via Twilio API) 3. Import the number to Retell using the Import Phone Number API [(2) ]() Retell Import Phone Number API: You can programmatically import numbers via the API: [(1) ]()
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneNumberResponse = await client.phoneNumber.import({
  phone_number: '+14157774444',
  termination_uri: 'someuri.pstn.twilio.com',
}) ;
console.log(phoneNumberResponse.inbound_agent_id) ;
[(2) ]() Key parameters you can set during import: -
phone_number
- E.164 format (required) -
termination_uri
- Your Twilio SIP trunk termination URI (required) -
sip_trunk_auth_username
/
sip_trunk_auth_password
- If using credential auth -
inbound_agent_id
/
outbound_agent_id
- Bind agents automatically -
inbound_allowed_countries
/
outbound_allowed_countries
- Set geographic permissions What Retell cannot automate: - Purchasing numbers from Twilio - Setting up the Twilio Elastic SIP Trunk configuration (termination/origination URIs, credentials, geographic permissions) [(1) ]() So your app handles Twilio setup, then calls Retell's Import API to register the number—this can all happen programmatically without manual dashboard work. , [(2) ]()
​ 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) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy my tech team is ask the below, can you provide the complete information on that so we make sure we HAVE EVERYTHING we need for this set up? SIP Trunk Configuration: What specific SIP trunk settings does Retell require? Do they provide: A SIP URI we point the Twilio number to? Specific authentication credentials? Do we need to create a Twilio SIP Domain?
a
Thanks for the follow-up, @Client Nexus. I'll get back to you soon.
### Answer Here's the complete SIP trunk configuration information for your tech team: *1. SIP URI (Origination - for inbound calls) * Retell provides this SIP server address:
sip:sip.retellai.com
[(1) ]() Transport options: - TCP (Recommended) :
sip:sip.retellai.com;transport=tcp
- UDP:
sip:sip.retellai.com;transport=udp
- TLS:
sip:sip.retellai.com;transport=tls
*2. IP Whitelist (if needed) * IP block for traffic:
18.98.16.120/30
(All regions) ,
143.223.88.0/21
(United States only) ,
161.115.160.0/19
(United States only) 3. Authentication Credentials Retell does not provide credentials to you—**you create them in Twilio**. When importing the number to Retell, you supply your Twilio credentials: [(2) ]() -
sip_trunk_auth_username
-
sip_trunk_auth_password
4. Twilio SIP Domain/Trunk Setup Yes, you need to create an Elastic SIP Trunk in Twilio with: [(3) ]() , [(4) ](

▾

) - Termination (for outbound) : Create your termination URI and credentials in Twilio—you'll provide this URI to Retell when importing - Origination (for inbound) : Set Retell's SIP URI (
sip.retellai.com
) as the origination URI - **Numbers**: Add your purchased numbers to the trunk 5. Import to Retell
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneNumberResponse = await client.phoneNumber.import({
  phone_number: '+14157774444',
  termination_uri: 'someuri.pstn.twilio.com',
}) ;
console.log(phoneNumberResponse.inbound_agent_id) ;
[(2) ]() For Twilio, the termination URI typically ends with
.pstn.twilio.com
.
​ To learn more, see the sources I considered: [[1] Custom Telephony Overview](https://docs.retellai.com/deploy/custom-telephony) [[2] Import Phone Number](https://docs.retellai.com/api-references/import-phone-number) [[3] Twilio](https://docs.retellai.com/deploy/twilio) [[4] Retell AI - Connect to your own Twilio - Using Sip Trunking](

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

) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy thanks,m now they need: Do you have the Retell API endpoint/documentation for importing external phone numbers? I need to know: Which endpoint to call What parameters (phone number, SIP credentials, etc.) Which Retell workspace ID to use (per-agency workspace?)
a
Thanks for the follow-up, @Client Nexus. I'll get back to you soon.
### Answer API Endpoint:
POST /import-phone-number
[(1) ]() Required Parameters: -
phone_number
(string, required) - E.164 format (+country code, then number with no space, no special characters) -
termination_uri
(string, required) - Your elastic SIP trunk termination URI. For Twilio, it always ends with
.pstn.twilio.com
Optional Parameters: -
sip_trunk_auth_username
- Username for SIP trunk authentication -
sip_trunk_auth_password
- Password for SIP trunk authentication -
inbound_agent_id
- Agent ID for inbound calls -
outbound_agent_id
- Agent ID for outbound calls -
inbound_agent_version
/
outbound_agent_version
- Specific agent versions -
inbound_allowed_countries
/
outbound_allowed_countries
- ISO 3166-1 alpha-2 country codes -
inbound_webhook_url
- Webhook for inbound call overrides -
nickname
- For your reference -
transport
- "TLS", "TCP", or "UDP" (default: "TCP") Code Example:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneNumberResponse = await client.phoneNumber.import({
  phone_number: '+14157774444',
  termination_uri: 'someuri.pstn.twilio.com',
}) ;
console.log(phoneNumberResponse.inbound_agent_id) ;
Authorization: Header format:
Bearer YOUR_API_KEY
Workspace ID: The workspace ID is found in your workspace settings page. [(2) ]() The API key itself is tied to a specific workspace, so when you use an API key, the number is imported to that workspace. [(1) ]() For per-agency workspaces, each agency would need their own workspace with their own API key.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Import Phone Number](https://docs.retellai.com/api-references/import-phone-number) [[2] Workspace](https://docs.retellai.com/accounts/workspace) ​
c
@AI Evy now we need: Call recordings for imported numbers: For these imported numbers, will: Retell still handle call recordings automatically? Or do we need Twilio to record and then sync to our system?
a
Thanks for the follow-up, @Client Nexus. I'll get back to you soon.
### Answer Retell handles call recordings automatically for imported numbers. Once your number is imported via SIP trunk, it works just like a Retell-purchased number—including recordings. [(1) ]() The Register Phone Call API response shows that Retell provides these recording URLs automatically after calls end: [(2) ]() -
recording_url
- Standard recording -
recording_multi_channel_url
- Multi-channel recording (each party's audio in separate channels) -
scrubbed_recording_url
- Recording with PII removed -
scrubbed_recording_multi_channel_url
- Multi-channel with PII removed You do not need Twilio to handle recordings. The documentation states that once a number is imported, "you can make and receive calls with this number just like a number you purchased from Retell." [(1) ]() Additional recording controls available: You can configure
data_storage_setting
to control what gets stored, and
opt_in_signed_url
for secure URL access. [(2) ]()
​ To learn more, see the sources I considered: [[1] Twilio](https://docs.retellai.com/deploy/twilio) [[2] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy now we need: Transcription/Summary/Tags: For imported numbers, will Retell's webhook still fire with the same payload (transcript, summary, AI tags) as US/CA numbers? Or is there a different data flow?
a
Thanks for the follow-up, @Client Nexus. I'll get back to you soon.
### Answer Yes, imported numbers receive the same webhook payloads as Retell-purchased numbers. The webhook system fires the same three events regardless of number type: [(1) ]() | Event Type | Description | Payload | |------------|-------------|---------| |
call_started
| Triggered when a new call begins | Basic call information | |
call_ended
| Triggered when a call completes, transfers, or encounters an error | All fields from the call object except
call_analysis
| |
call_analyzed
| Triggered when call analysis is complete | Full call data including
call_analysis
object | Sample webhook payload structure:
Copy code
json
{
  "event": "call_ended",
  "call": {
    "call_type": "phone_call",
    "from_number": "+12137771234",
    "to_number": "+12137771235",
    "direction": "inbound",
    "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
    "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
    "call_status": "registered",
    "metadata": {},
    "retell_llm_dynamic_variables": {
      "customer_name": "John Doe"
    },
    "start_timestamp": 1714608475945,
    "end_timestamp": 1714608491736,
    "disconnection_reason": "user_hangup",
    "transcript": "...",
    "transcript_object": [ [Object], [Object], [Object], [Object] ],
    "transcript_with_tool_calls": [ [Object], [Object], [Object], [Object] ],
    "opt_out_sensitive_data_storage": false
  }
}
The
call_analyzed
event includes additional fields like
call_analysis
with user sentiment and custom analyzed data. [(2) ](

▾

) One note for dial-to-SIP: If using dial-to-SIP, the
from_number
field may show "user" instead of the actual caller number—this is a limitation where Retell doesn't control the format from the SIP provider. You can work around this by adding the from number as a variable when registering the call. [(4) ]()
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Personalization with Airtable](

https://www.youtube.com/watch?v=U8jdhkqOOhE▾

) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy When importing a phone number via POST /import-phone-number with termination_uri, do call recordings, transcriptions, and AI summaries work identically to Retell-managed numbers? What is the correct termination_uri format for Twilio Elastic SIP Trunks? Is it {trunk-sid}.pstn.twilio.com or does it require the full Twilio trunk termination URI? Do we need to configure anything special in Retell for inbound calls to work on imported numbers? Is sip:sip.retellai.com;transport=tcp the correct origination URI for Twilio SIP trunks?
a
Thanks for the follow-up, @Client Nexus. I'll get back to you soon.
### Answer 1. Do recordings, transcriptions, and AI summaries work identically for imported numbers? Yes. Once imported, the number works just like a Retell-purchased number—it will show up in your dashboard, and you can make phone calls from Dashboard directly. [(1) ]() 2. Correct termination_uri format for Twilio Elastic SIP Trunks: The termination URI you set up in Twilio is what you provide to Retell. For Twilio elastic SIP trunks it always ends with
.pstn.twilio.com
. [(2) ]() You might want to use a localized termination URI that's near your region—you can expand and view your localized URIs in the Twilio console. [(1) ]() Example format from the API:
Copy code
javascript
termination_uri: 'someuri.pstn.twilio.com'
[(2) ]() 3. Special configuration in Retell for inbound calls on imported numbers? No special Retell configuration is needed beyond the import itself. The key setup happens in Twilio—you must configure origination in your SIP trunk to point to Retell's SIP server. [(1) ]() 4. Correct origination URI for Twilio SIP trunks: Yes, for TCP transport, use:
sip:sip.retellai.com;transport=tcp
[(3) ]() The base Retell SIP server address is
sip:sip.retellai.com
. [(1) ]() Transport options: [(3) ]() - TCP (Recommended) :
sip:sip.retellai.com;transport=tcp
- UDP:
sip:sip.retellai.com;transport=udp
- TLS:
sip:sip.retellai.com;transport=tls
​ 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] 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.
c
@AI Evy the us numbers/canada number i buy in retell can call other countries? like brazil or portugal? if so how do i set this up corrently when i try dont connect
a
Thanks for the follow-up, @Client Nexus. I'll get back to you soon.
### Answer Yes, Retell-purchased US/Canada numbers support international calling to 15 countries. [(1) ]() Native Retell numbers now support international calls to 14 countries, so you are no longer limited to the U.S. [(2) ]() If Brazil and Portugal are not connecting: 1. Check supported countries — Verify Brazil and Portugal are among the supported countries by reviewing: [International Call Documentation]() [(1) ]() 2. If not supported natively — You'll need to use imported numbers via custom telephony (e.g., Twilio SIP trunk) , where international calling depends on your telephony provider's settings. For Twilio SIP Trunk Setup: If you need countries beyond the 15 supported, set up a Twilio Elastic SIP Trunk: [(3) ]() 1. In Twilio, search "geo" to find "Voice Geographic Permissions" 2. Choose "Elastic SIP Trunking" in the selector 3. Select the countries you want to dial (Brazil, Portugal, etc.) This geographic permissions step is required for Twilio to allow outbound calls to those destinations.
​ To learn more, see the sources I considered: [[1] Outbound Calls (Make Calls)](https://docs.retellai.com/deploy/outbound-call) [[2] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[3] Twilio](https://docs.retellai.com/deploy/twilio) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.