Custom Telephony Overview
A step by step guide to integrate custom telephony providers
Overview
In this guide, we will show how to integrate Retell agents with your telephony providers and use your numbers. Please note that this is independent of the agent type you are using.
We will provide two ways to integrate with your telephony provider:
- Elastic SIP trunking: This is the recommended way to integrate with your telephony provider that supports elastic SIP trunking. You will need to set up a SIP trunking and configure your number to point to it, and then import that number to Retell.
- Dial to SIP URI: If your telephony provider does not support elastic SIP trunking, or you have more complicated telephony setup that cannot use elastic SIP trunking, you can dial the call to a specific SIP uri.
- Retell SIP server uri:
sip:5t4n6j0wnrl.sip.livekit.cloud
We are partnering with Livekit on SIP infrastructure (signaling, media transport). Currently there’s no static IP address for the SIP server, as it’s deployed globally across different cloud.
Transport method supported:
- UDP
- TCP
- TLS
Media encryption supported:
- SRTP
Method 1: Elastic SIP trunking (Recommended)
Elastic SIP Trunking is a service offered by cloud communications platforms that enables organizations to connect their existing PBX (Private Branch Exchange) or VoIP (Voice over IP) infrastructure to the Public Switched Telephone Network (PSTN) over the internet using the SIP (Session Initiation Protocol).
In this context, the elastic SIP trunking is used to connect Retell’s VoIP with PSTN so that your agents can make and receive calls. When using this method, all the telephony functionalities that are supported by Retell numbers will also be supported here, assuming that your telephony provider supports it.
SIP trunking is a popular service offered by many telephony providers, so most likely your telephony provider would be able to support this.
Here’re detailed guides for some telephony providers:
Getting help
If you are using a telephony provider that requires static IP address, or you are having trouble setting up, you can check out our partner Jambonz, where you can connect to Jambonz’s system that already connects with Retell (which supports static IP address) and use their SIP trunking service. Dedicated slack support channel is available for Retell users.
FAQ
Will it throw errors if the details or configuration is incorrect?
Will it throw errors if the details or configuration is incorrect?
No, Retell will not be able to know if the setup you provide works or not until a call is made.
My inbound call is not connecting, what should I do?
My inbound call is not connecting, what should I do?
Please check your origination setting in your SIP trunking provider. Also check the logs in your telephony provider, and perhaps open a ticket with them.
My outbound call is not connecting, what should I do?
My outbound call is not connecting, what should I do?
Please check your termination setting in your SIP trunking provider, and make sure you provide the right termination url to Retell. Also check the logs in your telephony provider, and perhaps open a ticket with them.
Will I be able to transfer call using SIP trunking?
Will I be able to transfer call using SIP trunking?
Yes you can use the transfer call feature with SIP trunking. Please note that if you intend to use SIP REFER (cold transfer with the transferee’s number), you will need to configure that in your SIP trunking provider to allow SIP REFER and PSTN transfer, with the transferee’s number showing as caller id.
Will I be able to press digit using SIP trunking?
Will I be able to press digit using SIP trunking?
Yes, you can.
Can I view and manage the numbers I import using SIP trunking?
Can I view and manage the numbers I import using SIP trunking?
Yes, you can.
I need to change the configuration of the imported number, how can I do that?
I need to change the configuration of the imported number, how can I do that?
Right now you’d need to delete and re-import the number.
Method 2: Dial to SIP URI
If your telephony provider does not support elastic SIP trunking, or you have more complicated telephony setup that cannot use elastic SIP trunking, you can use this method.
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. This would require you to have some codes to handle integration with your telephony provider. All traffic looks like inbound to Retell in this case, so it’s up to you to specify the call direction.
Here we assume you already have your call handling setup.
For Retell to know what agent to use to handle the call, and for you to
obtain SIP URI to use for this call, you would call the
Register Phone Call API.
You will get a call_id
back from this API, and you would use it to piece
together the SIP URI.
sip:{call_id}@5t4n6j0wnrl.sip.livekit.cloud
Example Code
Here’s an overly simplified example code to handle the inbound call webhook from Twilio and dialing the call to the SIP URI.
FAQ
How to transfer call/end call using dial to SIP method?
How to transfer call/end call using dial to SIP method?
You will need to handle the transfer call/end call logic yourself, meaning that you will need to write a custom function which internally interacts with your telephony provider to transfer the call/end the call.
Will I be able to press digit using dial to SIP method?
Will I be able to press digit using dial to SIP method?
Yes.
Two entries created for a single dial?
Two entries created for a single dial?
Check your code that interacts with telephony provider. Some provider like Twilio can call the webhook multiple times for a single call. In those cases, you will need to dedupe the call.
Can I use telephony provider's other features like AMD detection using this method?
Can I use telephony provider's other features like AMD detection using this method?
Yes, using this method basically gives you full control over telephony functionalities, so you should be able to use telephony provider’s other features.
###🎦 Video Tutorial Use connecting to custom twilio as an example.