telnyx-voice-advanced-java

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->

Telnyx Voice Advanced - Java

Telnyx 高级语音服务 - Java

Installation

安装

text
<!-- Maven -->
<dependency>
    <groupId>com.telnyx.sdk</groupId>
    <artifactId>telnyx</artifactId>
    <version>6.36.0</version>
</dependency>

// Gradle
implementation("com.telnyx.sdk:telnyx:6.36.0")
text
<!-- Maven -->
<dependency>
    <groupId>com.telnyx.sdk</groupId>
    <artifactId>telnyx</artifactId>
    <version>6.36.0</version>
</dependency>

// Gradle
implementation("com.telnyx.sdk:telnyx:6.36.0")

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
已按照上述方式完成初始化。

Error Handling

错误处理

All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:
java
import com.telnyx.sdk.errors.TelnyxServiceException;

try {
    var result = client.messages().send(params);
} catch (TelnyxServiceException e) {
    System.err.println("API error " + e.statusCode() + ": " + e.getMessage());
    if (e.statusCode() == 422) {
        System.err.println("Validation error — check required fields and formats");
    } else if (e.statusCode() == 429) {
        // Rate limited — wait and retry with exponential backoff
        Thread.sleep(1000);
    }
}
Common error codes:
401
invalid API key,
403
insufficient permissions,
404
resource not found,
422
validation error (check field formats),
429
rate limited (retry with exponential backoff).
所有API调用都可能因网络错误、速率限制(429)、校验错误(422)或认证错误(401)失败。生产环境代码请务必做好错误处理:
java
import com.telnyx.sdk.errors.TelnyxServiceException;

try {
    var result = client.messages().send(params);
} catch (TelnyxServiceException e) {
    System.err.println("API error " + e.statusCode() + ": " + e.getMessage());
    if (e.statusCode() == 422) {
        System.err.println("Validation error — check required fields and formats");
    } else if (e.statusCode() == 429) {
        // Rate limited — wait and retry with exponential backoff
        Thread.sleep(1000);
    }
}
常见错误码:
401
API密钥无效,
403
权限不足,
404
资源不存在,
422
校验错误(请检查字段格式),
429
触发速率限制(请使用指数退避策略重试)。

Join AI Assistant Conversation

加入AI助手对话

Add a participant to an existing AI assistant conversation. Use this command to bring an additional call leg into a running AI conversation.
POST /calls/{call_control_id}/actions/ai_assistant_join
— Required:
conversation_id
,
participant
Optional:
client_state
(string),
command_id
(string)
java
import com.telnyx.sdk.models.calls.actions.ActionJoinAiAssistantParams;
import com.telnyx.sdk.models.calls.actions.ActionJoinAiAssistantResponse;

ActionJoinAiAssistantParams params = ActionJoinAiAssistantParams.builder()
    .callControlId("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")
    .conversationId("v3:abc123")
    .participant(ActionJoinAiAssistantParams.Participant.builder()
        .id("v3:abc123def456")
        .role(ActionJoinAiAssistantParams.Participant.Role.USER)
        .build())
    .build();
ActionJoinAiAssistantResponse response = client.calls().actions().joinAiAssistant(params);
Returns:
conversation_id
(uuid),
result
(string)
向已有的AI助手对话中添加参与者。使用该命令可将额外的呼叫链路接入正在运行的AI对话中。
POST /calls/{call_control_id}/actions/ai_assistant_join
— 必填参数:
conversation_id
participant
可选参数:
client_state
(字符串)、
command_id
(字符串)
java
import com.telnyx.sdk.models.calls.actions.ActionJoinAiAssistantParams;
import com.telnyx.sdk.models.calls.actions.ActionJoinAiAssistantResponse;

ActionJoinAiAssistantParams params = ActionJoinAiAssistantParams.builder()
    .callControlId("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")
    .conversationId("v3:abc123")
    .participant(ActionJoinAiAssistantParams.Participant.builder()
        .id("v3:abc123def456")
        .role(ActionJoinAiAssistantParams.Participant.Role.USER)
        .build())
    .build();
