With Twilio SIP, it’s simple to connect to Twilio from your SIP endpoints to start building apps. Use your existing SIP gateways and IP PBXs to initiate SIP sessions with Twilio and use TwiML and the REST APIs to control your voice applications. Twilio sits in the middle, able to route calls over SIP, the standard carrier network, or even into browsers and mobile apps.
To connect to Twilio with SIP, you need to create and configure a Twilio SIP Domain. A SIP Domain is a custom domain name on Twilio to which you route your SIP requests. When a SIP request hits your SIP domain, Twilio requests TwiML from your server and then executes the instructions you’ve provided in the TwiML.
Before you start sending SIP to Twilio, you first need to go through the following steps:
A SIP domain is required to use at least one of the built-in authentication methods. When setting up your SIP Domain on Twilio.com, you will be guided through setting up an authentication method: IP Access Control List or Credential List.
Twilio’s SIP IPs need to be whitelisted by you so that we can send SIP traffic back to your endpoint. You will also need to whitelist port 10000 to 20000 for RTP traffic so that the audio of the calls can reach your system.
Now that Twilio’s IPs and ports are whitelisted in your system and your SIP Domain is configured, you can send SIP requests to Twilio. If you used the URL from Step 1, you will hear: “Congratulations! You just made your first call with Twilio SIP.”