chris_51769
09/08/2025, 3:43 PMAI Evy
09/08/2025, 3:43 PMAI Evy
09/08/2025, 3:43 PMcall_id and obtain the SIP URI [(1) ]() [(2) ]() :
javascript
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
server.app.post(
"/voice-webhook",
async (req: Request, res: Response) => {
// Register the phone call to get call id
const phoneCallResponse = await client.call.registerPhoneCall({
agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
from_number: "+12137771234", // optional
to_number: "+12137771235", // optional
direction: "inbound", // optional
}) ;
// Start phone call websocket
const voiceResponse = new VoiceResponse() ;
const dial = voiceResponse.dial() ;
dial.sip(
`sip:${phoneCallResponse.call_id}@5t4n6j0wnrl.sip.livekit.cloud`,
) ;
res.set("Content-Type", "text/xml") ;
res.send(voiceResponse.toString() ) ;
},
) ;AI Evy
09/08/2025, 3:43 PMAI Evy
09/08/2025, 3:43 PMsip:{call_id}@5t4n6j0wnrl.sip.livekit.cloud
## Important Limitations
With the SIP URI method, you won't be able to use Retell's transfer call feature since Retell doesn't have direct access to your telephony provider . However, you can implement your own transfer logic using custom functions .
## Troubleshooting
If you experience issues where calls ring once and hang up, check your Twilio call logs and ensure your webhook endpoint is properly configured [(3) ]() .AI Evy
09/08/2025, 3:43 PMchris_51769
09/08/2025, 3:44 PMAI Evy
09/08/2025, 3:44 PMAI Evy
09/08/2025, 3:44 PMagent_id in your webhook code, that tells Retell which AI agent should handle the conversation . The call flow works like this:
1. Inbound call comes to your Twilio number
2. Your webhook registers the call with Retell using the specific agent ID
3. Twilio dials the SIP URI with the call_id
4. Your designated Retell AI agent answers and conducts the conversation
The agent you specify in the agent_id parameter when calling the Register Phone Call API is the one that will handle all the voice interactions with your callers .AI Evy
09/08/2025, 3:44 PMAI Evy
09/08/2025, 3:44 PMchris_51769
09/08/2025, 3:45 PMchris_51769
09/08/2025, 3:45 PMAI Evy
09/08/2025, 3:45 PMAI Evy
09/08/2025, 3:46 PMAI Evy
09/08/2025, 3:46 PMAI Evy
09/08/2025, 3:46 PMchris_51769
09/08/2025, 3:48 PMAI Evy
09/08/2025, 3:48 PMAI Evy
09/08/2025, 3:49 PMAI Evy
09/08/2025, 3:49 PMAI Evy
09/08/2025, 3:49 PMchris_51769
09/08/2025, 3:50 PMAI Evy
09/08/2025, 3:50 PMAI Evy
09/08/2025, 3:50 PMAI Evy
09/08/2025, 3:50 PMAI Evy
09/08/2025, 3:50 PMAI Evy
09/08/2025, 3:50 PMchris_51769
09/08/2025, 3:59 PMchris_51769
09/08/2025, 3:59 PMAI Evy
09/08/2025, 3:59 PMAI Evy
09/08/2025, 4:00 PMAI Evy
09/08/2025, 4:00 PMAI Evy
09/08/2025, 4:00 PMchris_51769
09/08/2025, 6:02 PMAI Evy
09/08/2025, 6:02 PMAI Evy
09/08/2025, 6:03 PMAI Evy
09/08/2025, 6:03 PMAI Evy
09/08/2025, 6:03 PMchris_51769
09/08/2025, 6:04 PMAI Evy
09/08/2025, 6:04 PMAI Evy
09/08/2025, 6:05 PM5t4n6j0wnrl.sip.livekit.cloud
## Alternative Solutions
If Elastic SIP Trunking continues to fail, you might need to consider alternative approaches or contact your teleAI Evy
09/08/2025, 6:05 PMAI Evy
09/08/2025, 6:05 PM