ActionJoinAiAssistantResponse response = client.calls().actions().joinAiAssistant(params);
返回值:
conversation_id
(uuid)、
result
(字符串)

Update client state

更新客户端状态

Updates client state
PUT /calls/{call_control_id}/actions/client_state_update
— Required:
client_state
java
import com.telnyx.sdk.models.calls.actions.ActionUpdateClientStateParams;
import com.telnyx.sdk.models.calls.actions.ActionUpdateClientStateResponse;

ActionUpdateClientStateParams params = ActionUpdateClientStateParams.builder()
    .callControlId("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")
    .clientState("aGF2ZSBhIG5pY2UgZGF5ID1d")
    .build();
ActionUpdateClientStateResponse response = client.calls().actions().updateClientState(params);
Returns:
result
(string)
更新客户端状态
PUT /calls/{call_control_id}/actions/client_state_update
— 必填参数:
client_state
java
import com.telnyx.sdk.models.calls.actions.ActionUpdateClientStateParams;
import com.telnyx.sdk.models.calls.actions.ActionUpdateClientStateResponse;

ActionUpdateClientStateParams params = ActionUpdateClientStateParams.builder()
    .callControlId("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")
    .clientState("aGF2ZSBhIG5pY2UgZGF5ID1d")
    .build();
ActionUpdateClientStateResponse response = client.calls().actions().updateClientState(params);
返回值:
result
(字符串)

Send DTMF

发送DTMF

Sends DTMF tones from this leg. DTMF tones will be heard by the other end of the call. Expected Webhooks:
There are no webhooks associated with this command.
POST /calls/{call_control_id}/actions/send_dtmf
— Required:
digits
Optional:
client_state
(string),
command_id
(string),
duration_millis
(int32)
java
import com.telnyx.sdk.models.calls.actions.ActionSendDtmfParams;
import com.telnyx.sdk.models.calls.actions.ActionSendDtmfResponse;

ActionSendDtmfParams params = ActionSendDtmfParams.builder()
    .callControlId("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")
    .digits("1www2WABCDw9")
    .build();
ActionSendDtmfResponse response = client.calls().actions().sendDtmf(params);
Returns:
result
(string)
从当前呼叫链路发送DTMF音,通话对端将听到该DTMF信号。预期触发的Webhook:
该命令没有关联的Webhook。
POST /calls/{call_control_id}/actions/send_dtmf
— 必填参数:
digits
可选参数:
client_state
(字符串)、
command_id
(字符串)、
duration_millis
(int32)
java
import com.telnyx.sdk.models.calls.actions.ActionSendDtmfParams;
import com.telnyx.sdk.models.calls.actions.ActionSendDtmfResponse;

ActionSendDtmfParams params = ActionSendDtmfParams.builder()
    .callControlId("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")
    .digits("1www2WABCDw9")
    .build();
ActionSendDtmfResponse response = client.calls().actions().sendDtmf(params);
返回值:
result
(字符串)

SIPREC start

启动SIPREC

Start siprec session to configured in SIPREC connector SRS.
Expected Webhooks:
  • siprec.started
  • siprec.stopped
  • siprec.failed
POST /calls/{call_control_id}/actions/siprec_start
Optional:
client_state
(string),
connector_name
(string),
include_metadata_custom_headers
(boolean),
secure
(boolean),
session_timeout_secs
(integer),
sip_transport
(enum: udp, tcp, tls),
siprec_track
(enum: inbound_track, outbound_track, both_tracks)
java
import com.telnyx.sdk.models.calls.actions.ActionStartSiprecParams;
import com.telnyx.sdk.models.calls.actions.ActionStartSiprecResponse;

