telnyx-voice-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 - 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 response = await client.calls.dial({
connection_id: '7267xxxxxxxxxxxxxx',
from: '+18005550101',
to: '+18005550100',
});
} catch (err) {
if (err instanceof Telnyx.APIConnectionError) {
console.error('Network error — check connectivity and retry');
} else if (err instanceof Telnyx.RateLimitError) {
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 response = await client.calls.dial({
connection_id: '7267xxxxxxxxxxxxxx',
from: '+18005550101',
to: '+18005550100',
});
} catch (err) {
if (err instanceof Telnyx.APIConnectionError) {
console.error('网络错误 —— 检查网络连接后重试');
} else if (err instanceof Telnyx.RateLimitError) {
const retryAfter = err.headers?.['retry-after'] || 1;
await new Promise(r => setTimeout(r, retryAfter * 1000));
} else if (err instanceof Telnyx.APIError) {
console.error(`API错误 ${err.status}: ${err.message}`);
if (err.status === 422) {
console.error('校验错误 —— 检查必填字段和格式');
}
}
}常见错误码: API密钥无效, 权限不足, 资源未找到, 校验错误(请检查字段格式), 触发速率限制(请使用指数退避策略重试)。
401403404422429Important Notes
重要提示
- Phone numbers must be in E.164 format (e.g., ). Include the
+13125550001prefix and country code. No spaces, dashes, or parentheses.+ - Pagination: List methods return an auto-paginating iterator. Use to iterate through all pages automatically.
for await (const item of result) { ... }
- 电话号码必须采用E.164格式(例如)。需包含
+13125550001前缀和国家代码,不允许有空格、短横线或括号。+ - 分页: 列表方法返回自动分页的迭代器。使用可以自动遍历所有页面。
for await (const item of result) { ... }
Operational Caveats
操作注意事项
- Call Control is event-driven. After or an inbound webhook, issue follow-up commands from webhook handlers using the
dial()in the event payload.call_control_id - Outbound and inbound flows are different: outbound calls start with , while inbound calls must be answered from the incoming webhook before other commands run.
dial() - A publicly reachable webhook endpoint is required for real call control. Without it, calls may connect but your application cannot drive the live call state.
- 通话控制是事件驱动的。在调用或收到入站webhook后,需要使用事件 payload 中的
dial()在webhook处理程序中发起后续命令。call_control_id - 出站和入站流程不同:出站通话以开头,而入站通话必须先在收到的webhook中应答,才能运行其他命令。
dial() - 要实现实际的通话控制,需要一个公网可访问的webhook端点。没有该端点的话,通话虽然可以连接,但你的应用无法控制实时通话状态。
Reference Use Rules
参考使用规则
Do not invent Telnyx parameters, enums, response fields, or webhook fields.
- If the parameter, enum, or response field you need is not shown inline in this skill, read references/api-details.md before writing code.
- Before using any operation in , read the optional-parameters section and the response-schemas section.
## Additional Operations - Before reading or matching webhook fields beyond the inline examples, read the webhook payload reference.
请勿自行编造Telnyx参数、枚举值、响应字段或webhook字段。
- 如果你需要的参数、枚举值或响应字段没有在本技能中直接展示,请先阅读references/api-details.md再编写代码。
- 在使用中的任何接口前,请先阅读可选参数章节和响应模式章节。
## 额外操作 - 在读取或匹配超出内联示例的webhook字段前,请先阅读webhook payload参考。
Core Tasks
核心任务
Dial an outbound call
拨打出站通话
Primary voice entrypoint. Agents need the async call-control identifiers returned here.
client.calls.dial()POST /calls| Parameter | Type | Required | Description |
|---|---|---|---|
| string (E.164) | Yes | The DID or SIP URI to dial out to. |
| string (E.164) | Yes | The |
| string (UUID) | Yes | The ID of the Call Control App (formerly ID of the connectio... |
| integer | No | The number of seconds that Telnyx will wait for the call to ... |
| string (UUID) | No | Use this field to set the Billing Group ID for the call. |
| string | No | Use this field to add state to every subsequent webhook. |
| ... | +48 optional params in references/api-details.md |
javascript
const response = await client.calls.dial({
connection_id: '7267xxxxxxxxxxxxxx',
from: '+18005550101',
to: '+18005550100',
});
console.log(response.data);Primary response fields:
response.data.callControlIdresponse.data.callLegIdresponse.data.callSessionIdresponse.data.isAliveresponse.data.recordingIdresponse.data.callDuration
主要的语音入口。Agent需要这里返回的异步通话控制标识符。
client.calls.dial()POST /calls| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| string (E.164) | 是 | 要拨打的DID或SIP URI。 |
| string (E.164) | 是 | 用作来电显示的主叫号码。 |
| string (UUID) | 是 | 通话控制应用的ID(原连接ID)。 |
| integer | 否 | Telnyx等待通话接通的秒数。 |
| string (UUID) | 否 | 用于设置通话对应的账单组ID。 |
| string | 否 | 用于给后续所有webhook添加自定义状态。 |
| ... | 另有48个可选参数见references/api-details.md |
javascript
const response = await client.calls.dial({
connection_id: '7267xxxxxxxxxxxxxx',
from: '+18005550101',
to: '+18005550100',
});
console.log(response.data);主要响应字段:
response.data.callControlIdresponse.data.callLegIdresponse.data.callSessionIdresponse.data.isAliveresponse.data.recordingIdresponse.data.callDuration
Answer an inbound call
接收入站通话
Primary inbound call-control command.
client.calls.actions.answer()POST /calls/{call_control_id}/actions/answer| Parameter | Type | Required | Description |
|---|---|---|---|
| string (UUID) | Yes | Unique identifier and token for controlling the call |
| string (UUID) | No | Use this field to set the Billing Group ID for the call. |
| string | No | Use this field to add state to every subsequent webhook. |
| string (URL) | No | Use this field to override the URL for which Telnyx will sen... |
| ... | +26 optional params in references/api-details.md |
javascript
const response = await client.calls.actions.answer('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);Primary response fields:
response.data.resultresponse.data.recordingId
主要的入站通话控制命令。
client.calls.actions.answer()POST /calls/{call_control_id}/actions/answer| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| string (UUID) | 是 | 用于控制通话的唯一标识符和令牌 |
| string (UUID) | 否 | 用于设置通话对应的账单组ID。 |
| string | 否 | 用于给后续所有webhook添加自定义状态。 |
| string (URL) | 否 | 用于覆盖Telnyx发送事件的目标URL。 |
| ... | 另有26个可选参数见references/api-details.md |
javascript
const response = await client.calls.actions.answer('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);主要响应字段:
response.data.resultresponse.data.recordingId
Transfer a live call
转接正在进行的通话
Common post-answer control path with downstream webhook implications.
client.calls.actions.transfer()POST /calls/{call_control_id}/actions/transfer| Parameter | Type | Required | Description |
|---|---|---|---|
| string (E.164) | Yes | The DID or SIP URI to dial out to. |
| string (UUID) | Yes | Unique identifier and token for controlling the call |
| integer | No | The number of seconds that Telnyx will wait for the call to ... |
| string | No | Use this field to add state to every subsequent webhook. |
| string (URL) | No | Use this field to override the URL for which Telnyx will sen... |
| ... | +33 optional params in references/api-details.md |
javascript
const response = await client.calls.actions.transfer('call_control_id', {
to: '+18005550100',
});
console.log(response.data);Primary response fields:
response.data.result
常见的通话应答后控制流程,会触发后续webhook事件。
client.calls.actions.transfer()POST /calls/{call_control_id}/actions/transfer| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| string (E.164) | 是 | 要转接的目标DID或SIP URI。 |
| string (UUID) | 是 | 用于控制通话的唯一标识符和令牌 |
| integer | 否 | Telnyx等待通话接通的秒数。 |
| string | 否 | 用于给后续所有webhook添加自定义状态。 |
| string (URL) | 否 | 用于覆盖Telnyx发送事件的目标URL。 |
| ... | 另有33个可选参数见references/api-details.md |
javascript
const response = await client.calls.actions.transfer('call_control_id', {
to: '+18005550100',
});
console.log(response.data);主要响应字段:
response.data.result
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');
}
});Telnyx使用Ed25519对webhook进行签名。每个请求都包含和头。生产环境中请务必验证签名:
telnyx-signature-ed25519telnyx-timestampjavascript
// 在你的webhook处理程序中(例如Express —— 使用原始body,不要用解析后的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 payload
console.log('收到事件:', event.data.event_type);
res.status(200).send('OK');
} catch (err) {
console.error('Webhook验证失败:', err.message);
res.status(400).send('无效签名');
}
});Webhooks
Webhooks
These webhook payload fields are inline because they are part of the primary integration path.
以下webhook payload字段为内联展示,属于核心集成路径的一部分。
Call Answered
通话已应答
| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.answered | 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 ev... |
| 字段 | 类型 | 描述 |
|---|---|---|
| enum: event | 标识资源类型。 |
| enum: call.answered | 推送的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式时间。 |
| string | 用于通过通话控制API发起命令的通话ID。 |
| string | 通话使用的通话控制应用ID(原Telnyx连接ID)。 |
| string | 通话的唯一ID,可用于关联webhook事件。 |
| string | 通话会话的唯一ID,可用于关联webhook事件。 |
Call Hangup
通话已挂断
| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.hangup | 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 ev... |
| 字段 | 类型 | 描述 |
|---|---|---|
| enum: event | 标识资源类型。 |
| enum: call.hangup | 推送的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式时间。 |
| string | 用于通过通话控制API发起命令的通话ID。 |
| string | 通话使用的通话控制应用ID(原Telnyx连接ID)。 |
| string | 通话的唯一ID,可用于关联webhook事件。 |
| string | 通话会话的唯一ID,可用于关联webhook事件。 |
Call Initiated
通话已发起
| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.initiated | 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 | The list of comma-separated codecs enabled for the connection. |
| string | The list of comma-separated codecs offered by caller. |
If you need webhook fields that are not listed inline here, read the webhook payload reference before writing the handler.
| 字段 | 类型 | 描述 |
|---|---|---|
| enum: event | 标识资源类型。 |
| enum: call.initiated | 推送的事件类型。 |
| uuid | 标识资源类型。 |
| date-time | 事件发生的ISO 8601格式时间。 |
| string | 用于通过通话控制API发起命令的通话ID。 |
| string | 通话使用的通话控制应用ID(原Telnyx连接ID)。 |
| string | 连接启用的编码列表,用逗号分隔。 |
| string | 主叫方提供的编码列表,用逗号分隔。 |
如果你需要的webhook字段没有在此处内联展示,请先阅读webhook payload参考再编写处理程序。
Important Supporting Operations
重要支持操作
Use these when the core tasks above are close to your flow, but you need a common variation or follow-up step.
当上面的核心任务接近你的业务流程,但你需要常见的变体或后续步骤时,可以使用这些操作。
Hangup call
挂断通话
End a live call from your webhook-driven control flow.
client.calls.actions.hangup()POST /calls/{call_control_id}/actions/hangup| Parameter | Type | Required | Description |
|---|---|---|---|
| string (UUID) | Yes | Unique identifier and token for controlling the call |
| string | No | Use this field to add state to every subsequent webhook. |
| string (UUID) | No | Use this field to avoid duplicate commands. |
| array[object] | No | Custom headers to be added to the SIP BYE message. |
javascript
const response = await client.calls.actions.hangup('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);Primary response fields:
response.data.result
在webhook驱动的控制流程中结束正在进行的通话。
client.calls.actions.hangup()POST /calls/{call_control_id}/actions/hangup| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| string (UUID) | 是 | 用于控制通话的唯一标识符和令牌 |
| string | 否 | 用于给后续所有webhook添加自定义状态。 |
| string (UUID) | 否 | 用于避免重复提交命令。 |
| array[object] | 否 | 添加到SIP BYE消息中的自定义头。 |
javascript
const response = await client.calls.actions.hangup('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);主要响应字段:
response.data.result
Bridge calls
桥接通话
Trigger a follow-up action in an existing workflow rather than creating a new top-level resource.
client.calls.actions.bridge()POST /calls/{call_control_id}/actions/bridge| Parameter | Type | Required | Description |
|---|---|---|---|
| string (UUID) | Yes | The Call Control ID of the call you want to bridge with, can... |
| string (UUID) | Yes | Unique identifier and token for controlling the call |
| string | No | Use this field to add state to every subsequent webhook. |
| string (UUID) | No | Use this field to avoid duplicate commands. |
| string (UUID) | No | The ID of the video room you want to bridge with, can't be u... |
| ... | +16 optional params in references/api-details.md |
javascript
const response = await client.calls.actions.bridge('call_control_id', {
call_control_id_to_bridge_with: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
});
console.log(response.data);Primary response fields:
response.data.result
在现有工作流中触发后续操作,无需创建新的顶层资源。
client.calls.actions.bridge()POST /calls/{call_control_id}/actions/bridge| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| string (UUID) | 是 | 要桥接的目标通话的通话控制ID |
| string (UUID) | 是 | 用于控制通话的唯一标识符和令牌 |
| string | 否 | 用于给后续所有webhook添加自定义状态。 |
| string (UUID) | 否 | 用于避免重复提交命令。 |
| string (UUID) | 否 | 要桥接的视频房间ID,不可与其他桥接目标同时使用。 |
| ... | 另有16个可选参数见references/api-details.md |
javascript
const response = await client.calls.actions.bridge('call_control_id', {
call_control_id_to_bridge_with: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
});
console.log(response.data);主要响应字段:
response.data.result
Reject a call
拒接通话
Trigger a follow-up action in an existing workflow rather than creating a new top-level resource.
client.calls.actions.reject()POST /calls/{call_control_id}/actions/reject| Parameter | Type | Required | Description |
|---|---|---|---|
| enum (CALL_REJECTED, USER_BUSY) | Yes | Cause for call rejection. |
| string (UUID) | Yes | Unique identifier and token for controlling the call |
| string | No | Use this field to add state to every subsequent webhook. |
| string (UUID) | No | Use this field to avoid duplicate commands. |
javascript
const response = await client.calls.actions.reject('call_control_id', { cause: 'USER_BUSY' });
console.log(response.data);Primary response fields:
response.data.result
在现有工作流中触发后续操作,无需创建新的顶层资源。
client.calls.actions.reject()POST /calls/{call_control_id}/actions/reject| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| enum (CALL_REJECTED, USER_BUSY) | 是 | 拒接通话的原因。 |
| string (UUID) | 是 | 用于控制通话的唯一标识符和令牌 |
| string | 否 | 用于给后续所有webhook添加自定义状态。 |
| string (UUID) | 否 | 用于避免重复提交命令。 |
javascript
const response = await client.calls.actions.reject('call_control_id', { cause: 'USER_BUSY' });
console.log(response.data);主要响应字段:
response.data.result
Retrieve a call status
获取通话状态
Fetch the current state before updating, deleting, or making control-flow decisions.
client.calls.retrieveStatus()GET /calls/{call_control_id}| Parameter | Type | Required | Description |
|---|---|---|---|
| string (UUID) | Yes | Unique identifier and token for controlling the call |
javascript
const response = await client.calls.retrieveStatus('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);Primary response fields:
response.data.callControlIdresponse.data.callDurationresponse.data.callLegIdresponse.data.callSessionIdresponse.data.clientStateresponse.data.endTime
在更新、删除或做出控制流决策前获取当前通话状态。
client.calls.retrieveStatus()GET /calls/{call_control_id}| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| string (UUID) | 是 | 用于控制通话的唯一标识符和令牌 |
javascript
const response = await client.calls.retrieveStatus('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);主要响应字段:
response.data.callControlIdresponse.data.callDurationresponse.data.callLegIdresponse.data.callSessionIdresponse.data.clientStateresponse.data.endTime
List all active calls for given connection
列出指定连接下的所有活跃通话
Fetch the current state before updating, deleting, or making control-flow decisions.
client.connections.listActiveCalls()GET /connections/{connection_id}/active_calls| Parameter | Type | Required | Description |
|---|---|---|---|
| string (UUID) | Yes | Telnyx connection id |
| object | No | Consolidated page parameter (deepObject style). |
javascript
// Automatically fetches more pages as needed.
for await (const connectionListActiveCallsResponse of client.connections.listActiveCalls(
'1293384261075731461',
)) {
console.log(connectionListActiveCallsResponse.call_control_id);
}Response wrapper:
- items:
connectionListActiveCallsResponse.data - pagination:
connectionListActiveCallsResponse.meta
Primary item fields:
callControlIdcallDurationcallLegIdcallSessionIdclientStaterecordType
在更新、删除或做出控制流决策前获取当前状态。
client.connections.listActiveCalls()GET /connections/{connection_id}/active_calls| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| string (UUID) | 是 | Telnyx连接ID |
| object | 否 | 统一分页参数(deepObject格式)。 |
javascript
// 按需自动获取更多页面数据
for await (const connectionListActiveCallsResponse of client.connections.listActiveCalls(
'1293384261075731461',
)) {
console.log(connectionListActiveCallsResponse.call_control_id);
}响应包装:
- 条目:
connectionListActiveCallsResponse.data - 分页信息:
connectionListActiveCallsResponse.meta
主要条目字段:
callControlIdcallDurationcallLegIdcallSessionIdclientStaterecordType
List call control applications
列出通话控制应用
Inspect available resources or choose an existing resource before mutating it.
client.callControlApplications.list()GET /call_control_applications| Parameter | Type | Required | Description |
|---|---|---|---|
| enum (created_at, connection_name, active) | No | Specifies the sort order for results. |
| object | No | Consolidated filter parameter (deepObject style). |
| object | No | Consolidated page parameter (deepObject style). |
javascript
// Automatically fetches more pages as needed.
for await (const callControlApplication of client.callControlApplications.list()) {
console.log(callControlApplication.id);
}Response wrapper:
- items:
callControlApplication.data - pagination:
callControlApplication.meta
Primary item fields:
idcreatedAtupdatedAtactiveanchorsiteOverrideapplicationName
在修改资源前检查可用资源或选择现有资源。
client.callControlApplications.list()GET /call_control_applications| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| enum (created_at, connection_name, active) | 否 | 指定结果的排序规则。 |
| object | 否 | 统一过滤参数(deepObject格式)。 |
| object | 否 | 统一分页参数(deepObject格式)。 |
javascript
// 按需自动获取更多页面数据
for await (const callControlApplication of client.callControlApplications.list()) {
console.log(callControlApplication.id);
}响应包装:
- 条目:
callControlApplication.data - 分页信息:
callControlApplication.meta
主要条目字段:
idcreatedAtupdatedAtactiveanchorsiteOverrideapplicationName
Additional Operations
额外操作
Use the core tasks above first. The operations below are indexed here with exact SDK methods and required params; use references/api-details.md for full optional params, response schemas, and lower-frequency webhook payloads.
Before using any operation below, read the optional-parameters section and the response-schemas section so you do not guess missing fields.
| Operation | SDK method | Endpoint | Use when | Required params |
|---|---|---|---|---|
| Create a call control application | | | Create or provision an additional resource when the core tasks do not cover this flow. | |
| Retrieve a call control application | | | Fetch the current state before updating, deleting, or making control-flow decisions. | |
| Update a call control application | | | Modify an existing resource without recreating it. | |
| Delete a call control application | | | Remove, detach, or clean up an existing resource. | |
| SIP Refer a call | | | Trigger a follow-up action in an existing workflow rather than creating a new top-level resource. | |
| Send SIP info | | | Trigger a follow-up action in an existing workflow rather than creating a new top-level resource. | |
请优先使用上面的核心任务。下方的操作在此处列出了准确的SDK方法和必填参数;如需完整的可选参数、响应模式和低频率webhook payload,请参考references/api-details.md。
在使用下方任何操作前,请先阅读可选参数章节和响应模式章节,避免猜测缺失字段。
| 操作 | SDK方法 | 接口地址 | 使用场景 | 必填参数 |
|---|---|---|---|---|
| 创建通话控制应用 | | | 当核心任务没有覆盖该流程时,创建或配置额外的资源。 | |
| 获取通话控制应用 | | | 在更新、删除或做出控制流决策前获取当前状态。 | |
| 更新通话控制应用 | | | 修改现有资源,无需重新创建。 | |
| 删除通话控制应用 | | | 移除、解绑或清理现有资源。 | |
| 发起SIP Refer通话转接 | | | 在现有工作流中触发后续操作,无需创建新的顶层资源。 | |
| 发送SIP Info | | | 在现有工作流中触发后续操作,无需创建新的顶层资源。 | |
Other Webhook Events
其他Webhook事件
| Event | | Description |
|---|---|---|
| | Call Bridged |
For exhaustive optional parameters, full response schemas, and complete webhook payloads, see references/api-details.md.
| 事件 | | 描述 |
|---|---|---|
| | 通话已桥接 |
如需完整的可选参数、完整响应模式和全部webhook payload,请查看references/api-details.md。