Skip to main content
POST
/
v1.0
/
voice
/
routes
json
{
  "RouteName": "Main SIP Trunk",
  "RouteType": "Trunk",
  "VoiceUrl": "https://domain.com",
  "VoiceUrlMethod": "POST",
  "VoiceAuthenticationType": "Basic",
  "VoiceUsername": "admin",
  "VoicePasswordToken": "passwordORbearerToken",
  "CallbackVoiceUrl": "https://apiendpoint.com",
  "CallbackVoiceUrlMethod": "POST",
  "TrunkIp1": "20.87.87.87",
  "TrunkIp2": "20.87.87.86",
  "TrunkPort1": "5061",
  "TrunkPort2": "5060",
  "TrunkTransport1": "UDP",
  "TrunkTransport2": "TCP",
  "TrunkUri1": "https://pstn.joonto.com",
  "TrunkUri2": "https://pstn2.joonto.com",
  "TrunkEnabled1": true,
  "TrunkEnabled2": false,
  "Trunk1Priortiy": 10,
  "Trunk1Weight": 10,
  "Trunk2Priortiy": 20,
  "Trunk2Weight": 20,
  "HeaderManipulation": "HMI8802029",
  "EnableSipRefer": true,
  "TransferCallerId": "Transferee/Transferor",
  "SymmetricRtp": true,
  "EnableTrpSecureTrunk": true,
  "EnablePstnTransfer": true,
  "IpWhitelist": [{"IpAddress": "20.20.10.10"}, {"IpAddress": "20.20.10.20"}],
  "CnamLookup": true,
  "TerminationUriSubdomain": "client",
  "EnableCallStreaming": true,
  "WssUri": "wss://192.67.88.2",
  "IntelligentRouteEnabled": true,
  "RouteEnabled": true
}
curl -X POST https://api.telegent.com/v1.0/voice/routes \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"RouteName": "Main SIP Trunk",
"RouteType": "Trunk",
"VoiceUrl": "https://domain.com",
"VoiceUrlMethod": "POST",
"TrunkIp1": "20.87.87.87",
"TrunkPort1": "5061",
"TrunkTransport1": "UDP",
"RouteEnabled": true
}'
import requests

url = "https://api.telegent.com/v1.0/voice/routes"

payload = {
"RouteName": "Main SIP Trunk",
"RouteType": "Trunk",
"VoiceUrl": "https://domain.com",
"VoiceUrlMethod": "POST",
"VoiceUsername": "admin",
"VoicePasswordToken": "passwordORbearerToken",
"CallbackVoiceUrl": "https://apiendpoint.com",
"CallbackVoiceUrlMethod": "POST",
"TrunkIp1": "20.87.87.87",
"TrunkIp2": "20.87.87.86",
"TrunkPort1": "5061",
"TrunkPort2": "5060",
"TrunkTransport1": "UDP",
"TrunkTransport2": "TCP",
"TrunkUri1": "https://pstn.joonto.com",
"TrunkUri2": "https://pstn2.joonto.com",
"TrunkEnabled1": True,
"TrunkEnabled2": False,
"Trunk1Priortiy": 10,
"Trunk1Weight": 10,
"Trunk2Priortiy": 20,
"Trunk2Weight": 20,
"HeaderManipulation": "HMI8802029",
"EnableSipRefer": True,
"TransferCallerId": "Transferee/Transferor",
"SymmetricRtp": True,
"EnableTrpSecureTrunk": True,
"EnablePstnTransfer": True,
"IpWhitelist": [{ "IpAddress": "20.20.10.10" }],
"CnamLookup": True,
"TerminationUriSubdomain": "client",
"EnableCallStreaming": True,
"WssUri": "wss://192.67.88.2",
"RouteEnabled": True,
"IntelligentRouteEnabled": True,
"AccountId": "DID-1e8939ab-3f3c-4db1-89d7-956d80fd793j"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
RouteName: 'Main SIP Trunk',
RouteType: 'Trunk',
VoiceUrl: 'https://domain.com',
VoiceUrlMethod: 'POST',
VoiceUsername: 'admin',
VoicePasswordToken: 'passwordORbearerToken',
CallbackVoiceUrl: 'https://apiendpoint.com',
CallbackVoiceUrlMethod: 'POST',
TrunkIp1: '20.87.87.87',
TrunkIp2: '20.87.87.86',
TrunkPort1: '5061',
TrunkPort2: '5060',
TrunkTransport1: 'UDP',
TrunkTransport2: 'TCP',
TrunkUri1: 'https://pstn.joonto.com',
TrunkUri2: 'https://pstn2.joonto.com',
TrunkEnabled1: true,
TrunkEnabled2: false,
Trunk1Priortiy: 10,
Trunk1Weight: 10,
Trunk2Priortiy: 20,
Trunk2Weight: 20,
HeaderManipulation: 'HMI8802029',
EnableSipRefer: true,
TransferCallerId: 'Transferee/Transferor',
SymmetricRtp: true,
EnableTrpSecureTrunk: true,
EnablePstnTransfer: true,
IpWhitelist: [{IpAddress: '20.20.10.10'}],
CnamLookup: true,
TerminationUriSubdomain: 'client',
EnableCallStreaming: true,
WssUri: 'wss://192.67.88.2',
RouteEnabled: true,
IntelligentRouteEnabled: true,
AccountId: 'DID-1e8939ab-3f3c-4db1-89d7-956d80fd793j'
})
};

