telnyx-voice-java

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- 由Telnyx OpenAPI规范自动生成,请勿编辑。 -->

Telnyx Voice - Java

Telnyx Voice - Java

Installation

安装

text
// See https://github.com/team-telnyx/telnyx-java for Maven/Gradle setup
text
// 详见 https://github.com/team-telnyx/telnyx-java 获取Maven/Gradle配置方法

Setup

初始化

java
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

TelnyxClient client = TelnyxOkHttpClient.fromEnv();
All examples below assume
client
is already initialized as shown above.
java
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

TelnyxClient client = TelnyxOkHttpClient.fromEnv();
以下所有示例均假设
client
已按上述方式完成初始化。

Answer call

接听呼叫

Answer an incoming call.
POST /calls/{call_control_id}/actions/answer
Optional:
billing_group_id
(uuid),
client_state
(string),
command_id
(string),
custom_headers
(array[object]),
preferred_codecs
(enum),
record
(enum),
record_channels
(enum),
record_custom_file_name
(string),
record_format
(enum),
record_max_length
(int32),
record_timeout_secs
(int32),
record_track
(enum),
record_trim
(enum),
send_silence_when_idle
(boolean),
sip_headers
(array[object]),
sound_modifications
(object),
stream_bidirectional_codec
(enum),
stream_bidirectional_mode
(enum),
stream_bidirectional_target_legs
(enum),
stream_codec
(enum),
stream_track
(enum),
stream_url
(string),
transcription
(boolean),
transcription_config
(object),
webhook_url
(string),
webhook_url_method
(enum)
java
import com.telnyx.sdk.models.calls.actions.ActionAnswerParams;
import com.telnyx.sdk.models.calls.actions.ActionAnswerResponse;

ActionAnswerResponse response = client.calls().actions().answer("call_control_id");
接听呼入的呼叫。
POST /calls/{call_control_id}/actions/answer
可选参数:
billing_group_id
(uuid),
client_state
(string),
command_id
(string),
custom_headers
(array[object]),
preferred_codecs
(enum),
record
(enum),
record_channels
(enum),
record_custom_file_name
(string),
record_format
(enum),
record_max_length
(int32),
record_timeout_secs
(int32),
record_track
(enum),
record_trim
(enum),
send_silence_when_idle
(boolean),
sip_headers
(array[object]),
sound_modifications
(object),
stream_bidirectional_codec
(enum),
stream_bidirectional_mode
(enum),
stream_bidirectional_target_legs
(enum),
stream_codec
(enum),
stream_track
(enum),
stream_url
(string),
transcription
(boolean),
transcription_config
(object),
webhook_url
(string),
webhook_url_method
(enum)
java
import com.telnyx.sdk.models.calls.actions.ActionAnswerParams;
import com.telnyx.sdk.models.calls.actions.ActionAnswerResponse;

ActionAnswerResponse response = client.calls().actions().answer("call_control_id");

Bridge calls

桥接呼叫

Bridge two call control calls.
POST /calls/{call_control_id}/actions/bridge
— Required:
call_control_id
Optional:
client_state
(string),
command_id
(string),
mute_dtmf
(enum),
park_after_unbridge
(string),
play_ringtone
(boolean),
queue
(string),
record
(enum),
record_channels
(enum),
record_custom_file_name
(string),
record_format
(enum),
record_max_length
(int32),
record_timeout_secs
(int32),
record_track
(enum),
record_trim
(enum),
ringtone
(enum),
video_room_context
(string),
video_room_id
(uuid)
java
import com.telnyx.sdk.models.calls.actions.ActionBridgeParams;
import com.telnyx.sdk.models.calls.actions.ActionBridgeResponse;

ActionBridgeParams params = ActionBridgeParams.builder()
    .callControlIdToBridge("call_control_id")
    .callControlId("v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg")
    .build();
ActionBridgeResponse response = client.calls().actions().bridge(params);
桥接两个呼叫控制会话。
POST /calls/{call_control_id}/actions/bridge
— 必填参数:
call_control_id
可选参数:
client_state
(string),
command_id
(string),
mute_dtmf
(enum),
park_after_unbridge
(string),
play_ringtone
(boolean),
queue
(string),
record
(enum),
record_channels
(enum),
record_custom_file_name
(string),
record_format
(enum),
record_max_length
(int32),
record_timeout_secs
(int32),
record_track
(enum),
record_trim
(enum),
ringtone
(enum),
video_room_context
(string),
video_room_id
(uuid)
java
import com.telnyx.sdk.models.calls.actions.ActionBridgeParams;
import com.telnyx.sdk.models.calls.actions.ActionBridgeResponse;

