danielh_32629
12/11/2025, 9:14 AMAI Evy
12/11/2025, 9:14 AMAI Evy
12/11/2025, 9:14 AMAI Evy
12/11/2025, 9:14 AMjson
{
"phone_number": "+14157774444",
"termination_uri": "someuri.pstn.twilio.com",
"sip_trunk_auth_username": "username",
"sip_trunk_auth_password": "123456",
"outbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD"
}
Then use the Create Phone Call API with your imported number as from_number. [(2) ]()
## Option 2: Dial to SIP URI (Method 2)
If your provider doesn't support elastic SIP trunking, use the Register Phone Call API to get a call_id, then dial the SIP URI from your system: [(3) ]()
javascript
const phoneCallResponse = await client.call.registerPhoneCall({
agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
from_number: "+12137771234",
to_number: "+12137771235",
direction: "inbound",
}) ;
const voiceResponse = new VoiceResponse() ;
const dial = voiceResponse.dial() ;
dial.sip(
`sip:${phoneCallResponse.call_id}@sip.retellai.com`,
) ;
The SIP URI format is: sip:{call_id}@sip.retellai.com
Required fields for the register call are agent_id and direction (inbound or outbound) . [(4) ]()
Which method are you looking to use—elastic SIP trunking or dial to SIP URI?AI Evy
12/11/2025, 9:14 AMdanielh_32629
12/11/2025, 9:15 AMdanielh_32629
12/11/2025, 9:16 AMAI Evy
12/11/2025, 9:16 AMAI Evy
12/11/2025, 9:16 AMPOST /import-phone-number [(1) ]()
Headers:
- `Authorization`: Bearer YOUR_RETELL_API_KEY
- `Content-Type`: application/json
Body (JSON) :
json
{
"phone_number": "+14157774444",
"termination_uri": "someuri.pstn.twilio.com",
"sip_trunk_auth_username": "username",
"sip_trunk_auth_password": "123456",
"inbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"outbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD"
}
## Step 2: Create the Outbound Call
Endpoint: POST /v2/create-phone-call [(2) ]()
Headers:
- `Authorization`: Bearer YOUR_RETELL_API_KEY
- `Content-Type`: application/json
Body (JSON) :
json
{
"from_number": "+14157774444",
"to_number": "+12137774445"
}
Key notes:
- from_number must be a number purchased from Retell or imported to Retell
- to_number is the destination in E.164 format
- You can optionally add override_agent_id if you want to use a different agent than what's bound to the number
Make sure your termination URI is correct and matches your SIP trunk provider's settings. [(5) ]()AI Evy
12/11/2025, 9:16 AMAI Evy
12/11/2025, 9:16 AM