https://retellai.com/?utm_source=discord&utm_medium=seo logo
I just noticed that sometimes calls do NOT go thro...
# ❓・ai-evy-support
j
@AI Evy I just noticed that sometimes calls do NOT go through! I'm using dial to SIP, and sometimes a call does not seem to connect; the phone just keeps ringing and then hangs up! How do I prevent this from ever, EVER happening?
a
Thanks for tagging me @jarnold5539. I'll look through relevant sources and get back to you shortly.
### Answer When using the Dial to SIP method, there are several potential causes for call connection failures [(1) ]() . Here are the key debugging steps and preventive measures: Check Call Disconnection Status You can identify why calls are failing by checking the disconnection reason through the Retell Dashboard or using the get-call API endpoint [(2) ]() . Common reasons for failed connections include : - `dial_failed`: Outbound call not connected, dialing failed with no or unknown sip error code - `dial_no_answer`: Outbound call not connected, the number dialed did not answer - `invalid_destination`: Outbound call not connected, the number dialed is invalid - `telephony_provider_unavailable`: Outbound call not connected, the telephony provider is unavailable - `sip_routing_error`: Outbound call not connected, the sip routing is going over too many hops or is in a loop Ensure Correct Implementation Make sure you're using the correct endpoint for registering phone calls [(3) ]() . The correct endpoint is:
Copy code
POST <https://api.retellai.com/v2/register-phone-call>
With the proper structure :
Copy code
json
{
  "agent_id": "agent_58d95b423e3d1a7825ab3d8351",
  "from_number": "+573001234567",
  "to_number": "+573009876543",
  "direction": "inbound"
}
Address Known Timing Issues There can be about a 1 second delay between the customer picking up and the AI agent being connected when using Dial to SIP [(4) ]() . This delay is caused by the normal time it takes RTP to fully establish between SIP gateways . Prevent Duplicate Calls Some telephony providers like Twilio can call webhooks multiple times for a single call [(1) ]() . You need to dedupe calls in your code to prevent creating multiple entries for a single dial . Firewall Considerations When you send the call to Retell, the return
200 OK
may originate from a different IP than the one you signaled, so you may need to open firewall rules for proper connectivity [(5) ]() . To minimize connection failures, implement proper error handling, ensure your webhook deduplication logic is working correctly, and monitor the call disconnection reasons to identify patterns in your failures.
​ To learn more, see the sources I considered: [[1] Custom Telephony Overview](https://docs.retellai.com/deploy/custom-telephony) [[2] Debug call disconnection](https://docs.retellai.com/reliability/debug-call-disconnect) [[3] How Get only call_id, for dial to sip?](https://discord.com/channels/1186424376300679209/1385238437413654578) [[4] Connection delay when using the Dial to SIP Endpoint option](https://discord.com/channels/1186424376300679209/1362490232225792001) [[5] DIAL TO SIP](https://discord.com/channels/1186424376300679209/1384533664502906950) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
This is all inbound. @AI Evy
a
Thanks for the follow-up, @jarnold5539. I'll get back to you soon.
### Answer For inbound calls using the Dial to SIP method, here are the key factors to ensure reliable connection: Proper Call Registration When using Method 2: Dial to SIP URI, you need to register the phone call first using the correct endpoint [(1) ]() :
Copy code
POST <https://api.retellai.com/v2/register-phone-call>
With the proper JSON structure :
Copy code
json
{
  "agent_id": "agent_58d95b423e3d1a7825ab3d8351",
  "from_number": "+573001234567",
  "to_number": "+573009876543",
  "direction": "inbound"
}
SIP URI Configuration After receiving the call_id, construct the SIP URI as [(2) ]() , [(1) ]() :
Copy code
sip:{call_id}@5t4n6j0wnrl.sip.livekit.cloud
[(2) ]() , [(1) ]() The SIP domain
5t4n6j0wnrl.sip.livekit.cloud
is fixed for all accounts . Network Requirements Retell's SIP server supports multiple transport methods [(2) ]() : - UDP - TCP - TLS Media encryption supported : - SRTP IP Whitelisting For United States traffic, use the IP block
143.223.88.0/21
,
161.115.160.0/19
for whitelisting traffic to Retell's SIP server . This is commonly needed by telephony providers . Preventing Connection Issues The Dial to SIP method requires that your telephony provider dial the call to the specific SIP URI after you register it . If calls are not connecting consistently, verify that your PBX or telephony system is properly configured to dial the generated SIP URI immediately after registration.
​ To learn more, see the sources I considered: [[1] How Get only call_id, for dial to sip?](https://discord.com/channels/1186424376300679209/1385238437413654578) [[2] 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.