ActionBridgeParams params = ActionBridgeParams.builder()
    .callControlIdToBridge("call_control_id")
    .callControlId("v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg")
    .build();
ActionBridgeResponse response = client.calls().actions().bridge(params);

Dial

发起呼叫

Dial a number or SIP URI from a given connection.
POST /calls
— Required:
connection_id
,
to
,
from
Optional:
answering_machine_detection
(enum),
answering_machine_detection_config
(object),
audio_url
(string),
billing_group_id
(uuid),
bridge_intent
(boolean),
bridge_on_answer
(boolean),
client_state
(string),
command_id
(string),
conference_config
(object),
custom_headers
(array[object]),
dialogflow_config
(object),
enable_dialogflow
(boolean),
from_display_name
(string),
link_to
(string),
media_encryption
(enum),
media_name
(string),
park_after_unbridge
(string),
preferred_codecs
(string),
record
(enum),
record_channels
(enum),
record_custom_file_name
(string),
record_format
(enum),
record_max_length
(int32),
record_timeout_secs
(int32),
record_track
(enum),
record_trim
(enum),
send_silence_when_idle
(boolean),
sip_auth_password
(string),
sip_auth_username
(string),
sip_headers
(array[object]),
sip_region
(enum),
sip_transport_protocol
(enum),
sound_modifications
(object),
stream_auth_token
(string),
stream_bidirectional_codec
(enum),
stream_bidirectional_mode
(enum),
stream_bidirectional_sampling_rate
(enum),
stream_bidirectional_target_legs
(enum),
stream_codec
(enum),
stream_establish_before_call_originate
(boolean),
stream_track
(enum),
stream_url
(string),
supervise_call_control_id
(string),
supervisor_role
(enum),
time_limit_secs
(int32),
timeout_secs
(int32),
transcription
(boolean),
transcription_config
(object),
webhook_url
(string),
webhook_url_method
(enum)
java
import com.telnyx.sdk.models.calls.CallDialParams;
import com.telnyx.sdk.models.calls.CallDialResponse;

CallDialParams params = CallDialParams.builder()
    .connectionId("7267xxxxxxxxxxxxxx")
    .from("+18005550101")
    .to("+18005550100")
    .build();
CallDialResponse response = client.calls().dial(params);
从指定连接拨打号码或SIP URI。
POST /calls
— 必填参数:
connection_id
,
to
,
from
可选参数:
answering_machine_detection
(enum),
answering_machine_detection_config
(object),
audio_url
(string),
billing_group_id
(uuid),
bridge_intent
(boolean),
bridge_on_answer
(boolean),
client_state
(string),
command_id
(string),
conference_config
(object),
custom_headers
(array[object]),
dialogflow_config
(object),
enable_dialogflow
(boolean),
from_display_name
(string),
link_to
(string),
media_encryption
(enum),
media_name
(string),
park_after_unbridge
(string),
preferred_codecs
(string),
record
(enum),
record_channels
(enum),
record_custom_file_name
(string),
record_format
(enum),
record_max_length
(int32),
record_timeout_secs
(int32),
record_track
(enum),
record_trim
(enum),
send_silence_when_idle
(boolean),
sip_auth_password
(string),
sip_auth_username
(string),
sip_headers
(array[object]),
sip_region
(enum),
sip_transport_protocol
(enum),
sound_modifications
(object),
stream_auth_token
(string),
stream_bidirectional_codec
(enum),
stream_bidirectional_mode
(enum),
stream_bidirectional_sampling_rate
(enum),
stream_bidirectional_target_legs
(enum),
stream_codec
(enum),
stream_establish_before_call_originate
(boolean),
stream_track
(enum),
stream_url
(string),
supervise_call_control_id
(string),
supervisor_role
(enum),
time_limit_secs
(int32),
timeout_secs
(int32),
transcription
(boolean),
transcription_config
(object),
webhook_url
(string),
webhook_url_method
(enum)
java
import com.telnyx.sdk.models.calls.CallDialParams;
import com.telnyx.sdk.models.calls.CallDialResponse;

CallDialParams params = CallDialParams.builder()
    .connectionId("7267xxxxxxxxxxxxxx")
    .from("+18005550101")
    .to("+18005550100")
    .build();