ActionStartSiprecResponse response = client.calls().actions().startSiprec("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ");
Returns:
result
(string)
向SIPREC连接器配置的SRS启动siprec会话。
预期触发的Webhook:
  • siprec.started
  • siprec.stopped
  • siprec.failed
POST /calls/{call_control_id}/actions/siprec_start
可选参数:
client_state
(字符串)、
connector_name
(字符串)、
include_metadata_custom_headers
(布尔值)、
secure
(布尔值)、
session_timeout_secs
(整数)、
sip_transport
(枚举值:udp、tcp、tls)、
siprec_track
(枚举值:inbound_track、outbound_track、both_tracks)
java
import com.telnyx.sdk.models.calls.actions.ActionStartSiprecParams;
import com.telnyx.sdk.models.calls.actions.ActionStartSiprecResponse;

ActionStartSiprecResponse response = client.calls().actions().startSiprec("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ");
返回值:
result
(字符串)

SIPREC stop

停止SIPREC

Stop SIPREC session. Expected Webhooks:
  • siprec.stopped
POST /calls/{call_control_id}/actions/siprec_stop
Optional:
client_state
(string),
command_id
(string)
java
import com.telnyx.sdk.models.calls.actions.ActionStopSiprecParams;
import com.telnyx.sdk.models.calls.actions.ActionStopSiprecResponse;

ActionStopSiprecResponse response = client.calls().actions().stopSiprec("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ");
Returns:
result
(string)
停止SIPREC会话。预期触发的Webhook:
  • siprec.stopped
POST /calls/{call_control_id}/actions/siprec_stop
可选参数:
client_state
(字符串)、
command_id
(字符串)
java
import com.telnyx.sdk.models.calls.actions.ActionStopSiprecParams;
import com.telnyx.sdk.models.calls.actions.ActionStopSiprecResponse;

ActionStopSiprecResponse response = client.calls().actions().stopSiprec("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ");
返回值:
result
(字符串)

Noise Suppression Start (BETA)

启动噪声抑制(测试版)

POST /calls/{call_control_id}/actions/suppression_start
Optional:
client_state
(string),
command_id
(string),
direction
(enum: inbound, outbound, both),
noise_suppression_engine
(enum: Denoiser, DeepFilterNet, Krisp, AiCoustics),
noise_suppression_engine_config
(object)
java
import com.telnyx.sdk.models.calls.actions.ActionStartNoiseSuppressionParams;
import com.telnyx.sdk.models.calls.actions.ActionStartNoiseSuppressionResponse;

ActionStartNoiseSuppressionResponse response = client.calls().actions().startNoiseSuppression("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ");
Returns:
result
(string)
POST /calls/{call_control_id}/actions/suppression_start
可选参数:
client_state
(字符串)、
command_id
(字符串)、
direction
(枚举值:inbound、outbound、both)、
noise_suppression_engine
(枚举值:Denoiser、DeepFilterNet、Krisp、AiCoustics)、
noise_suppression_engine_config
(对象)
java
import com.telnyx.sdk.models.calls.actions.ActionStartNoiseSuppressionParams;
import com.telnyx.sdk.models.calls.actions.ActionStartNoiseSuppressionResponse;

ActionStartNoiseSuppressionResponse response = client.calls().actions().startNoiseSuppression("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ");
返回值:
result
(字符串)

Noise Suppression Stop (BETA)

停止噪声抑制(测试版)

POST /calls/{call_control_id}/actions/suppression_stop
Optional:
client_state
(string),
command_id
(string)
java
import com.telnyx.sdk.models.calls.actions.ActionStopNoiseSuppressionParams;
import com.telnyx.sdk.models.calls.actions.ActionStopNoiseSuppressionResponse;

ActionStopNoiseSuppressionResponse response = client.calls().actions().stopNoiseSuppression("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ");
Returns:
result
(string)
POST /calls/{call_control_id}/actions/suppression_stop
可选参数:
client_state
(字符串)、
command_id
(字符串)
java
import com.telnyx.sdk.models.calls.actions.ActionStopNoiseSuppressionParams;
import com.telnyx.sdk.models.calls.actions.ActionStopNoiseSuppressionResponse;