fetch('https://api.telegent.com/v1.0/voice/routes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.telegent.com/v1.0/voice/routes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'RouteName' => 'Main SIP Trunk',
'RouteType' => 'Trunk',
'VoiceUrl' => 'https://domain.com',
'VoiceUrlMethod' => 'POST',
'VoiceUsername' => 'admin',
'VoicePasswordToken' => 'passwordORbearerToken',
'CallbackVoiceUrl' => 'https://apiendpoint.com',
'CallbackVoiceUrlMethod' => 'POST',
'TrunkIp1' => '20.87.87.87',
'TrunkIp2' => '20.87.87.86',
'TrunkPort1' => '5061',
'TrunkPort2' => '5060',
'TrunkTransport1' => 'UDP',
'TrunkTransport2' => 'TCP',
'TrunkUri1' => 'https://pstn.joonto.com',
'TrunkUri2' => 'https://pstn2.joonto.com',
'TrunkEnabled1' => true,
'TrunkEnabled2' => false,
'Trunk1Priortiy' => 10,
'Trunk1Weight' => 10,
'Trunk2Priortiy' => 20,
'Trunk2Weight' => 20,
'HeaderManipulation' => 'HMI8802029',
'EnableSipRefer' => true,
'TransferCallerId' => 'Transferee/Transferor',
'SymmetricRtp' => true,
'EnableTrpSecureTrunk' => true,
'EnablePstnTransfer' => true,
'IpWhitelist' => [
[
'IpAddress' => '20.20.10.10'
]
],
'CnamLookup' => true,
'TerminationUriSubdomain' => 'client',
'EnableCallStreaming' => true,
'WssUri' => 'wss://192.67.88.2',
'RouteEnabled' => true,
'IntelligentRouteEnabled' => true,
'AccountId' => 'DID-1e8939ab-3f3c-4db1-89d7-956d80fd793j'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.telegent.com/v1.0/voice/routes"

payload := strings.NewReader("{\n \"RouteName\": \"Main SIP Trunk\",\n \"RouteType\": \"Trunk\",\n \"VoiceUrl\": \"https://domain.com\",\n \"VoiceUrlMethod\": \"POST\",\n \"VoiceUsername\": \"admin\",\n \"VoicePasswordToken\": \"passwordORbearerToken\",\n \"CallbackVoiceUrl\": \"https://apiendpoint.com\",\n \"CallbackVoiceUrlMethod\": \"POST\",\n \"TrunkIp1\": \"20.87.87.87\",\n \"TrunkIp2\": \"20.87.87.86\",\n \"TrunkPort1\": \"5061\",\n \"TrunkPort2\": \"5060\",\n \"TrunkTransport1\": \"UDP\",\n \"TrunkTransport2\": \"TCP\",\n \"TrunkUri1\": \"https://pstn.joonto.com\",\n \"TrunkUri2\": \"https://pstn2.joonto.com\",\n \"TrunkEnabled1\": true,\n \"TrunkEnabled2\": false,\n \"Trunk1Priortiy\": 10,\n \"Trunk1Weight\": 10,\n \"Trunk2Priortiy\": 20,\n \"Trunk2Weight\": 20,\n \"HeaderManipulation\": \"HMI8802029\",\n \"EnableSipRefer\": true,\n \"TransferCallerId\": \"Transferee/Transferor\",\n \"SymmetricRtp\": true,\n \"EnableTrpSecureTrunk\": true,\n \"EnablePstnTransfer\": true,\n \"IpWhitelist\": [\n {\n \"IpAddress\": \"20.20.10.10\"\n }\n ],\n \"CnamLookup\": true,\n \"TerminationUriSubdomain\": \"client\",\n \"EnableCallStreaming\": true,\n \"WssUri\": \"wss://192.67.88.2\",\n \"RouteEnabled\": true,\n \"IntelligentRouteEnabled\": true,\n \"AccountId\": \"DID-1e8939ab-3f3c-4db1-89d7-956d80fd793j\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.telegent.com/v1.0/voice/routes")
.header("Content-Type", "application/json")
.body("{\n \"RouteName\": \"Main SIP Trunk\",\n \"RouteType\": \"Trunk\",\n \"VoiceUrl\": \"https://domain.com\",\n \"VoiceUrlMethod\": \"POST\",\n \"VoiceUsername\": \"admin\",\n \"VoicePasswordToken\": \"passwordORbearerToken\",\n \"CallbackVoiceUrl\": \"https://apiendpoint.com\",\n \"CallbackVoiceUrlMethod\": \"POST\",\n \"TrunkIp1\": \"20.87.87.87\",\n \"TrunkIp2\": \"20.87.87.86\",\n \"TrunkPort1\": \"5061\",\n \"TrunkPort2\": \"5060\",\n \"TrunkTransport1\": \"UDP\",\n \"TrunkTransport2\": \"TCP\",\n \"TrunkUri1\": \"https://pstn.joonto.com\",\n \"TrunkUri2\": \"https://pstn2.joonto.com\",\n \"TrunkEnabled1\": true,\n \"TrunkEnabled2\": false,\n \"Trunk1Priortiy\": 10,\n \"Trunk1Weight\": 10,\n \"Trunk2Priortiy\": 20,\n \"Trunk2Weight\": 20,\n \"HeaderManipulation\": \"HMI8802029\",\n \"EnableSipRefer\": true,\n \"TransferCallerId\": \"Transferee/Transferor\",\n \"SymmetricRtp\": true,\n \"EnableTrpSecureTrunk\": true,\n \"EnablePstnTransfer\": true,\n \"IpWhitelist\": [\n {\n \"IpAddress\": \"20.20.10.10\"\n }\n ],\n \"CnamLookup\": true,\n \"TerminationUriSubdomain\": \"client\",\n \"EnableCallStreaming\": true,\n \"WssUri\": \"wss://192.67.88.2\",\n \"RouteEnabled\": true,\n \"IntelligentRouteEnabled\": true,\n \"AccountId\": \"DID-1e8939ab-3f3c-4db1-89d7-956d80fd793j\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.telegent.com/v1.0/voice/routes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"RouteName\": \"Main SIP Trunk\",\n \"RouteType\": \"Trunk\",\n \"VoiceUrl\": \"https://domain.com\",\n \"VoiceUrlMethod\": \"POST\",\n \"VoiceUsername\": \"admin\",\n \"VoicePasswordToken\": \"passwordORbearerToken\",\n \"CallbackVoiceUrl\": \"https://apiendpoint.com\",\n \"CallbackVoiceUrlMethod\": \"POST\",\n \"TrunkIp1\": \"20.87.87.87\",\n \"TrunkIp2\": \"20.87.87.86\",\n \"TrunkPort1\": \"5061\",\n \"TrunkPort2\": \"5060\",\n \"TrunkTransport1\": \"UDP\",\n \"TrunkTransport2\": \"TCP\",\n \"TrunkUri1\": \"https://pstn.joonto.com\",\n \"TrunkUri2\": \"https://pstn2.joonto.com\",\n \"TrunkEnabled1\": true,\n \"TrunkEnabled2\": false,\n \"Trunk1Priortiy\": 10,\n \"Trunk1Weight\": 10,\n \"Trunk2Priortiy\": 20,\n \"Trunk2Weight\": 20,\n \"HeaderManipulation\": \"HMI8802029\",\n \"EnableSipRefer\": true,\n \"TransferCallerId\": \"Transferee/Transferor\",\n \"SymmetricRtp\": true,\n \"EnableTrpSecureTrunk\": true,\n \"EnablePstnTransfer\": true,\n \"IpWhitelist\": [\n {\n \"IpAddress\": \"20.20.10.10\"\n }\n ],\n \"CnamLookup\": true,\n \"TerminationUriSubdomain\": \"client\",\n \"EnableCallStreaming\": true,\n \"WssUri\": \"wss://192.67.88.2\",\n \"RouteEnabled\": true,\n \"IntelligentRouteEnabled\": true,\n \"AccountId\": \"DID-1e8939ab-3f3c-4db1-89d7-956d80fd793j\"\n}"

response = http.request(request)
puts response.read_body
{
  "CallRouteId": "CRID-509de94f-79cc-429b-a317-2102654dabbb",
  "AccountId": "AID-ab12345-2725-45a1-bd5e-526ed19799xx",
  "RouteName": "Main SIP Trunk",
  "RouteType": "Trunk",
  "VoiceUrl": "https://domain.com",
  "VoiceUrlMethod": "POST",
  "TrunkIp1": "20.87.87.87",
  "TrunkIp2": "20.87.87.86",
  "TrunkPort1": "5061",
  "TrunkPort2": "5060",
  "TrunkTransport1": "UDP",
  "TrunkTransport2": "TCP",
  "TrunkUri1": "https://pstn.joonto.com",
  "TrunkUri2": "https://pstn2.joonto.com",
  "TrunkEnabled1": true,
  "TrunkEnabled2": false,
  "Trunk1Priortiy": 10,
  "Trunk1Weight": 10,
  "Trunk2Priortiy": 20,
  "Trunk2Weight": 20,
  "HeaderManipulation": "HMI8802029",
  "EnableSipRefer": true,
  "TransferCallerId": "Transferee/Transferor",
  "SymmetricRtp": true,
  "EnableTrpSecureTrunk": true,
  "EnablePstnTransfer": true,
  "CnamLookup": true,
  "TerminationUriSubdomain": "client",
  "EnableCallStreaming": true,
  "WssUri": "wss://192.67.88.2",
  "IntelligentRouteEnabled": true,
  "RouteEnabled": true,
  "IpWhiteList": []
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}

Body

application/json
RouteName
string
required

Friendly name for voice route

Example:

"Main SIP Trunk"

RouteType
enum<string>
required

Type of voice routing

Available options:
Trunk,
URL,
Forward
Example:

"Trunk"

VoiceUrl
string<uri>

Webhook URL for voice events

Example:

"https://domain.com"

VoiceUrlMethod
enum<string>

HTTP method for voice URL

Available options:
GET,
POST
Example:

"POST"

VoiceAuthenticationType
enum<string>

Authentication type

Available options:
None,
Basic,
Bearer
VoiceUsername
string

Username for auth

Example:

"admin"

VoicePasswordToken
string

Password or token

Example:

"passwordORbearerToken"

CallbackVoiceUrl
string<uri>

Callback URL

Example:

"https://apiendpoint.com"

CallbackVoiceUrlMethod
enum<string>
Available options:
GET,
POST
Example:

"POST"

TrunkIp1
string

Primary SIP trunk IP

Example:

"20.87.87.87"

TrunkIp2
string

Secondary SIP trunk IP

Example:

"20.87.87.86"

TrunkPort1
string

Primary trunk port

Example:

"5061"

TrunkPort2
string

Secondary trunk port

Example:

"5060"

TrunkTransport1
enum<string>

Primary transport protocol

Available options:
UDP,
TCP,
TLS
Example:

"UDP"

TrunkTransport2
enum<string>

Secondary transport protocol

Available options:
UDP,
TCP,
TLS
Example:

"TCP"

TrunkUri1
string<uri>
Example:

"https://pstn.joonto.com"

TrunkUri2
string<uri>
Example:

"https://pstn2.joonto.com"

TrunkEnabled1
boolean

Enable primary trunk

Example:

true

TrunkEnabled2
boolean

Enable secondary trunk

Example:

false

Trunk1Priortiy
integer

Priority for trunk 1

Example:

10

Trunk1Weight
integer

Weight for trunk 1

Example:

10

Trunk2Priortiy
integer

Priority for trunk 2

Example:

20

Trunk2Weight
integer

Weight for trunk 2

Example:

20

HeaderManipulation
string

Header manipulation ID

Example:

"HMI8802029"

EnableSipRefer
boolean

Enable SIP REFER

Example:

true

TransferCallerId
string

Caller ID for transfers

Example:

"Transferee/Transferor"

SymmetricRtp
boolean

Enable symmetric RTP

Example:

true

EnableTrpSecureTrunk
boolean

Enable secure trunk

Example:

true

EnablePstnTransfer
boolean

Enable PSTN transfer

Example:

true

IpWhitelist
object[]

IP whitelist

CnamLookup
boolean

Enable CNAM lookup

Example:

true

TerminationUriSubdomain
string

Termination URI subdomain

Example:

"client"

EnableCallStreaming
boolean

Enable call streaming

Example:

true

WssUri
string<uri>

WebSocket secure URI

Example:

"wss://192.67.88.2"

RouteEnabled
boolean

Enable/disable route

Example:

true

IntelligentRouteEnabled
boolean

Enable intelligent routing features for this voice route

Example:

true

AccountId
string

Account ID to associate with this voice route

Example:

"DID-1e8939ab-3f3c-4db1-89d7-956d80fd793j"

Response

Success — returns the newly created Voice Route ID (CRID)

The response is of type object.