CallDialResponse response = client.calls().dial(params);

Hangup call

挂断呼叫

Hang up the call.
POST /calls/{call_control_id}/actions/hangup
Optional:
client_state
(string),
command_id
(string)
java
import com.telnyx.sdk.models.calls.actions.ActionHangupParams;
import com.telnyx.sdk.models.calls.actions.ActionHangupResponse;

ActionHangupResponse response = client.calls().actions().hangup("call_control_id");
挂断当前呼叫。
POST /calls/{call_control_id}/actions/hangup
可选参数:
client_state
(string),
command_id
(string)
java
import com.telnyx.sdk.models.calls.actions.ActionHangupParams;
import com.telnyx.sdk.models.calls.actions.ActionHangupResponse;

ActionHangupResponse response = client.calls().actions().hangup("call_control_id");

Transfer call

转接呼叫

Transfer a call to a new destination.
POST /calls/{call_control_id}/actions/transfer
— Required:
to
Optional:
answering_machine_detection
(enum),
answering_machine_detection_config
(object),
audio_url
(string),
client_state
(string),
command_id
(string),
custom_headers
(array[object]),
early_media
(boolean),
from
(string),
from_display_name
(string),
media_encryption
(enum),
media_name
(string),
mute_dtmf
(enum),
park_after_unbridge
(string),
preferred_codecs
(string),
record
(enum),
record_channels
(enum),
record_custom_file_name
(string),
record_format
(enum),
record_max_length
(int32),
record_timeout_secs
(int32),
record_track
(enum),
record_trim
(enum),
sip_auth_password
(string),
sip_auth_username
(string),
sip_headers
(array[object]),
sip_region
(enum),
sip_transport_protocol
(enum),
sound_modifications
(object),
target_leg_client_state
(string),
time_limit_secs
(int32),
timeout_secs
(int32),
webhook_retries_policies
(object),
webhook_url
(string),
webhook_url_method
(enum),
webhook_urls
(object),
webhook_urls_method
(enum)
java
import com.telnyx.sdk.models.calls.actions.ActionTransferParams;
import com.telnyx.sdk.models.calls.actions.ActionTransferResponse;

ActionTransferParams params = ActionTransferParams.builder()
    .callControlId("call_control_id")
    .to("+18005550100")
    .build();
ActionTransferResponse response = client.calls().actions().transfer(params);
将呼叫转接至新的目的地。
POST /calls/{call_control_id}/actions/transfer
— 必填参数:
to
可选参数:
answering_machine_detection
(enum),
answering_machine_detection_config
(object),
audio_url
(string),
client_state
(string),
command_id
(string),
custom_headers
(array[object]),
early_media
(boolean),
from
(string),
from_display_name
(string),
media_encryption
(enum),
media_name
(string),
mute_dtmf
(enum),
park_after_unbridge
(string),
preferred_codecs
(string),
record
(enum),
record_channels
(enum),
record_custom_file_name
(string),
record_format
(enum),
record_max_length
(int32),
record_timeout_secs
(int32),
record_track
(enum),
record_trim
(enum),
sip_auth_password
(string),
sip_auth_username
(string),
sip_headers
(array[object]),
sip_region
(enum),
sip_transport_protocol
(enum),
sound_modifications
(object),
target_leg_client_state
(string),
time_limit_secs
(int32),
timeout_secs
(int32),
webhook_retries_policies
(object),
webhook_url
(string),
webhook_url_method
(enum),
webhook_urls
(object),
webhook_urls_method
(enum)
java
import com.telnyx.sdk.models.calls.actions.ActionTransferParams;
import com.telnyx.sdk.models.calls.actions.ActionTransferResponse;

ActionTransferParams params = ActionTransferParams.builder()
    .callControlId("call_control_id")
    .to("+18005550100")
    .build();
ActionTransferResponse response = client.calls().actions().transfer(params);

List all active calls for given connection

列出指定连接的所有活跃呼叫

Lists all active calls for given connection.
GET /connections/{connection_id}/active_calls
java
import com.telnyx.sdk.models.connections.ConnectionListActiveCallsPage;
import com.telnyx.sdk.models.connections.ConnectionListActiveCallsParams;

ConnectionListActiveCallsPage page = client.connections().listActiveCalls("1293384261075731461");
列出指定连接下的所有活跃呼叫。
GET /connections/{connection_id}/active_calls
java
import com.telnyx.sdk.models.connections.ConnectionListActiveCallsPage;
import com.telnyx.sdk.models.connections.ConnectionListActiveCallsParams;

