Create a call control application
Creates a call control application, which defines the webhook endpoints and settings used to control calls on associated connections.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const callControlApplication = await client.callControlApplications.create({
application_name: 'call-router',
webhook_event_url: 'https://example.com',
});
console.log(callControlApplication.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
call_control_application = client.call_control_applications.create(
application_name="call-router",
webhook_event_url="https://example.com",
)
print(call_control_application.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
callControlApplication, err := client.CallControlApplications.New(context.TODO(), telnyx.CallControlApplicationNewParams{
ApplicationName: "call-router",
WebhookEventURL: "https://example.com",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", callControlApplication.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationCreateParams;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CallControlApplicationCreateParams params = CallControlApplicationCreateParams.builder()
.applicationName("call-router")
.webhookEventUrl("https://example.com")
.build();
CallControlApplicationCreateResponse callControlApplication = client.callControlApplications().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
call_control_application = telnyx.call_control_applications.create(
application_name: "call-router",
webhook_event_url: "https://example.com"
)
puts(call_control_application)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$callControlApplication = $client->callControlApplications->create(
applicationName: 'call-router',
webhookEventURL: 'https://example.com',
active: false,
anchorsiteOverride: 'Latency',
callCostInWebhooks: true,
dtmfType: 'Inband',
firstCommandTimeout: true,
firstCommandTimeoutSecs: 10,
inbound: [
'channelLimit' => 10,
'shakenStirEnabled' => true,
'sipSubdomain' => 'example',
'sipSubdomainReceiveSettings' => 'only_my_connections',
],
outbound: [
'channelLimit' => 10, 'outboundVoiceProfileID' => '1293384261075731499'
],
redactDtmfDebugLogging: true,
webhookAPIVersion: '1',
webhookEventFailoverURL: 'https://failover.example.com',
webhookTimeoutSecs: 25,
);
var_dump($callControlApplication);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx call-control-applications create \
--api-key 'My API Key' \
--application-name call-router \
--webhook-event-url https://example.comcurl --request POST \
--url https://api.telnyx.com/v2/call_control_applications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"application_name": "call-router",
"webhook_event_url": "https://example.com",
"active": false,
"anchorsite_override": "Latency",
"dtmf_type": "Inband",
"first_command_timeout": true,
"first_command_timeout_secs": 10,
"inbound": {
"channel_limit": 10,
"shaken_stir_enabled": true,
"sip_subdomain": "example",
"sip_subdomain_receive_settings": "only_my_connections"
},
"outbound": {
"channel_limit": 10,
"outbound_voice_profile_id": "1293384261075731499"
},
"webhook_api_version": "1",
"webhook_event_failover_url": "https://failover.example.com",
"webhook_timeout_secs": 25,
"call_cost_in_webhooks": true,
"redact_dtmf_debug_logging": true
}
'{
"data": {
"active": false,
"anchorsite_override": "Latency",
"application_name": "call-router",
"created_at": "2018-02-02T22:25:27.521Z",
"dtmf_type": "Inband",
"first_command_timeout": true,
"first_command_timeout_secs": 10,
"id": "1293384261075731499",
"inbound": {
"channel_limit": 10,
"shaken_stir_enabled": true,
"sip_subdomain": "example",
"sip_subdomain_receive_settings": "only_my_connections"
},
"outbound": {
"channel_limit": 10,
"outbound_voice_profile_id": "1293384261075731499"
},
"record_type": "call_control_application",
"updated_at": "2018-02-02T22:25:27.521Z",
"webhook_api_version": "1",
"webhook_event_failover_url": "https://failover.example.com",
"webhook_event_url": "https://example.com",
"webhook_timeout_secs": 25,
"call_cost_in_webhooks": false,
"redact_dtmf_debug_logging": true
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Create call control application request.
A user-assigned name to help manage the application.
"call-router"
The URL where webhooks related to this connection will be sent. Must include a scheme, such as 'https'.
"https://example.com"
Specifies whether the connection can be used.
Latency directs Telnyx to route media through the site with the lowest round-trip time to the user's connection. Telnyx calculates this time using ICMP ping messages. This can be disabled by specifying a site to handle all media.
Latency, Chicago, IL, Ashburn, VA, San Jose, CA, London, UK, Chennai, IN, Amsterdam, Netherlands, Toronto, Canada, Sydney, Australia "Amsterdam, Netherlands"
Sets the type of DTMF digits sent from Telnyx to this Connection. Note that DTMF digits sent to Telnyx will be accepted in all formats.
RFC 2833, Inband, SIP INFO "Inband"
Specifies whether calls to phone numbers associated with this connection should hangup after timing out.
true
Specifies how many seconds to wait before timing out a dial command.
10
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Determines which webhook format will be used, Telnyx API v1 or v2.
1, 2 "1"
The failover URL where webhooks related to this connection will be sent if sending to the primary URL fails. Must include a scheme, such as 'https'.
"https://failover.example.com"
Specifies how many seconds to wait before timing out a webhook.
0 <= x <= 3025
Specifies if call cost webhooks should be sent for this Call Control Application.
When enabled, DTMF digits entered by users will be redacted in debug logs to protect PII data entered through IVR interactions.
true
Response
Successful response with details about a call control application.
Show child attributes
Show child attributes
{
"active": false,
"anchorsite_override": "Latency",
"application_name": "call-router",
"created_at": "2018-02-02T22:25:27.521Z",
"dtmf_type": "Inband",
"first_command_timeout": true,
"first_command_timeout_secs": 10,
"id": "1293384261075731499",
"inbound": {
"channel_limit": 10,
"shaken_stir_enabled": true,
"sip_subdomain": "example",
"sip_subdomain_receive_settings": "only_my_connections"
},
"outbound": {
"channel_limit": 10,
"outbound_voice_profile_id": "1293384261075731499"
},
"record_type": "call_control_application",
"updated_at": "2018-02-02T22:25:27.521Z",
"webhook_api_version": "1",
"webhook_event_failover_url": "https://failover.example.com",
"webhook_event_url": "https://example.com",
"webhook_timeout_secs": 25,
"call_cost_in_webhooks": false,
"redact_dtmf_debug_logging": true
}
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const callControlApplication = await client.callControlApplications.create({
application_name: 'call-router',
webhook_event_url: 'https://example.com',
});
console.log(callControlApplication.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
call_control_application = client.call_control_applications.create(
application_name="call-router",
webhook_event_url="https://example.com",
)
print(call_control_application.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
callControlApplication, err := client.CallControlApplications.New(context.TODO(), telnyx.CallControlApplicationNewParams{
ApplicationName: "call-router",
WebhookEventURL: "https://example.com",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", callControlApplication.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationCreateParams;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CallControlApplicationCreateParams params = CallControlApplicationCreateParams.builder()
.applicationName("call-router")
.webhookEventUrl("https://example.com")
.build();
CallControlApplicationCreateResponse callControlApplication = client.callControlApplications().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
call_control_application = telnyx.call_control_applications.create(
application_name: "call-router",
webhook_event_url: "https://example.com"
)
puts(call_control_application)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$callControlApplication = $client->callControlApplications->create(
applicationName: 'call-router',
webhookEventURL: 'https://example.com',
active: false,
anchorsiteOverride: 'Latency',
callCostInWebhooks: true,
dtmfType: 'Inband',
firstCommandTimeout: true,
firstCommandTimeoutSecs: 10,
inbound: [
'channelLimit' => 10,
'shakenStirEnabled' => true,
'sipSubdomain' => 'example',
'sipSubdomainReceiveSettings' => 'only_my_connections',
],
outbound: [
'channelLimit' => 10, 'outboundVoiceProfileID' => '1293384261075731499'
],
redactDtmfDebugLogging: true,
webhookAPIVersion: '1',
webhookEventFailoverURL: 'https://failover.example.com',
webhookTimeoutSecs: 25,
);
var_dump($callControlApplication);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx call-control-applications create \
--api-key 'My API Key' \
--application-name call-router \
--webhook-event-url https://example.comcurl --request POST \
--url https://api.telnyx.com/v2/call_control_applications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"application_name": "call-router",
"webhook_event_url": "https://example.com",
"active": false,
"anchorsite_override": "Latency",
"dtmf_type": "Inband",
"first_command_timeout": true,
"first_command_timeout_secs": 10,
"inbound": {
"channel_limit": 10,
"shaken_stir_enabled": true,
"sip_subdomain": "example",
"sip_subdomain_receive_settings": "only_my_connections"
},
"outbound": {
"channel_limit": 10,
"outbound_voice_profile_id": "1293384261075731499"
},
"webhook_api_version": "1",
"webhook_event_failover_url": "https://failover.example.com",
"webhook_timeout_secs": 25,
"call_cost_in_webhooks": true,
"redact_dtmf_debug_logging": true
}
'{
"data": {
"active": false,
"anchorsite_override": "Latency",
"application_name": "call-router",
"created_at": "2018-02-02T22:25:27.521Z",
"dtmf_type": "Inband",
"first_command_timeout": true,
"first_command_timeout_secs": 10,
"id": "1293384261075731499",
"inbound": {
"channel_limit": 10,
"shaken_stir_enabled": true,
"sip_subdomain": "example",
"sip_subdomain_receive_settings": "only_my_connections"
},
"outbound": {
"channel_limit": 10,
"outbound_voice_profile_id": "1293384261075731499"
},
"record_type": "call_control_application",
"updated_at": "2018-02-02T22:25:27.521Z",
"webhook_api_version": "1",
"webhook_event_failover_url": "https://failover.example.com",
"webhook_event_url": "https://example.com",
"webhook_timeout_secs": 25,
"call_cost_in_webhooks": false,
"redact_dtmf_debug_logging": true
}
}