Integrating Twilio as a SIP Provider with VideoSDK
This guide walks you through connecting Twilio as your SIP provider to VideoSDK for both inbound and outbound calling.
Configuring Inbound Calling
1. Purchase a Number and Create a SIP Trunk in Twilio
- Log in to your Twilio Console.
- Purchase a phone number if you don't already have one.
- Create a new SIP Trunk in the Twilio Voice section.
2. Configure Inbound Gateway in VideoSDK
- Open the VideoSDK Dashboard.
- Go to Telephony > Inbound Gateway.
- Click Add Gateway and enter your Twilio number to create an inbound gateway.
- After creation, you will see an Inbound Gateway URI (e.g.,
sip:your-org-id.sip.videosdk.live
). Copy this URI.
3. Configure Twilio SIP Trunk Origination
- In your Twilio SIP Trunk, go to the Origination section.
- Add the copied Inbound Gateway URI as the Origination target.
- Save your changes.
Video Demonstration: Inbound Configuration
Configuring Outbound Calling
4. Configure Twilio SIP Trunk Termination
- In your Twilio SIP Trunk, go to the Termination section.
- Set up the Termination SIP URI (the address VideoSDK will use for outbound calls).
- Add allowed IP addresses and set up authentication credentials (username and password) for the trunk.
5. Configure Outbound Gateway in VideoSDK
- In the VideoSDK Dashboard, go to Telephony > Outbound Gateway.
- Click Add Gateway and enter the Twilio Termination URI and authentication credentials.
- Save the gateway.
6. Set Up Routing Rules
- In the VideoSDK Dashboard, go to Telephony > Routing Rules.
- Create routing rules for both inbound and outbound calls, selecting the appropriate gateways and numbers.
Video Demonstration: Outbound Configuration
With these steps, your SIP trunk between Twilio and VideoSDK is fully configured for both inbound and outbound calls.
Got a Question? Ask us on discord