ActionStopNoiseSuppressionResponse response = client.calls().actions().stopNoiseSuppression("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ");
返回值:
result
(字符串)

Switch supervisor role

切换监管角色

Switch the supervisor role for a bridged call. This allows switching between different supervisor modes during an active call
POST /calls/{call_control_id}/actions/switch_supervisor_role
— Required:
role
java
import com.telnyx.sdk.models.calls.actions.ActionSwitchSupervisorRoleParams;
import com.telnyx.sdk.models.calls.actions.ActionSwitchSupervisorRoleResponse;

ActionSwitchSupervisorRoleParams params = ActionSwitchSupervisorRoleParams.builder()
    .callControlId("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")
    .role(ActionSwitchSupervisorRoleParams.Role.BARGE)
    .build();
ActionSwitchSupervisorRoleResponse response = client.calls().actions().switchSupervisorRole(params);
Returns:
result
(string)

为桥接呼叫切换监管角色,支持在活动通话过程中切换不同的监管模式。
POST /calls/{call_control_id}/actions/switch_supervisor_role
— 必填参数:
role
java
import com.telnyx.sdk.models.calls.actions.ActionSwitchSupervisorRoleParams;
import com.telnyx.sdk.models.calls.actions.ActionSwitchSupervisorRoleResponse;

ActionSwitchSupervisorRoleParams params = ActionSwitchSupervisorRoleParams.builder()
    .callControlId("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")
    .role(ActionSwitchSupervisorRoleParams.Role.BARGE)
    .build();
ActionSwitchSupervisorRoleResponse response = client.calls().actions().switchSupervisorRole(params);
返回值:
result
(字符串)

Webhooks

Webhooks

Webhook Verification

Webhook验证

Telnyx signs webhooks with Ed25519. Each request includes
telnyx-signature-ed25519
and
telnyx-timestamp
headers. Always verify signatures in production:
java
import com.telnyx.sdk.core.UnwrapWebhookParams;
import com.telnyx.sdk.core.http.Headers;

// In your webhook handler (e.g., Spring — use raw body):
@PostMapping("/webhooks")
public ResponseEntity<String> handleWebhook(
    @RequestBody String payload,
    HttpServletRequest request) {
  try {
    Headers headers = Headers.builder()
        .put("telnyx-signature-ed25519", request.getHeader("telnyx-signature-ed25519"))
        .put("telnyx-timestamp", request.getHeader("telnyx-timestamp"))
        .build();
    var event = client.webhooks().unwrap(
        UnwrapWebhookParams.builder()
            .body(payload)
            .headers(headers)
            .build());
    // Signature valid — process the event
    System.out.println("Received webhook event");
    return ResponseEntity.ok("OK");
  } catch (Exception e) {
    System.err.println("Webhook verification failed: " + e.getMessage());
    return ResponseEntity.badRequest().body("Invalid signature");
  }
}
The following webhook events are sent to your configured webhook URL. All webhooks include
telnyx-timestamp
and
telnyx-signature-ed25519
headers for Ed25519 signature verification. Use
client.webhooks.unwrap()
to verify.
EventDescription
callConversationEnded
Call Conversation Ended
callConversationInsightsGenerated
Call Conversation Insights Generated
callDtmfReceived
Call Dtmf Received
callMachineDetectionEnded
Call Machine Detection Ended
callMachineGreetingEnded
Call Machine Greeting Ended
callMachinePremiumDetectionEnded
Call Machine Premium Detection Ended
callMachinePremiumGreetingEnded
Call Machine Premium Greeting Ended
callReferCompleted
Call Refer Completed
callReferFailed
Call Refer Failed
callReferStarted
Call Refer Started
callSiprecFailed
Call Siprec Failed
callSiprecStarted
Call Siprec Started
callSiprecStopped
Call Siprec Stopped
Telnyx使用Ed25519对Webhook进行签名,每个请求都会携带
telnyx-signature-ed25519
telnyx-timestamp
请求头。生产环境请务必验证签名:
java
import com.telnyx.sdk.core.UnwrapWebhookParams;
import com.telnyx.sdk.core.http.Headers;

