hintenjoyer
10/02/2025, 12:53 AMAI Evy
10/02/2025, 12:53 AMAI Evy
10/02/2025, 12:54 AM/v2/register-phone-call with an agent_id and other optional parameters [(1) ]()
2. **Returns a call_id**: The API responds with a unique call_id that you use to route the call
3. **Enables SIP routing**: You can then dial to the SIP endpoint using the format sip:{call_id}@5t4n6j0wnrl.sip.livekit.cloud [(3) ]()
The basic JavaScript example shows:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneCallResponse = await client.call.registerPhoneCall({
agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
}) ;
console.log(phoneCallResponse.agent_id) ;
[(1) ]()
Required parameters are agent_id and direction (inbound or outbound) , while from_number and to_number are optional but useful for tracking [(3) ]() . This is particularly useful for Method 2: Dial to SIP URI when your telephony provider doesn't support elastic SIP trunking [(2) ]() .AI Evy
10/02/2025, 12:54 AMAI Evy
10/02/2025, 12:54 AMAI Evy
10/02/2025, 12:54 AMhintenjoyer
10/02/2025, 12:54 AMAI Evy
10/02/2025, 12:54 AMAI Evy
10/02/2025, 12:54 AMcall_id and registers the call with Retell's system [(1) ]()
2. **Your system makes the call**: You still need to use your telephony provider to actually dial the number
3. **SIP routing**: Once your system dials, it routes the call to Retell using the SIP URI format: sip:{call_id}@sip.retellai.com [(2) ]()
This is specifically designed for Method 2: Dial to SIP URI in custom telephony setups . When using this method, Retell does not directly make or receive calls, but instead relies on your system to dial the call to the respective SIP URI .
For actual outbound calling where Retell initiates the call directly, you would use a different API endpoint (like Create Phone Call) rather than Register Phone Call [(3) ]() .
The Register Phone Call API is essentially a "preparation step" that tells Retell "expect a call with this ID and use this agent to handle it" [(1) ]() .AI Evy
10/02/2025, 12:54 AM