telnyx-voice-advanced-javascript
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- 由Telnyx OpenAPI规范自动生成,请勿编辑。 -->
Telnyx Voice Advanced - JavaScript
Telnyx 高级语音功能 - JavaScript
Installation
安装
bash
npm install telnyxbash
npm install telnyxSetup
配置
javascript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});All examples below assume is already initialized as shown above.
clientjavascript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // 这是默认配置,可省略
});以下所有示例均假设已按上述方式完成初始化。
clientError 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:
javascript
try {
const result = await client.messages.send({ to: '+13125550001', from: '+13125550002', text: 'Hello' });
} catch (err) {
if (err instanceof Telnyx.APIConnectionError) {
console.error('Network error — check connectivity and retry');
} else if (err instanceof Telnyx.RateLimitError) {
// 429: rate limited — wait and retry with exponential backoff
const retryAfter = err.headers?.['retry-after'] || 1;
await new Promise(r => setTimeout(r, retryAfter * 1000));
} else if (err instanceof Telnyx.APIError) {
console.error(`API error ${err.status}: ${err.message}`);
if (err.status === 422) {
console.error('Validation error — check required fields and formats');
}
}
}Common error codes: invalid API key, insufficient permissions,
resource not found, validation error (check field formats),
rate limited (retry with exponential backoff).
401403404422429所有API调用都可能因网络错误、速率限制(429)、验证错误(422)或身份验证错误(401)而失败。在生产代码中务必处理错误:
javascript
try {
const result = await client.messages.send({ to: '+13125550001', from: '+13125550002', text: 'Hello' });
} catch (err) {
if (err instanceof Telnyx.APIConnectionError) {
console.error('Network error — check connectivity and retry');
} else if (err instanceof Telnyx.RateLimitError) {
// 429: rate limited — wait and retry with exponential backoff
const retryAfter = err.headers?.['retry-after'] || 1;
await new Promise(r => setTimeout(r, retryAfter * 1000));
} else if (err instanceof Telnyx.APIError) {
console.error(`API error ${err.status}: ${err.message}`);
if (err.status === 422) {
console.error('Validation error — check required fields and formats');
}
}
}常见错误码: API密钥无效, 权限不足, 资源未找到, 验证错误(检查字段格式), 速率受限(使用指数退避策略重试)。
401403404422429Join 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_joinconversation_idparticipantOptional: (string), (string)
client_statecommand_idjavascript
const response = await client.calls.actions.joinAIAssistant('call_control_id', {
conversation_id: 'v3:abc123',
participant: { id: 'v3:abc123def456', role: 'user' },
});
console.log(response.data);Returns: (uuid), (string)
conversation_idresult将参与者添加到现有的AI助手对话中。使用此命令可将额外的呼叫分支加入正在进行的AI对话。
POST /calls/{call_control_id}/actions/ai_assistant_joinconversation_idparticipant可选参数:(字符串)、(字符串)
client_statecommand_idjavascript
const response = await client.calls.actions.joinAIAssistant('call_control_id', {
conversation_id: 'v3:abc123',
participant: { id: 'v3:abc123def456', role: 'user' },
});
console.log(response.data);返回结果:(uuid)、(字符串)
conversation_idresultUpdate client state
更新客户端状态
Updates client state
PUT /calls/{call_control_id}/actions/client_state_updateclient_statejavascript
const response = await client.calls.actions.updateClientState('call_control_id', {
client_state: 'aGF2ZSBhIG5pY2UgZGF5ID1d',
});
console.log(response.data);Returns: (string)
result更新客户端状态
PUT /calls/{call_control_id}/actions/client_state_updateclient_statejavascript
const response = await client.calls.actions.updateClientState('call_control_id', {
client_state: 'aGF2ZSBhIG5pY2UgZGF5ID1d',
});
console.log(response.data);返回结果:(字符串)
resultSend 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_dtmfdigitsOptional: (string), (string), (int32)
client_statecommand_idduration_millisjavascript
const response = await client.calls.actions.sendDtmf('call_control_id', { digits: '1www2WABCDw9' });
console.log(response.data);Returns: (string)
result从当前呼叫分支发送DTMF音,通话另一端会听到该音。预期Webhook:
此命令无关联Webhook。
POST /calls/{call_control_id}/actions/send_dtmfdigits可选参数:(字符串)、(字符串)、(int32)
client_statecommand_idduration_millisjavascript
const response = await client.calls.actions.sendDtmf('call_control_id', { digits: '1www2WABCDw9' });
console.log(response.data);返回结果:(字符串)
resultSIPREC start
启动SIPREC
Start siprec session to configured in SIPREC connector SRS.
Expected Webhooks:
siprec.startedsiprec.stoppedsiprec.failed
POST /calls/{call_control_id}/actions/siprec_startOptional: (string), (string), (boolean), (boolean), (integer), (enum: udp, tcp, tls), (enum: inbound_track, outbound_track, both_tracks)
client_stateconnector_nameinclude_metadata_custom_headerssecuresession_timeout_secssip_transportsiprec_trackjavascript
const response = await client.calls.actions.startSiprec('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);Returns: (string)
result启动SIPREC会话,需预先在SIPREC连接器SRS中配置。
预期Webhook:
siprec.startedsiprec.stoppedsiprec.failed
POST /calls/{call_control_id}/actions/siprec_start可选参数:(字符串)、(字符串)、(布尔值)、(布尔值)、(整数)、(枚举:udp, tcp, tls)、(枚举:inbound_track, outbound_track, both_tracks)
client_stateconnector_nameinclude_metadata_custom_headerssecuresession_timeout_secssip_transportsiprec_trackjavascript
const response = await client.calls.actions.startSiprec('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);返回结果:(字符串)
resultSIPREC stop
停止SIPREC
Stop SIPREC session. Expected Webhooks:
siprec.stopped
POST /calls/{call_control_id}/actions/siprec_stopOptional: (string), (string)
client_statecommand_idjavascript
const response = await client.calls.actions.stopSiprec('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);Returns: (string)
result停止SIPREC会话。预期Webhook:
siprec.stopped
POST /calls/{call_control_id}/actions/siprec_stop可选参数:(字符串)、(字符串)
client_statecommand_idjavascript
const response = await client.calls.actions.stopSiprec('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);返回结果:(字符串)
resultNoise Suppression Start (BETA)
启动噪声抑制(测试版)
POST /calls/{call_control_id}/actions/suppression_startOptional: (string), (string), (enum: inbound, outbound, both), (enum: Denoiser, DeepFilterNet, Krisp, AiCoustics), (object)
client_statecommand_iddirectionnoise_suppression_enginenoise_suppression_engine_configjavascript
const response = await client.calls.actions.startNoiseSuppression('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);Returns: (string)
resultPOST /calls/{call_control_id}/actions/suppression_start可选参数:(字符串)、(字符串)、(枚举:inbound, outbound, both)、(枚举:Denoiser, DeepFilterNet, Krisp, AiCoustics)、(对象)
client_statecommand_iddirectionnoise_suppression_enginenoise_suppression_engine_configjavascript
const response = await client.calls.actions.startNoiseSuppression('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);返回结果:(字符串)
resultNoise Suppression Stop (BETA)
停止噪声抑制(测试版)
POST /calls/{call_control_id}/actions/suppression_stopOptional: (string), (string)
client_statecommand_idjavascript
const response = await client.calls.actions.stopNoiseSuppression('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);Returns: (string)
resultPOST /calls/{call_control_id}/actions/suppression_stop可选参数:(字符串)、(字符串)
client_statecommand_idjavascript
const response = await client.calls.actions.stopNoiseSuppression('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);返回结果:(字符串)
resultSwitch 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_rolerolejavascript
const response = await client.calls.actions.switchSupervisorRole('call_control_id', {
role: 'barge',
});
console.log(response.data);Returns: (string)
result切换桥接通话的监控席角色,允许在通话过程中切换不同的监控模式
POST /calls/{call_control_id}/actions/switch_supervisor_rolerolejavascript
const response = await client.calls.actions.switchSupervisorRole('call_control_id', {
role: 'barge',
});
console.log(response.data);返回结果:(字符串)
resultWebhooks
Webhook
Webhook Verification
Webhook验证
Telnyx signs webhooks with Ed25519. Each request includes
and headers. Always verify signatures in production:
telnyx-signature-ed25519telnyx-timestampjavascript
// In your webhook handler (e.g., Express — use raw body, not parsed JSON):
app.post('/webhooks', express.raw({ type: 'application/json' }), async (req, res) => {
try {
const event = await client.webhooks.unwrap(req.body.toString(), {
headers: req.headers,
});
// Signature valid — event is the parsed webhook payload
console.log('Received event:', event.data.event_type);
res.status(200).send('OK');
} catch (err) {
console.error('Webhook verification failed:', err.message);
res.status(400).send('Invalid signature');
}
});The following webhook events are sent to your configured webhook URL.
All webhooks include and headers for Ed25519 signature verification. Use to verify.
telnyx-timestamptelnyx-signature-ed25519client.webhooks.unwrap()| Event | Description |
|---|---|
| Call Conversation Ended |
| Call Conversation Insights Generated |
| Call Dtmf Received |
| Call Machine Detection Ended |
| Call Machine Greeting Ended |
| Call Machine Premium Detection Ended |
| Call Machine Premium Greeting Ended |
| Call Refer Completed |
| Call Refer Failed |
| Call Refer Started |
| Call Siprec Failed |
| Call Siprec Started |
| Call Siprec Stopped |
Telnyx使用Ed25519对Webhook进行签名。每个请求都会包含和请求头。在生产环境中务必验证签名:
telnyx-signature-ed25519telnyx-timestampjavascript
// 在你的Webhook处理器中(例如Express — 使用原始请求体,而非解析后的JSON):
app.post('/webhooks', express.raw({ type: 'application/json' }), async (req, res) => {
try {
const event = await client.webhooks.unwrap(req.body.toString(), {
headers: req.headers,
});
// 签名有效 — event为解析后的Webhook负载
console.log('Received event:', event.data.event_type);
res.status(200).send('OK');
} catch (err) {
console.error('Webhook verification failed:', err.message);
res.status(400).send('Invalid signature');
}
});以下Webhook事件会发送到你配置的Webhook URL。所有Webhook均包含和请求头,用于Ed25519签名验证。使用进行验证。
telnyx-timestamptelnyx-signature-ed25519client.webhooks.unwrap()| 事件 | 描述 |
|---|---|
| 通话对话结束 |
| 通话对话洞察生成 |
| 收到通话DTMF |
| 通话机器检测结束 |
| 通话机器问候结束 |
| 通话高级机器检测结束 |
| 通话高级机器问候结束 |
| 通话转接完成 |
| 通话转接失败 |
| 通话转接开始 |
| 通话SIPREC失败 |
| 通话SIPREC启动 |
| 通话SIPREC停止 |
Webhook payload fields
Webhook负载字段
callConversationEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.conversation.ended | The type of event being delivered. |
| uuid | Unique identifier for the event. |
| date-time | ISO 8601 datetime of when the event occurred. |
| date-time | Timestamp when the event was created in the system. |
| string | Unique identifier of the assistant involved in the call. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call leg. |
| string | ID that is unique to the call session (group of related call legs). |
| string | Base64-encoded state received from a command. |
| enum: pstn, sip | The type of calling party connection. |
| string | ID unique to the conversation or insight group generated for the call. |
| integer | Duration of the conversation in seconds. |
| string | The caller's number or identifier. |
| string | The callee's number or SIP address. |
| string | The large language model used during the conversation. |
| string | The speech-to-text model used in the conversation. |
| string | The text-to-speech provider used in the call. |
| string | The model ID used for text-to-speech synthesis. |
| string | Voice ID used for TTS. |
callConversationInsightsGenerated| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.conversation_insights.generated | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| enum: pstn, sip | The type of calling party connection. |
| string | ID that is unique to the insight group being generated for the call. |
| array[object] | Array of insight results being generated for the call. |
callDtmfReceived| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.dtmf.received | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Identifies the type of resource. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Number or SIP URI placing the call. |
| string | Destination number or SIP URI of the call. |
| string | The received DTMF digit or symbol. |
callMachineDetectionEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.machine.detection.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Number or SIP URI placing the call. |
| string | Destination number or SIP URI of the call. |
| enum: human, machine, not_sure | Answering machine detection result. |
callMachineGreetingEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.machine.greeting.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Number or SIP URI placing the call. |
| string | Destination number or SIP URI of the call. |
| enum: beep_detected, ended, not_sure | Answering machine greeting ended result. |
callMachinePremiumDetectionEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.machine.premium.detection.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Number or SIP URI placing the call. |
| string | Destination number or SIP URI of the call. |
| enum: human_residence, human_business, machine, silence, fax_detected, not_sure | Premium Answering Machine Detection result. |
callMachinePremiumGreetingEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.machine.premium.greeting.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Number or SIP URI placing the call. |
| string | Destination number or SIP URI of the call. |
| enum: beep_detected, no_beep_detected | Premium Answering Machine Greeting Ended result. |
callReferCompleted| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.refer.completed | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Unique ID for controlling the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | State received from a command. |
| string | Number or SIP URI placing the call. |
| integer | SIP NOTIFY event status for tracking the REFER attempt. |
| string | Destination number or SIP URI of the call. |
callReferFailed| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.refer.failed | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Unique ID for controlling the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | State received from a command. |
| string | Number or SIP URI placing the call. |
| integer | SIP NOTIFY event status for tracking the REFER attempt. |
| string | Destination number or SIP URI of the call. |
callReferStarted| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.refer.started | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Unique ID for controlling the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | State received from a command. |
| string | Number or SIP URI placing the call. |
| integer | SIP NOTIFY event status for tracking the REFER attempt. |
| string | Destination number or SIP URI of the call. |
callSiprecFailed| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the resource. |
| enum: siprec.failed | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Q850 reason why siprec session failed. |
callSiprecStarted| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: siprec.started | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
callSiprecStopped| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: siprec.stopped | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Q850 reason why the SIPREC session was stopped. |
callConversationEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举: event | 标识资源类型。 |
| 枚举: call.conversation.ended | 所传递的事件类型。 |
| uuid | 事件的唯一标识符。 |
| date-time | 事件发生的ISO 8601格式日期时间。 |
| date-time | 事件在系统中创建的时间戳。 |
| string | 通话中涉及的助手唯一标识符。 |
| string | 用于通过呼叫控制API发送命令的通话ID。 |
| string | 通话中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| string | 呼叫分支的唯一ID。 |
| string | 通话会话的唯一ID(相关呼叫分支组)。 |
| string | 从命令接收的Base64编码状态。 |
| 枚举: pstn, sip | 主叫方连接类型。 |
| string | 通话生成的对话或洞察组的唯一ID。 |
| integer | 对话持续时间(秒)。 |
| string | 主叫号码或标识符。 |
| string | 被叫号码或SIP地址。 |
| string | 对话中使用的大语言模型。 |
| string | 对话中使用的语音转文本模型。 |
| string | 通话中使用的文本转语音提供商。 |
| string | 文本转语音合成使用的模型ID。 |
| string | TTS使用的语音ID。 |
callConversationInsightsGenerated| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举: event | 标识资源类型。 |
| 枚举: call.conversation_insights.generated | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式日期时间。 |
| string | 用于通过呼叫控制API发送命令的通话ID。 |
| string | 通话中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| string | 通话的唯一ID,可用于关联Webhook事件。 |
| string | 通话会话的唯一ID,可用于关联Webhook事件。 |
| string | 从命令接收的状态。 |
| 枚举: pstn, sip | 主叫方连接类型。 |
| string | 通话生成的洞察组的唯一ID。 |
| array[object] | 通话生成的洞察结果数组。 |
callDtmfReceived| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举: event | 标识资源类型。 |
| 枚举: call.dtmf.received | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式日期时间。 |
| string | 用于通过呼叫控制API发送命令的通话ID。 |
| string | 标识资源类型。 |
| string | 通话的唯一ID,可用于关联Webhook事件。 |
| string | 通话会话的唯一ID,可用于关联Webhook事件。 |
| string | 从命令接收的状态。 |
| string | 发起通话的号码或SIP URI。 |
| string | 通话的目标号码或SIP URI。 |
| string | 收到的DTMF数字或符号。 |
callMachineDetectionEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举: event | 标识资源类型。 |
| 枚举: call.machine.detection.ended | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式日期时间。 |
| string | 用于通过呼叫控制API发送命令的通话ID。 |
| string | 通话中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| string | 通话的唯一ID,可用于关联Webhook事件。 |
| string | 通话会话的唯一ID,可用于关联Webhook事件。 |
| string | 从命令接收的状态。 |
| string | 发起通话的号码或SIP URI。 |
| string | 通话的目标号码或SIP URI。 |
| 枚举: human, machine, not_sure | 答录机检测结果。 |
callMachineGreetingEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举: event | 标识资源类型。 |
| 枚举: call.machine.greeting.ended | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式日期时间。 |
| string | 用于通过呼叫控制API发送命令的通话ID。 |
| string | 通话中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| string | 通话的唯一ID,可用于关联Webhook事件。 |
| string | 通话会话的唯一ID,可用于关联Webhook事件。 |
| string | 从命令接收的状态。 |
| string | 发起通话的号码或SIP URI。 |
| string | 通话的目标号码或SIP URI。 |
| 枚举: beep_detected, ended, not_sure | 答录机问候结束结果。 |
callMachinePremiumDetectionEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举: event | 标识资源类型。 |
| 枚举: call.machine.premium.detection.ended | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式日期时间。 |
| string | 用于通过呼叫控制API发送命令的通话ID。 |
| string | 通话中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| string | 通话的唯一ID,可用于关联Webhook事件。 |
| string | 通话会话的唯一ID,可用于关联Webhook事件。 |
| string | 从命令接收的状态。 |
| string | 发起通话的号码或SIP URI。 |
| string | 通话的目标号码或SIP URI。 |
| 枚举: human_residence, human_business, machine, silence, fax_detected, not_sure | 高级答录机检测结果。 |
callMachinePremiumGreetingEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举: event | 标识资源类型。 |
| 枚举: call.machine.premium.greeting.ended | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式日期时间。 |
| string | 用于通过呼叫控制API发送命令的通话ID。 |
| string | 通话中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| string | 通话的唯一ID,可用于关联Webhook事件。 |
| string | 通话会话的唯一ID,可用于关联Webhook事件。 |
| string | 从命令接收的状态。 |
| string | 发起通话的号码或SIP URI。 |
| string | 通话的目标号码或SIP URI。 |
| 枚举: beep_detected, no_beep_detected | 高级答录机问候结束结果。 |
callReferCompleted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举: event | 标识资源类型。 |
| 枚举: call.refer.completed | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式日期时间。 |
| string | 控制通话的唯一ID。 |
| string | 通话的唯一ID,可用于关联Webhook事件。 |
| string | 通话会话的唯一ID,可用于关联Webhook事件。 |
| string | 通话中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| string | 从命令接收的状态。 |
| string | 发起通话的号码或SIP URI。 |
| integer | 用于跟踪转接尝试的SIP NOTIFY事件状态。 |
| string | 通话的目标号码或SIP URI。 |
callReferFailed| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举: event | 标识资源类型。 |
| 枚举: call.refer.failed | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式日期时间。 |
| string | 控制通话的唯一ID。 |
| string | 通话的唯一ID,可用于关联Webhook事件。 |
| string | 通话会话的唯一ID,可用于关联Webhook事件。 |
| string | 通话中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| string | 从命令接收的状态。 |
| string | 发起通话的号码或SIP URI。 |
| integer | 用于跟踪转接尝试的SIP NOTIFY事件状态。 |
| string | 通话的目标号码或SIP URI。 |
callReferStarted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举: event | 标识资源类型。 |
| 枚举: call.refer.started | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式日期时间。 |
| string | 控制通话的唯一ID。 |
| string | 通话的唯一ID,可用于关联Webhook事件。 |
| string | 通话会话的唯一ID,可用于关联Webhook事件。 |
| string | 通话中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| string | 从命令接收的状态。 |
| string | 发起通话的号码或SIP URI。 |
| integer | 用于跟踪转接尝试的SIP NOTIFY事件状态。 |
| string | 通话的目标号码或SIP URI。 |
callSiprecFailed| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举: event | 标识资源。 |
| 枚举: siprec.failed | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式日期时间。 |
| string | 用于通过呼叫控制API发送命令的通话ID。 |
| string | 通话中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| string | 通话的唯一ID,可用于关联Webhook事件。 |
| string | 通话会话的唯一ID,可用于关联Webhook事件。 |
| string | 从命令接收的状态。 |
| string | SIPREC会话失败的Q850原因。 |
callSiprecStarted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举: event | 标识资源类型。 |
| 枚举: siprec.started | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式日期时间。 |
| string | 用于通过呼叫控制API发送命令的通话ID。 |
| string | 通话中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| string | 通话的唯一ID,可用于关联Webhook事件。 |
| string | 通话会话的唯一ID,可用于关联Webhook事件。 |
| string | 从命令接收的状态。 |
callSiprecStopped| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举: event | 标识资源类型。 |
| 枚举: siprec.stopped | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式日期时间。 |
| string | 用于通过呼叫控制API发送命令的通话ID。 |
| string | 通话中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| string | 通话的唯一ID,可用于关联Webhook事件。 |
| string | 通话会话的唯一ID,可用于关联Webhook事件。 |
| string | 从命令接收的状态。 |
| string | SIPREC会话停止的Q850原因。 |