// In your webhook handler (e.g., Spring — use raw body):
@PostMapping("/webhooks")
public ResponseEntity<String> handleWebhook(
    @RequestBody String payload,
    HttpServletRequest request) {
  try {
    Headers headers = Headers.builder()
        .put("telnyx-signature-ed25519", request.getHeader("telnyx-signature-ed25519"))
        .put("telnyx-timestamp", request.getHeader("telnyx-timestamp"))
        .build();
    var event = client.webhooks().unwrap(
        UnwrapWebhookParams.builder()
            .body(payload)
            .headers(headers)
            .build());
    // Signature valid — process the event
    System.out.println("Received webhook event");
    return ResponseEntity.ok("OK");
  } catch (Exception e) {
    System.err.println("Webhook verification failed: " + e.getMessage());
    return ResponseEntity.badRequest().body("Invalid signature");
  }
}
以下Webhook事件会发送到你配置的Webhook地址。所有Webhook都携带
telnyx-timestamp
telnyx-signature-ed25519
请求头用于Ed25519签名验证,可使用
client.webhooks.unwrap()
完成验证。
事件描述
callConversationEnded
呼叫会话已结束
callConversationInsightsGenerated
已生成呼叫会话洞察
callDtmfReceived
收到呼叫DTMF信号
callMachineDetectionEnded
呼叫应答机检测结束
callMachineGreetingEnded
应答机问候语播放结束
callMachinePremiumDetectionEnded
呼叫高级应答机检测结束
callMachinePremiumGreetingEnded
高级应答机问候语播放结束
callReferCompleted
呼叫转接完成
callReferFailed
呼叫转接失败
callReferStarted
呼叫转接已启动
callSiprecFailed
呼叫SIPREC启动失败
callSiprecStarted
呼叫SIPREC已启动
callSiprecStopped
呼叫SIPREC已停止

Webhook payload fields

Webhook负载字段

callConversationEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.conversation.endedThe type of event being delivered.
data.id
uuidUnique identifier for the event.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.created_at
date-timeTimestamp when the event was created in the system.
data.payload.assistant_id
stringUnique identifier of the assistant involved in the call.
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 leg.
data.payload.call_session_id
stringID that is unique to the call session (group of related call legs).
data.payload.client_state
stringBase64-encoded state received from a command.
data.payload.calling_party_type
enum: pstn, sipThe type of calling party connection.
data.payload.conversation_id
stringID unique to the conversation or insight group generated for the call.
data.payload.duration_sec
integerDuration of the conversation in seconds.
data.payload.from
stringThe caller's number or identifier.
data.payload.to
stringThe callee's number or SIP address.
data.payload.llm_model
stringThe large language model used during the conversation.
data.payload.stt_model
stringThe speech-to-text model used in the conversation.
data.payload.tts_provider
stringThe text-to-speech provider used in the call.
data.payload.tts_model_id
stringThe model ID used for text-to-speech synthesis.
data.payload.tts_voice_id
stringVoice ID used for TTS.
callConversationInsightsGenerated
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.conversation_insights.generatedThe 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.calling_party_type
enum: pstn, sipThe type of calling party connection.
data.payload.insight_group_id
stringID that is unique to the insight group being generated for the call.
data.payload.results
array[object]Array of insight results being generated for the call.
callDtmfReceived
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.dtmf.receivedThe 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
stringIdentifies the type of resource.
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.digit
stringThe received DTMF digit or symbol.
callMachineDetectionEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.machine.detection.endedThe 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
enum: human, machine, not_sureAnswering machine detection result.
callMachineGreetingEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.machine.greeting.endedThe 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
enum: beep_detected, ended, not_sureAnswering machine greeting ended result.
callMachinePremiumDetectionEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.machine.premium.detection.endedThe 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
enum: human_residence, human_business, machine, silence, fax_detected, not_surePremium Answering Machine Detection result.
callMachinePremiumGreetingEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.machine.premium.greeting.endedThe 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
enum: beep_detected, no_beep_detectedPremium Answering Machine Greeting Ended result.
callReferCompleted
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.refer.completedThe 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
stringUnique ID for controlling 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.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.from
stringNumber or SIP URI placing the call.
data.payload.sip_notify_response
integerSIP NOTIFY event status for tracking the REFER attempt.
data.payload.to
stringDestination number or SIP URI of the call.
callReferFailed
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.refer.failedThe 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
stringUnique ID for controlling 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.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.from
stringNumber or SIP URI placing the call.
data.payload.sip_notify_response
integerSIP NOTIFY event status for tracking the REFER attempt.
data.payload.to
stringDestination number or SIP URI of the call.
callReferStarted
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.refer.startedThe 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
stringUnique ID for controlling 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.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.from
stringNumber or SIP URI placing the call.
data.payload.sip_notify_response
integerSIP NOTIFY event status for tracking the REFER attempt.
data.payload.to
stringDestination number or SIP URI of the call.
callSiprecFailed
FieldTypeDescription
data.record_type
enum: eventIdentifies the resource.
data.event_type
enum: siprec.failedThe 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_cause
stringQ850 reason why siprec session failed.
callSiprecStarted
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: siprec.startedThe 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.
callSiprecStopped
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: siprec.stoppedThe 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.hangup_cause
stringQ850 reason why the SIPREC session was stopped.
callConversationEnded
字段类型描述
data.record_type
枚举值: event标识资源的类型。
data.event_type
枚举值: call.conversation.ended所投递的事件类型。
data.id
uuid事件的唯一标识符。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.created_at
时间戳事件在系统中创建的时间戳。
data.payload.assistant_id
字符串参与呼叫的助手的唯一标识符。
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫链路的唯一ID。
data.payload.call_session_id
字符串呼叫会话的唯一ID(一组相关呼叫链路的标识)。
data.payload.client_state
字符串从命令中接收的Base64编码状态。
data.payload.calling_party_type
枚举值: pstn, sip主叫方连接类型。
data.payload.conversation_id
字符串为呼叫生成的会话或洞察组的唯一ID。
data.payload.duration_sec
整数会话持续时长,单位为秒。
data.payload.from
字符串主叫号码或标识符。
data.payload.to
字符串被叫号码或SIP地址。
data.payload.llm_model
字符串会话过程中使用的大语言模型。
data.payload.stt_model
字符串会话中使用的语音转文本模型。
data.payload.tts_provider
字符串呼叫中使用的文本转语音服务商。
data.payload.tts_model_id
字符串用于文本转语音合成的模型ID。
data.payload.tts_voice_id
字符串用于TTS的音色ID。
callConversationInsightsGenerated
字段类型描述
data.record_type
枚举值: event标识资源的类型。
data.event_type
枚举值: call.conversation_insights.generated所投递的事件类型。
data.id
uuid标识资源的类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.calling_party_type
枚举值: pstn, sip主叫方连接类型。
data.payload.insight_group_id
字符串为呼叫生成的洞察组的唯一ID。
data.payload.results
对象数组为呼叫生成的洞察结果数组。
callDtmfReceived
字段类型描述
data.record_type
枚举值: event标识资源的类型。
data.event_type
枚举值: call.dtmf.received所投递的事件类型。
data.id
uuid标识资源的类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的呼叫ID。
data.payload.connection_id
字符串标识资源的类型。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.from
字符串发起呼叫的号码或SIP URI。
data.payload.to
字符串呼叫的目标号码或SIP URI。
data.payload.digit
字符串收到的DTMF数字或符号。
callMachineDetectionEnded
字段类型描述
data.record_type
枚举值: event标识资源的类型。
data.event_type
枚举值: call.machine.detection.ended所投递的事件类型。
data.id
uuid标识资源的类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.from
字符串发起呼叫的号码或SIP URI。
data.payload.to
字符串呼叫的目标号码或SIP URI。
data.payload.result
枚举值: human, machine, not_sure应答机检测结果。
callMachineGreetingEnded
字段类型描述
data.record_type
枚举值: event标识资源的类型。
data.event_type
枚举值: call.machine.greeting.ended所投递的事件类型。
data.id
uuid标识资源的类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.from
字符串发起呼叫的号码或SIP URI。
data.payload.to
字符串呼叫的目标号码或SIP URI。
data.payload.result
枚举值: beep_detected, ended, not_sure应答机问候语结束检测结果。
callMachinePremiumDetectionEnded
字段类型描述
data.record_type
枚举值: event标识资源的类型。
data.event_type
枚举值: call.machine.premium.detection.ended所投递的事件类型。
data.id
uuid标识资源的类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.from
字符串发起呼叫的号码或SIP URI。
data.payload.to
字符串呼叫的目标号码或SIP URI。
data.payload.result
枚举值: human_residence, human_business, machine, silence, fax_detected, not_sure高级应答机检测结果。
callMachinePremiumGreetingEnded
字段类型描述
data.record_type
枚举值: event标识资源的类型。
data.event_type
枚举值: call.machine.premium.greeting.ended所投递的事件类型。
data.id
uuid标识资源的类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.from
字符串发起呼叫的号码或SIP URI。
data.payload.to
字符串呼叫的目标号码或SIP URI。
data.payload.result
枚举值: beep_detected, no_beep_detected高级应答机问候语结束检测结果。
callReferCompleted
字段类型描述
data.record_type
枚举值: event标识资源的类型。
data.event_type
枚举值: call.refer.completed所投递的事件类型。
data.id
uuid标识资源的类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于控制呼叫的唯一ID。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.from
字符串发起呼叫的号码或SIP URI。
data.payload.sip_notify_response
整数用于跟踪REFER尝试的SIP NOTIFY事件状态。
data.payload.to
字符串呼叫的目标号码或SIP URI。
callReferFailed
字段类型描述
data.record_type
枚举值: event标识资源的类型。
data.event_type
枚举值: call.refer.failed所投递的事件类型。
data.id
uuid标识资源的类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于控制呼叫的唯一ID。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.from
字符串发起呼叫的号码或SIP URI。
data.payload.sip_notify_response
整数用于跟踪REFER尝试的SIP NOTIFY事件状态。
data.payload.to
字符串呼叫的目标号码或SIP URI。
callReferStarted
字段类型描述
data.record_type
枚举值: event标识资源的类型。
data.event_type
枚举值: call.refer.started所投递的事件类型。
data.id
uuid标识资源的类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于控制呼叫的唯一ID。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.from
字符串发起呼叫的号码或SIP URI。
data.payload.sip_notify_response
整数用于跟踪REFER尝试的SIP NOTIFY事件状态。
data.payload.to
字符串呼叫的目标号码或SIP URI。
callSiprecFailed
字段类型描述
data.record_type
枚举值: event标识资源的类型。
data.event_type
枚举值: siprec.failed所投递的事件类型。
data.id
uuid标识资源的类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.failure_cause
字符串siprec会话失败的Q850原因。
callSiprecStarted
字段类型描述
data.record_type
枚举值: event标识资源的类型。
data.event_type
枚举值: siprec.started所投递的事件类型。
data.id
uuid标识资源的类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
callSiprecStopped
字段类型描述
data.record_type
枚举值: event标识资源的类型。
data.event_type
枚举值: siprec.stopped所投递的事件类型。
data.id
uuid标识资源的类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.hangup_cause
字符串SIPREC会话被停止的Q850原因。