ConnectionListActiveCallsPage page = client.connections().listActiveCalls("1293384261075731461");

List call control applications

列出呼叫控制应用

Return a list of call control applications.
GET /call_control_applications
java
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationListPage;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationListParams;

CallControlApplicationListPage page = client.callControlApplications().list();
返回呼叫控制应用列表。
GET /call_control_applications
java
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationListPage;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationListParams;

CallControlApplicationListPage page = client.callControlApplications().list();

Create a call control application

创建呼叫控制应用

Create a call control application.
POST /call_control_applications
— Required:
application_name
,
webhook_event_url
Optional:
active
(boolean),
anchorsite_override
(enum),
call_cost_in_webhooks
(boolean),
dtmf_type
(enum),
first_command_timeout
(boolean),
first_command_timeout_secs
(integer),
inbound
(object),
outbound
(object),
redact_dtmf_debug_logging
(boolean),
webhook_api_version
(enum),
webhook_event_failover_url
(url),
webhook_timeout_secs
(['integer', 'null'])
java
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationCreateParams;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationCreateResponse;

CallControlApplicationCreateParams params = CallControlApplicationCreateParams.builder()
    .applicationName("call-router")
    .webhookEventUrl("https://example.com")
    .build();
CallControlApplicationCreateResponse callControlApplication = client.callControlApplications().create(params);
创建一个呼叫控制应用。
POST /call_control_applications
— 必填参数:
application_name
,
webhook_event_url
可选参数:
active
(boolean),
anchorsite_override
(enum),
call_cost_in_webhooks
(boolean),
dtmf_type
(enum),
first_command_timeout
(boolean),
first_command_timeout_secs
(integer),
inbound
(object),
outbound
(object),
redact_dtmf_debug_logging
(boolean),
webhook_api_version
(enum),
webhook_event_failover_url
(url),
webhook_timeout_secs
(['integer', 'null'])
java
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationCreateParams;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationCreateResponse;

CallControlApplicationCreateParams params = CallControlApplicationCreateParams.builder()
    .applicationName("call-router")
    .webhookEventUrl("https://example.com")
    .build();
CallControlApplicationCreateResponse callControlApplication = client.callControlApplications().create(params);

Retrieve a call control application

获取呼叫控制应用详情

Retrieves the details of an existing call control application.
GET /call_control_applications/{id}
java
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationRetrieveParams;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationRetrieveResponse;

CallControlApplicationRetrieveResponse callControlApplication = client.callControlApplications().retrieve("1293384261075731499");
获取已存在的呼叫控制应用的详细信息。
GET /call_control_applications/{id}
java
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationRetrieveParams;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationRetrieveResponse;

CallControlApplicationRetrieveResponse callControlApplication = client.callControlApplications().retrieve("1293384261075731499");

Update a call control application

更新呼叫控制应用

Updates settings of an existing call control application.
PATCH /call_control_applications/{id}
— Required:
application_name
,
webhook_event_url
Optional:
active
(boolean),
anchorsite_override
(enum),
call_cost_in_webhooks
(boolean),
dtmf_type
(enum),
first_command_timeout
(boolean),
first_command_timeout_secs
(integer),
inbound
(object),
outbound
(object),
redact_dtmf_debug_logging
(boolean),
tags
(array[string]),
webhook_api_version
(enum),
webhook_event_failover_url
(url),
webhook_timeout_secs
(['integer', 'null'])
java
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationUpdateParams;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationUpdateResponse;

CallControlApplicationUpdateParams params = CallControlApplicationUpdateParams.builder()
    .id("1293384261075731499")
    .applicationName("call-router")
    .webhookEventUrl("https://example.com")
    .build();
CallControlApplicationUpdateResponse callControlApplication = client.callControlApplications().update(params);
更新已存在的呼叫控制应用设置。
PATCH /call_control_applications/{id}
— 必填参数:
application_name
,
webhook_event_url
可选参数:
active
(boolean),
anchorsite_override
(enum),
call_cost_in_webhooks
(boolean),
dtmf_type
(enum),
first_command_timeout
(boolean),
first_command_timeout_secs
(integer),
inbound
(object),
outbound
(object),
redact_dtmf_debug_logging
(boolean),
tags
(array[string]),
webhook_api_version
(enum),
webhook_event_failover_url
(url),
webhook_timeout_secs
(['integer', 'null'])
java
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationUpdateParams;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationUpdateResponse;

