Skip to content

How to connect Retell AI to a Costa Rica number over a SIP trunk

Step-by-step setup for Retell AI on a SIP.cr trunk with a +506, 800 or 0800 number: which value goes where, how inbound works, and what to check.

To connect Retell AI to a Costa Rica phone number, create a SIP.cr trunk of type Retell AI, copy its SIP server and port, username and password into Retell AI under Phone Numbers › Add › Connect to your number via SIP trunking, and point a +506, 800 or 0800 number from SIP.cr at a trunk group that contains the trunk. From then on, calls to that number reach your Retell AI agent, and outbound calls from Retell AI leave with one of your own numbers as caller ID.

This article covers the setup in order, shows which value goes into which Retell AI field, explains how inbound calls find Retell AI, and lists what to check when the first call does not go through.

What you need before you start

  • An active SIP.cr account. A person reviews each new account (company details and legal representative). Service starts once a payment method is on file and there is credit; after that, trunks work as soon as they are created.
  • A Retell AI account and an agent you want to put on the phone network. Retell AI's own guide for bringing your own telephony is at docs.retellai.com.
  • An estimate of simultaneous calls. That figure becomes the trunk's channel count, and you can change it later.

Step by step

  1. Create the trunk in SIP.cr. In SIP trunks, choose New trunk and pick Retell AI. Choosing Retell AI sets the trunk to username and password authentication, with credentials that SIP.cr generates, and fills in the address SIP.cr uses to send inbound calls to Retell AI. Set the number of simultaneous calls you need.
  2. Open the trunk page. It lists each value under the name Retell AI uses for it, so there is no guessing which field is which.
  3. Add the number in Retell AI. Go to Phone Numbers › Add › Connect to your number via SIP trunking and paste the values from the trunk page (see the table below). For anything on the Retell AI side beyond these fields, such as which agent handles the number, follow Retell AI's current guide.
  4. Buy a Costa Rica number in SIP.cr. In Numbers, pick a +506 geographic number, a national toll-free 800 number or an international toll-free 0800 number, and point it at a trunk group that contains the Retell AI trunk.
  5. Make a test call. Call the number from a phone, or place an outbound call from Retell AI. The trunk page in SIP.cr shows the last call and how it ended.

Field mapping

The left column uses the names in Retell AI's published guide. The values come from your trunk page in SIP.cr.

Field in Retell AIValue from your SIP.cr trunk
Termination URISIP server and port (host:port)
SIP Trunk User NameTrunk username
SIP Trunk PasswordTrunk password

Field names come from Retell AI's guide and can change when Retell AI updates its product. If a label does not match this table, follow Retell AI's current guide and write to [email protected] so the mapping can be checked.

Keep the trunk password in a secrets manager or environment variables, not in documents or scripts you share.

How inbound calls reach Retell AI

The table above covers the direction from Retell AI to SIP.cr: the termination URI and credentials are what Retell AI uses to send outbound calls through your trunk. Inbound calls travel the other way. When someone dials your Costa Rica number, SIP.cr sends the call to Retell AI at this address:

sip:sip.retellai.com;transport=tcp

You do not need to type it. The new-trunk form fills it in when you choose Retell AI as the trunk type. It is still useful to know, because if inbound calls fail while outbound calls work, the problem is on this leg, not in the credentials you pasted into Retell AI.

For an inbound call to arrive, three links must be in place:

  1. The SIP.cr number points at a trunk group.
  2. That trunk group contains the Retell AI trunk. Trunk groups support ordered failover for inbound calls, so you choose which trunk receives the call first.
  3. The same number exists on the Retell AI side, added through the SIP trunking option.

Outbound calls and caller ID

When Retell AI places a call through the trunk, the caller ID is one of your account's own numbers. People in Costa Rica see a local or toll-free number they recognize and can call back, instead of a foreign one. This can affect answer rates on outbound campaigns: an unfamiliar international number is easy to ignore.

If you run several agents or several platforms, create one trunk per agent. Numbers, channels and billing stay in one SIP.cr account, and the call records show which trunk carried each call.

Sizing channels

Each trunk has between 1 and 1,000 channels, and each channel carries one call at a time. Count inbound and outbound calls together on the same trunk. If a campaign or a busy season needs more, change the channel count from the portal or through the API; the trunk does not need to be recreated.

A clear sign of too few channels: calls fail only at busy times while quiet hours work fine.

When the first call fails

Start in the SIP.cr portal. Every call to and from Retell AI has a record with its timeline, hangup cause, audio quality figures (MOS, jitter and packet loss) and result. The hangup cause is explained in plain words with what to check.

What you seeLikely causeWhat to check
No call record for an outbound attemptThe call never reached SIP.crThe termination URI in Retell AI: host and port exactly as shown on the trunk page
Outbound call rejected for authenticationWrong username or passwordCopy both again from the trunk page; watch for spaces at the start or end
Outbound works, inbound does not reach Retell AIInbound routingThe number points at a trunk group that contains the Retell AI trunk; the number exists in Retell AI
Failures only at peak timesNot enough channelsRaise the channel count on the trunk
Call connects but audio is poorNetwork qualityMOS, jitter and packet loss on the call record

Two more points from the SIP.cr guides: the trunk supports the G.711 and Opus codecs, and a platform that requires TLS with SRTP, or that sends calls from many IP addresses, should be confirmed with [email protected] before going live.

Automating the SIP.cr side

Everything in the portal is also available over the REST API at https://sip.cr/api/v1, with a bearer API key:

  • /api/v1/trunks to create a trunk and change its channels.
  • /api/v1/trunk-groups to group trunks with ordered failover.
  • /api/v1/numbers to search stock by area code, buy a number and route it.
  • /api/v1/calls and /api/v1/stats to read call records, answer rate and average duration.

If you work with Claude Code, Cursor or VS Code, the MCP server at https://sip.cr/mcp lets your coding agent read trunks, numbers and recent calls with the same API key. For event-driven logic, SIP.cr posts signed webhooks such as call.completed and call.failed when the call record arrives, right after the call ends.

Checklist before going live

  • The trunk was created with the Retell AI type, and the channel count matches your expected peak.
  • The termination URI, username and password in Retell AI match the trunk page.
  • The number exists in Retell AI and is handled by the agent you want callers to reach.
  • The SIP.cr number points at a trunk group that contains the Retell AI trunk.
  • One inbound and one outbound test call appear in the SIP.cr call records with the result you expected.

The full field list and setup steps are in the Retell AI integration guide on SIP.cr.

More articles

Reviewed, then live

Put your AI voice agent on the phone network.

Create the account today. Once our team approves it and you add a payment method, your first trunk and number take a few minutes.

Create account Talk to sales