Create Inbound SIP Gateway - API
Creates a new inbound SIP gateway for the authenticated user. Requires a unique name and at least one number. Additional configuration options like authentication, media settings, and metadata can also be provided.
HTTP method and endpoint
POST
|
https://api.videosdk.live/v2/sip/inbound-gatewaysHeaders Parameters
REQUIRED
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
Name of the inbound SIP gateway.
REQUIRED
Array of phone numbers associated with the gateway.
OPTIONAL
Authentication configuration (username/password) for the SIP gateway.
OPTIONAL
Array of SIP addresses allowed to connect.
OPTIONAL
Array of phone numbers allowed to connect.
OPTIONAL
Media encryption setting (
disable
, enable
). OPTIONAL
Whether to enable call recording.
OPTIONAL
Whether to enable noise cancellation.
OPTIONAL
Custom metadata for the gateway.
OPTIONAL
Array of tags for the gateway.
Response Parameters
Unique identifier for the inbound SIP gateway.
Name of the SIP gateway.
Array of phone numbers associated with the gateway.
Array of SIP addresses allowed to connect.
Array of phone numbers allowed to connect.
Media encryption setting for the SIP gateway.
Indicates if calls should be recorded.
Indicates if noise cancellation is enabled.
Tags associated with the gateway.
Authentication configuration for the gateway.
Geographical region (if set).
Custom metadata for the gateway.
POST
|
https://api.videosdk.live/v2/sip/inbound-gateways
NodeJS
import fetch from 'node-fetch';
const options = {
method: "POST",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name" : "Twilio Inbound Gateway",
"numbers" : ["+11234567890","+19876543210"],
"auth" : {"username":"sip_user","password":"••••••••"},
"allowedAddresses" : ["sip:trusted.example.com"],
"allowedNumbers" : ["+14150001111"],
"mediaEncryption" : "disable",
"record" : "false",
"noiseCancellation" : "true",
"metadata" : {"env":"production"},
"tags" : ["production","twilio"]
}),
};
const url= `https://api.videosdk.live/v2/sip/inbound-gateways`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"id": "gateway_123456789",
"name": "Twilio Inbound Gateway",
"numbers": [
"+11234567890"
],
"allowedAddresses": [
"sip:trusted.example.com"
],
"allowedNumbers": [
"+14150001111"
],
"mediaEncryption": "disable",
"transport": "udp",
"record": false,
"tags": [
"production",
"twilio"
],
"auth": {
"username": "sip_user",
"password": "••••••••"
},
"geoRegion": "in001",
"metadata": {
"env": "production"
},
"noiseCancellation": true
}
Got a Question? Ask us on discord