Skip to main content
Version: /v2

Create Outbound SIP Gateway - API

Creates a new outbound SIP gateway for the authenticated user. Outbound gateways are used to route calls to external SIP endpoints.

HTTP method and endpoint

POST

|

https://api.videosdk.live/v2/sip/outbound-gateways
Headers Parameters

values : YOUR_TOKEN_WITHOUT_ANY_PREFIX

This will be a JWT token generate using VideoSDK ApiKey and Secret.

Note that the token will not include any prefix such as "Basic " or "Bearer ". Just pass a token as value.

You can generate a new token by refering this Guide: Generate Auth token

REQUIRED

values : application/json

This is usefull for json body parameters, so that VideoSDK servers can understand that the incoming body parameter will be a JSON string.

Body Parameters
REQUIRED
Friendly name for the SIP gateway.
REQUIRED
Array of phone numbers associated with this gateway.
REQUIRED
SIP server address of the outbound gateway.
REQUIRED
Region where the gateway is hosted (e.g., us001, eu001).
REQUIRED
Transport protocol used by the gateway (udp, tcp, tls).
Enable or disable media encryption (e.g., sdes, dtls, none).
OPTIONAL
Enable call recording.
Enable noise cancellation for outbound calls.
OPTIONAL
Authentication details (username/password) for SIP provider.
Whether to include custom headers in SIP INVITE.
OPTIONAL
Custom SIP headers to include in outbound calls.
Map SIP headers to attributes for call tracking.
OPTIONAL
Custom metadata object for internal use.
OPTIONAL
Array of tags for categorizing the gateway.
Response Parameters
Unique identifier of the created gateway.
Name of the gateway.
Numbers associated with this gateway.
SIP server address.
Region of the gateway.
Transport protocol.
Authentication details (if provided).
Media encryption type.
Recording flag.
Noise cancellation flag.
Metadata object.
Tags associated with the gateway.
POST
|
https://api.videosdk.live/v2/sip/outbound-gateways
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",
"geoRegion" : "us001",
"transport" : "udp",
"mediaEncryption" : "dtls",
"record" : "true",
"noiseCancellation" : "false",
"auth" : {"username":"sipuser","password":"sippass"},
"includeHeaders" : "true",
"headers" : {"X-Custom-Header":"value"},
"headersToAttributes" : {"X-Account-ID":"accountId"},
"metadata" : {"project":"demo"},
"tags" : ["production","outbound"]
}),
};
const url= `https://api.videosdk.live/v2/sip/outbound-gateways`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"gatewayId": "gateway_123456789",
"name": "My Outbound Gateway",
"numbers": [
"+12065551234"
],
"address": "sip.myprovider.com",
"geoRegion": "us001",
"transport": "udp",
"auth": {
"username": "sipuser"
},
"mediaEncryption": "dtls",
"record": true,
"noiseCancellation": false,
"metadata": {
"project": "demo"
},
"tags": [
"production",
"outbound"
]
}

Got a Question? Ask us on discord