CallControlApplicationUpdateParams params = CallControlApplicationUpdateParams.builder()
    .id("1293384261075731499")
    .applicationName("call-router")
    .webhookEventUrl("https://example.com")
    .build();
CallControlApplicationUpdateResponse callControlApplication = client.callControlApplications().update(params);

Delete a call control application

删除呼叫控制应用

Deletes a call control application.
DELETE /call_control_applications/{id}
java
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationDeleteParams;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationDeleteResponse;

CallControlApplicationDeleteResponse callControlApplication = client.callControlApplications().delete("1293384261075731499");
删除指定的呼叫控制应用。
DELETE /call_control_applications/{id}
java
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationDeleteParams;
import com.telnyx.sdk.models.callcontrolapplications.CallControlApplicationDeleteResponse;

CallControlApplicationDeleteResponse callControlApplication = client.callControlApplications().delete("1293384261075731499");

List call events

列出呼叫事件

Filters call events by given filter parameters.
GET /call_events
java
import com.telnyx.sdk.models.callevents.CallEventListPage;
import com.telnyx.sdk.models.callevents.CallEventListParams;

CallEventListPage page = client.callEvents().list();

根据指定过滤参数筛选呼叫事件。
GET /call_events
java
import com.telnyx.sdk.models.callevents.CallEventListPage;
import com.telnyx.sdk.models.callevents.CallEventListParams;

CallEventListPage page = client.callEvents().list();

Webhooks

Webhooks

The following webhook events are sent to your configured webhook URL. All webhooks include
telnyx-timestamp
and
telnyx-signature-ed25519
headers for verification (Standard Webhooks compatible).
EventDescription
callAnswered
Call Answered
callStreamingStarted
Call Streaming Started
callStreamingStopped
Call Streaming Stopped
callStreamingFailed
Call Streaming Failed
callBridged
Call Bridged
callInitiated
Call Initiated
callHangup
Call Hangup
callRecordingSaved
Call Recording Saved
callMachineDetectionEnded
Call Machine Detection Ended
callMachineGreetingEnded
Call Machine Greeting Ended
callMachinePremiumDetectionEnded
Call Machine Premium Detection Ended
callMachinePremiumGreetingEnded
Call Machine Premium Greeting Ended
以下Webhook事件将发送至您配置的Webhook URL。所有Webhook均包含
telnyx-timestamp
telnyx-signature-ed25519
头信息用于验证(兼容标准Webhooks)。
事件描述
callAnswered
呼叫已接听
callStreamingStarted
呼叫流已启动
callStreamingStopped
呼叫流已停止
callStreamingFailed
呼叫流启动失败
callBridged
呼叫已桥接
callInitiated
呼叫已发起
callHangup
呼叫已挂断
callRecordingSaved
呼叫录音已保存
callMachineDetectionEnded
自动应答机检测已结束
callMachineGreetingEnded
自动应答机问候语已结束
callMachinePremiumDetectionEnded
高级自动应答机检测已结束
callMachinePremiumGreetingEnded
高级自动应答机问候语已结束

Webhook payload fields

Webhook负载字段

