Making Outbound Calls with VideoSDK
Outbound SIP calls allow you to connect participants from your VideoSDK meetings to external phone numbers or SIP endpoints (such as Twilio, Vonage, Plivo, Telnyx, etc.). This enables meeting participants to dial out and bring traditional telephony users into the meeting.
Understanding Outbound Call Flow
The diagram above illustrates the complete flow for making outbound SIP calls with VideoSDK:
- Initiate Outbound Call via API:
- An outbound call is triggered from VideoSDK Cloud by making a POST request to
/v2/sip/call
using the API. This can be done programmatically or via the dashboard.
- Routing Rules:
- The call request is processed by the configured Routing Rules, which determine how and where the call should be routed (e.g., to a user or an AI agent) and which outbound gateway to be used.
- Outbound Gateway:
- The call is sent to the Outbound Gateway based on the matched routing rule, which holds the SIP provider configuration (termination address, credentials, etc.).
- SIP Provider:
- The Outbound Gateway sends a SIP INVITE to the configured SIP provider (such as Twilio, Plivo, Telnyx, or Vonage) using the provided authentication credentials.
- User Receives Call:
- The SIP provider places the call to the destination user (phone number or SIP endpoint). The user receives the call and can answer it on their device.
- Connect or Dispatch:
- The SIP user is connected to the VideoSDK meeting room, and an AI Agent is dispatched depending on the routing rule.
Lets start by configuring the outbound gateway.
Configure an Outbound Gateway
To make outbound calls, you must first configure an Outbound Gateway in VideoSDK. The Outbound Gateway holds the configuration for your SIP provider and manages outbound call routing.
Configure your provider
For the provider that you want to use for outbound calls, you need the SIP address and auth credentials of the provider which will be then added to VideoSDK.
Create outbound gateway
Provide the following details when creating an outbound gateway:
-
Gateway Name: A descriptive name for your gateway.
-
Numbers: List of phone numbers associated with your SIP provider.
-
Termination Address: The SIP URI or IP address where outbound calls should be sent.
-
Authentication Credentials: Username and password for your SIP provider.
-
Transport: Protocol to use (e.g., UDP, TCP, TLS).
By default, the SIP server region is automatically selected based on the location nearest to the number being dialed.
If you want to use a specific region, update the outbound gateway using the geoRegion
property via the API:
Available regions are mentioned below:
us002
→ USin001
→ India
Configure using Dashboard
Configure using APIs
You can also create an outbound gateway using the API:
import fetch from 'node-fetch';
const options = {
method: "POST",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name" : "My Outbound Gateway",
"numbers" : ["+12065551234"],
"address" : "sip.myprovider.com",
"transport" : "udp",
"auth" : {"username":"sipuser","password":"sippass"}
}),
};
const url= `https://api.videosdk.live/v2/sip/outbound-gateways`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
Initiate an Outbound Call
Once your outbound gateway is configured, you can initiate outbound calls using the VideoSDK API. This allows you to dial out from a meeting to any external phone number or SIP endpoint.
Use the following API to trigger an outbound call: Parameters:
gatewayId
: ID of the outbound SIP gateway to use.sipCallTo
: The destination phone number (E.164 format).destinationRoomId
: (Optional) The room ID to connect the call to.
import fetch from 'node-fetch';
const options = {
method: "POST",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"gatewayId" : "gw_123456789",
"sipCallTo" : "+14155550123"
}),
};
const url= `https://api.videosdk.live/v2/sip/call`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
{
"message": "Call initiated successfully",
"data": {
"callId": "call_123456789",
"status": "INITIATED",
"roomId": "room_123456",
"sipCallTo": "+14155550123",
"sipCallFrom": "+14155559876",
"gatewayId": "gw_123456789",
"metadata": {
"campaignId": "cmp_123",
"source": "crm"
},
"timelog": [
{
"status": "INITIATED",
"timestamp": "2025-08-21T11:45:00.000Z"
}
]
}
}
All configurations and outbound calls can be managed via the VideoSDK dashboard or automated using the VideoSDK API. For detailed information on each API endpoint, refer to the VideoSDK API Documentation.
Got a Question? Ask us on discord