callAnswered
FieldTypeDescription
data.record_type
enumIdentifies the type of the resource.
data.event_type
enumThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.custom_headers
array[object]Custom headers set on answer command
data.payload.sip_headers
array[object]User-to-User and Diversion headers from sip invite.
data.payload.from
stringNumber or SIP URI placing the call.
data.payload.to
stringDestination number or SIP URI of the call.
data.payload.start_time
date-timeISO 8601 datetime of when the call started.
data.payload.state
enumState received from a command.
data.payload.tags
array[string]Array of tags associated to number.
callStreamingStarted
FieldTypeDescription
data.record_type
enumIdentifies the type of the resource.
data.event_type
enumThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.stream_url
stringDestination WebSocket address where the stream is going to be delivered.
callStreamingStopped
FieldTypeDescription
data.record_type
enumIdentifies the type of the resource.
data.event_type
enumThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.stream_url
stringDestination WebSocket address where the stream is going to be delivered.
callStreamingFailed
FieldTypeDescription
data.record_type
enumIdentifies the resource.
data.event_type
enumThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.failure_reason
stringA short description explaning why the media streaming failed.
data.payload.stream_id
uuidIdentifies the streaming.
data.payload.stream_type
enumThe type of stream connection the stream is performing.
callBridged
FieldTypeDescription
data.record_type
enumIdentifies the type of the resource.
data.event_type
enumThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.from
stringNumber or SIP URI placing the call.
data.payload.to
stringDestination number or SIP URI of the call.
callInitiated
FieldTypeDescription
data.record_type
enumIdentifies the type of the resource.
data.event_type
enumThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.connection_codecs
stringThe list of comma-separated codecs enabled for the connection.
data.payload.offered_codecs
stringThe list of comma-separated codecs offered by caller.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.custom_headers
array[object]Custom headers from sip invite
data.payload.sip_headers
array[object]User-to-User and Diversion headers from sip invite.
data.payload.shaken_stir_attestation
stringSHAKEN/STIR attestation level.
data.payload.shaken_stir_validated
booleanWhether attestation was successfully validated or not.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.caller_id_name
stringCaller id.
data.payload.call_screening_result
stringCall screening result.
data.payload.from
stringNumber or SIP URI placing the call.
data.payload.to
stringDestination number or SIP URI of the call.
data.payload.direction
enumWhether the call is
incoming
or
outgoing
.
data.payload.state
enumState received from a command.
data.payload.start_time
date-timeISO 8601 datetime of when the call started.
data.payload.tags
array[string]Array of tags associated to number.
callHangup
FieldTypeDescription
data.record_type
enumIdentifies the type of the resource.
data.event_type
enumThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.custom_headers
array[object]Custom headers set on answer command
data.payload.sip_headers
array[object]User-to-User and Diversion headers from sip invite.
data.payload.from
stringNumber or SIP URI placing the call.
data.payload.to
stringDestination number or SIP URI of the call.
data.payload.start_time
date-timeISO 8601 datetime of when the call started.
data.payload.state
enumState received from a command.
data.payload.tags
array[string]Array of tags associated to number.
data.payload.hangup_cause
enumThe reason the call was ended (
call_rejected
,
normal_clearing
,
originator_cancel
,
timeout
,
time_limit
, `use...
data.payload.hangup_source
enumThe party who ended the call (
callee
,
caller
,
unknown
).
data.payload.sip_hangup_cause
stringThe reason the call was ended (SIP response code).
data.payload.call_quality_stats
['object', 'null']Call quality statistics aggregated from the CHANNEL_HANGUP_COMPLETE event.
callRecordingSaved
FieldTypeDescription
data.record_type
enumIdentifies the type of the resource.
data.event_type
enumThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.client_state
stringState received from a command.
data.payload.recording_started_at
date-timeISO 8601 datetime of when recording started.
data.payload.recording_ended_at
date-timeISO 8601 datetime of when recording ended.
data.payload.channels
enumWhether recording was recorded in
single
or
dual
channel.
callMachineDetectionEnded
FieldTypeDescription
data.record_type
enumIdentifies the type of the resource.
data.event_type
enumThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.from
stringNumber or SIP URI placing the call.
data.payload.to
stringDestination number or SIP URI of the call.
data.payload.result
enumAnswering machine detection result.
callMachineGreetingEnded
FieldTypeDescription
data.record_type
enumIdentifies the type of the resource.
data.event_type
enumThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.from
stringNumber or SIP URI placing the call.
data.payload.to
stringDestination number or SIP URI of the call.
data.payload.result
enumAnswering machine greeting ended result.
callMachinePremiumDetectionEnded
FieldTypeDescription
data.record_type
enumIdentifies the type of the resource.
data.event_type
enumThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.from
stringNumber or SIP URI placing the call.
data.payload.to
stringDestination number or SIP URI of the call.
data.payload.result
enumPremium Answering Machine Detection result.
callMachinePremiumGreetingEnded
FieldTypeDescription
data.record_type
enumIdentifies the type of the resource.
data.event_type
enumThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.from
stringNumber or SIP URI placing the call.
data.payload.to
stringDestination number or SIP URI of the call.
data.payload.result
enumPremium Answering Machine Greeting Ended result.
callAnswered
字段类型描述
data.record_type
enum标识资源类型。
data.event_type
enum标识所推送的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
date-time事件发生的ISO 8601格式时间。
data.payload.call_control_id
string用于通过Call Control API下发命令的呼叫ID。
data.payload.connection_id
string呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
string呼叫唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
string呼叫会话唯一ID,可用于关联Webhook事件。
data.payload.client_state
string从命令中接收的状态信息。
data.payload.custom_headers
array[object]接听命令中设置的自定义头信息
data.payload.sip_headers
array[object]SIP邀请中的用户到用户及转移头信息。
data.payload.from
string发起呼叫的号码或SIP URI。
data.payload.to
string呼叫的目标号码或SIP URI。
data.payload.start_time
date-time呼叫启动的ISO 8601格式时间。
data.payload.state
enum从命令中接收的状态信息。
data.payload.tags
array[string]与号码关联的标签数组。
callStreamingStarted
字段类型描述
data.record_type
enum标识资源类型。
data.event_type
enum标识所推送的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
date-time事件发生的ISO 8601格式时间。
data.payload.call_control_id
string用于通过Call Control API下发命令的呼叫ID。
data.payload.connection_id
string呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
string呼叫唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
string呼叫会话唯一ID,可用于关联Webhook事件。
data.payload.client_state
string从命令中接收的状态信息。
data.payload.stream_url
string推送呼叫流的目标WebSocket地址。
callStreamingStopped
字段类型描述
data.record_type
enum标识资源类型。
data.event_type
enum标识所推送的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
date-time事件发生的ISO 8601格式时间。
data.payload.call_control_id
string用于通过Call Control API下发命令的呼叫ID。
data.payload.connection_id
string呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
string呼叫唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
string呼叫会话唯一ID,可用于关联Webhook事件。
data.payload.client_state
string从命令中接收的状态信息。
data.payload.stream_url
string推送呼叫流的目标WebSocket地址。
callStreamingFailed
字段类型描述
data.record_type
enum标识资源类型。
data.event_type
enum标识所推送的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
date-time事件发生的ISO 8601格式时间。
data.payload.call_control_id
string用于通过Call Control API下发命令的呼叫ID。
data.payload.connection_id
string呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
string呼叫唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
string呼叫会话唯一ID,可用于关联Webhook事件。
data.payload.client_state
string从命令中接收的状态信息。
data.payload.failure_reason
string媒体流启动失败的简短说明。
data.payload.stream_id
uuid标识流会话。
data.payload.stream_type
enum流连接的类型。
callBridged
字段类型描述
data.record_type
enum标识资源类型。
data.event_type
enum标识所推送的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
date-time事件发生的ISO 8601格式时间。
data.payload.call_control_id
string用于通过Call Control API下发命令的呼叫ID。
data.payload.connection_id
string呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
string呼叫唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
string呼叫会话唯一ID,可用于关联Webhook事件。
data.payload.client_state
string从命令中接收的状态信息。
data.payload.from
string发起呼叫的号码或SIP URI。
data.payload.to
string呼叫的目标号码或SIP URI。
callInitiated
字段类型描述
data.record_type
enum标识资源类型。
data.event_type
enum标识所推送的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
date-time事件发生的ISO 8601格式时间。
data.payload.call_control_id
string用于通过Call Control API下发命令的呼叫ID。
data.payload.connection_id
string呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.connection_codecs
string连接启用的编解码器列表,以逗号分隔。
data.payload.offered_codecs
string呼叫方提供的编解码器列表,以逗号分隔。
data.payload.call_leg_id
string呼叫唯一ID,可用于关联Webhook事件。
data.payload.custom_headers
array[object]SIP邀请中的自定义头信息
data.payload.sip_headers
array[object]SIP邀请中的用户到用户及转移头信息。
data.payload.shaken_stir_attestation
stringSHAKEN/STIR认证级别。
data.payload.shaken_stir_validated
boolean认证是否成功验证。
data.payload.call_session_id
string呼叫会话唯一ID,可用于关联Webhook事件。
data.payload.client_state
string从命令中接收的状态信息。
data.payload.caller_id_name
string来电显示名称。
data.payload.call_screening_result
string呼叫筛选结果。
data.payload.from
string发起呼叫的号码或SIP URI。
data.payload.to
string呼叫的目标号码或SIP URI。
data.payload.direction
enum呼叫方向,
incoming
为呼入,
outgoing
为呼出。
data.payload.state
enum从命令中接收的状态信息。
data.payload.start_time
date-time呼叫启动的ISO 8601格式时间。
data.payload.tags
array[string]与号码关联的标签数组。
callHangup
字段类型描述
data.record_type
enum标识资源类型。
data.event_type
enum标识所推送的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
date-time事件发生的ISO 8601格式时间。
data.payload.call_control_id
string用于通过Call Control API下发命令的呼叫ID。
data.payload.connection_id
string呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
string呼叫唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
string呼叫会话唯一ID,可用于关联Webhook事件。
data.payload.client_state
string从命令中接收的状态信息。
data.payload.custom_headers
array[object]接听命令中设置的自定义头信息
data.payload.sip_headers
array[object]SIP邀请中的用户到用户及转移头信息。
data.payload.from
string发起呼叫的号码或SIP URI。
data.payload.to
string呼叫的目标号码或SIP URI。
data.payload.start_time
date-time呼叫启动的ISO 8601格式时间。
data.payload.state
enum从命令中接收的状态信息。
data.payload.tags
array[string]与号码关联的标签数组。
data.payload.hangup_cause
enum呼叫结束原因(
call_rejected
:呼叫被拒,
normal_clearing
:正常挂断,
originator_cancel
:发起方取消,
timeout
:超时,
time_limit
:达到时长限制等)
data.payload.hangup_source
enum结束呼叫的一方(
callee
:被叫方,
caller
:主叫方,
unknown
:未知)。
data.payload.sip_hangup_cause
string呼叫结束的SIP响应代码。
data.payload.call_quality_stats
['object', 'null']从CHANNEL_HANGUP_COMPLETE事件聚合的呼叫质量统计信息。
callRecordingSaved
字段类型描述
data.record_type
enum标识资源类型。
data.event_type
enum标识所推送的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
date-time事件发生的ISO 8601格式时间。
data.payload.call_leg_id
string呼叫唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
string呼叫会话唯一ID,可用于关联Webhook事件。
data.payload.connection_id
string呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.client_state
string从命令中接收의状态信息。
data.payload.recording_started_at
date-time录音启动的ISO 8601格式时间。
data.payload.recording_ended_at
date-time录音结束的ISO 8601格式时间。
data.payload.channels
enum录音声道类型,
single
为单声道,
dual
为双声道。
callMachineDetectionEnded
字段类型描述
data.record_type
enum标识资源类型。
data.event_type
enum标识所推送的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
date-time事件发生的ISO 8601格式时间。
data.payload.call_control_id
string用于通过Call Control API下发命令的呼叫ID。
data.payload.connection_id
string呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
string呼叫唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
string呼叫会话唯一ID,可用于关联Webhook事件。
data.payload.client_state
string从命令中接收的状态信息。
data.payload.from
string发起呼叫的号码或SIP URI。
data.payload.to
string呼叫的目标号码或SIP URI。
data.payload.result
enum自动应答机检测结果。
callMachineGreetingEnded
字段类型描述
data.record_type
enum标识资源类型。
data.event_type
enum标识所推送的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
date-time事件发生的ISO 8601格式时间。
data.payload.call_control_id
string用于通过Call Control API下发命令的呼叫ID。
data.payload.connection_id
string呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
string呼叫唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
string呼叫会话唯一ID,可用于关联Webhook事件。
data.payload.client_state
string从命令中接收的状态信息。
data.payload.from
string发起呼叫的号码或SIP URI。
data.payload.to
string呼叫的目标号码或SIP URI。
data.payload.result
enum自动应答机问候语检测结果。
callMachinePremiumDetectionEnded
字段类型描述
data.record_type
enum标识资源类型。
data.event_type
enum标识所推送的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
date-time事件发生的ISO 8601格式时间。
data.payload.call_control_id
string用于通过Call Control API下发命令的呼叫ID。
data.payload.connection_id
string呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
string呼叫唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
string呼叫会话唯一ID,可用于关联Webhook事件。
data.payload.client_state
string从命令中接收的状态信息。
data.payload.from
string发起呼叫的号码或SIP URI。
data.payload.to
string呼叫的目标号码或SIP URI。
data.payload.result
enum高级自动应答机检测结果。
callMachinePremiumGreetingEnded
字段类型描述
data.record_type
enum标识资源类型。
data.event_type
enum标识所推送的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
date-time事件发生的ISO 8601格式时间。
data.payload.call_control_id
string用于通过Call Control API下发命令的呼叫ID。
data.payload.connection_id
string呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
string呼叫唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
string呼叫会话唯一ID,可用于关联Webhook事件。
data.payload.client_state
string从命令中接收的状态信息。
data.payload.from
string发起呼叫的号码或SIP URI。
data.payload.to
string呼叫的目标号码或SIP URI。
data.payload.result
enum高级自动应答机问候语检测结果。