Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计通过

telnyx-voice-javascripttelnyx voice JavaScript 测试

Agent Skill

用于辅助 Java 项目开发、面向对象设计、Spring 生态、Maven 或 Gradle 依赖和后端工程实践。它适合让 Agent 分析类结构、设计接口、整理服务分层、生成测试或检查常见代码坏味道。使用时需要结合项目已有架构、包结构和依赖版本,不应只按通用教程改代码;涉及数据库、事务、并发或框架配置时,应先确认运行环境和回归测试范围。

总安装

1,730

周安装

70

GitHub Stars

171

下载量

543
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:telnyx-voice-javascript(telnyx voice JavaScript 测试)
来源仓库:https://github.com/team-telnyx/skills
仓库路径:skills/telnyx-voice-javascript
安装命令:
npx skills add https://github.com/team-telnyx/skills --skill telnyx-voice-javascript
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/team-telnyx/skills --skill telnyx-voice-javascript

简介

用于辅助 Telnyx 基础语音功能相关的 JavaScript 项目开发与支持。

  • 适合处理前端语音交互、API 调用及用户界面集成。
  • 通过 GitHub 安装,适用于 Codex、Claude、Cursor 和 Gemini CLI 等宿主环境。
  • 需确认 Node.js 版本和 npm 依赖,避免使用废弃 API。
  • 涉及用户输入处理时,应做输入验证和 XSS 防护措施。

SKILL.md

Telnyx Voice - JavaScript

Installation

npm install telnyx

Setup

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 client is already initialized as shown above.

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:

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: 401 invalid API key, 403 insufficient permissions, 404 resource not found, 422 validation error (check field formats), 429 rate limited (retry with exponential backoff).

Important Notes

  • Phone numbers must be in E.164 format (e.g., +13125550001). Include the + prefix and country code. No spaces, dashes, or parentheses.
  • Pagination: List methods return an auto-paginating iterator. Use for await (const item of result) {...} to iterate through all pages automatically.

Operational Caveats

  • Call Control is event-driven. After dial() or an inbound webhook, issue follow-up commands from webhook handlers using the call_control_id in the event payload.
  • Outbound and inbound flows are different: outbound calls start with dial(), while inbound calls must be answered from the incoming webhook before other commands run.
  • 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.

Reference Use Rules

Do not invent Telnyx parameters, enums, response fields, or webhook fields.

Core Tasks

Dial an outbound call

Primary voice entrypoint. Agents need the async call-control identifiers returned here.

client.calls.dial()POST /calls

ParameterTypeRequiredDescription
tostring (E.164)YesThe DID or SIP URI to dial out to.
fromstring (E.164)YesThe from number to be used as the caller id presented to t...
connectionIdstring (UUID)YesThe ID of the Call Control App (formerly ID of the connectio...
timeoutSecsintegerNoThe number of seconds that Telnyx will wait for the call to...
billingGroupIdstring (UUID)NoUse this field to set the Billing Group ID for the call.
clientStatestringNoUse this field to add state to every subsequent webhook.
...+48 optional params in references/api-details.md
const response = await client.calls.dial({
  connection_id: '7267xxxxxxxxxxxxxx',
  from: '+18005550101',
  to: '+18005550100',
});

console.log(response.data);

Primary response fields:

  • response.data.callControlId
  • response.data.callLegId
  • response.data.callSessionId
  • response.data.isAlive
  • response.data.recordingId
  • response.data.callDuration

Answer an inbound call

Primary inbound call-control command.

client.calls.actions.answer()POST /calls/{call_control_id}/actions/answer

ParameterTypeRequiredDescription
callControlIdstring (UUID)YesUnique identifier and token for controlling the call
billingGroupIdstring (UUID)NoUse this field to set the Billing Group ID for the call.
clientStatestringNoUse this field to add state to every subsequent webhook.
webhookUrlstring (URL)NoUse this field to override the URL for which Telnyx will sen...
...+26 optional params in references/api-details.md
const response = await client.calls.actions.answer('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');

console.log(response.data);

Primary response fields:

  • response.data.result
  • response.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

ParameterTypeRequiredDescription
tostring (E.164)YesThe DID or SIP URI to dial out to.
callControlIdstring (UUID)YesUnique identifier and token for controlling the call
timeoutSecsintegerNoThe number of seconds that Telnyx will wait for the call to...
clientStatestringNoUse this field to add state to every subsequent webhook.
webhookUrlstring (URL)NoUse this field to override the URL for which Telnyx will sen...
...+33 optional params in references/api-details.md
const response = await client.calls.actions.transfer('call_control_id', {
  to: '+18005550100',
});

console.log(response.data);

Primary response fields:

  • response.data.result

Webhook Verification

Telnyx signs webhooks with Ed25519. Each request includes telnyx-signature-ed25519 and telnyx-timestamp headers. Always verify signatures in production:

// 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');
  }
});

Webhooks

These webhook payload fields are inline because they are part of the primary integration path.

Call Answered

FieldTypeDescription
data.record_typeenum: eventIdentifies the type of the resource.
data.event_typeenum: call.answeredThe type of event being delivered.
data.iduuidIdentifies the type of resource.
data.occurred_atdate-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_idstringCall ID used to issue commands via Call Control API.
data.payload.connection_idstringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_idstringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_idstringID that is unique to the call session and can be used to correlate webhook ev...

Call Hangup

FieldTypeDescription
data.record_typeenum: eventIdentifies the type of the resource.
data.event_typeenum: call.hangupThe type of event being delivered.
data.iduuidIdentifies the type of resource.
data.occurred_atdate-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_idstringCall ID used to issue commands via Call Control API.
data.payload.connection_idstringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_idstringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_idstringID that is unique to the call session and can be used to correlate webhook ev...

Call Initiated

FieldTypeDescription
data.record_typeenum: eventIdentifies the type of the resource.
data.event_typeenum: call.initiatedThe type of event being delivered.
data.iduuidIdentifies the type of resource.
data.occurred_atdate-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_idstringCall ID used to issue commands via Call Control API.
data.payload.connection_idstringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.connection_codecsstringThe list of comma-separated codecs enabled for the connection.
data.payload.offered_codecsstringThe 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.


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

ParameterTypeRequiredDescription
callControlIdstring (UUID)YesUnique identifier and token for controlling the call
clientStatestringNoUse this field to add state to every subsequent webhook.
commandIdstring (UUID)NoUse this field to avoid duplicate commands.
customHeadersarray[object]NoCustom headers to be added to the SIP BYE message.
const response = await client.calls.actions.hangup('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');

console.log(response.data);

Primary response fields:

  • 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

ParameterTypeRequiredDescription
callControlIdstring (UUID)YesThe Call Control ID of the call you want to bridge with, can...
callControlIdstring (UUID)YesUnique identifier and token for controlling the call
clientStatestringNoUse this field to add state to every subsequent webhook.
commandIdstring (UUID)NoUse this field to avoid duplicate commands.
videoRoomIdstring (UUID)NoThe ID of the video room you want to bridge with, can't be u...
...+16 optional params in references/api-details.md
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

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

ParameterTypeRequiredDescription
causeenum (CALL_REJECTED, USER_BUSY)YesCause for call rejection.
callControlIdstring (UUID)YesUnique identifier and token for controlling the call
clientStatestringNoUse this field to add state to every subsequent webhook.
commandIdstring (UUID)NoUse this field to avoid duplicate commands.
const response = await client.calls.actions.reject('call_control_id', { cause: 'USER_BUSY' });

console.log(response.data);

Primary response fields:

  • 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}

ParameterTypeRequiredDescription
callControlIdstring (UUID)YesUnique identifier and token for controlling the call
const response = await client.calls.retrieveStatus('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');

console.log(response.data);

Primary response fields:

  • response.data.callControlId
  • response.data.callDuration
  • response.data.callLegId
  • response.data.callSessionId
  • response.data.clientState
  • response.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

ParameterTypeRequiredDescription
connectionIdstring (UUID)YesTelnyx connection id
pageobjectNoConsolidated page parameter (deepObject style).
// 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:

  • callControlId
  • callDuration
  • callLegId
  • callSessionId
  • clientState
  • recordType

List call control applications

Inspect available resources or choose an existing resource before mutating it.

client.callControlApplications.list()GET /call_control_applications

ParameterTypeRequiredDescription
sortenum (created_at, connection_name, active)NoSpecifies the sort order for results.
filterobjectNoConsolidated filter parameter (deepObject style).
pageobjectNoConsolidated page parameter (deepObject style).
// 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:

  • id
  • createdAt
  • updatedAt
  • active
  • anchorsiteOverride
  • applicationName

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.

OperationSDK methodEndpointUse whenRequired params
Create a call control applicationclient.callControlApplications.create()POST /call_control_applicationsCreate or provision an additional resource when the core tasks do not cover this flow.applicationName, webhookEventUrl
Retrieve a call control applicationclient.callControlApplications.retrieve()GET /call_control_applications/{id}Fetch the current state before updating, deleting, or making control-flow decisions.id
Update a call control applicationclient.callControlApplications.update()PATCH /call_control_applications/{id}Modify an existing resource without recreating it.applicationName, webhookEventUrl, id
Delete a call control applicationclient.callControlApplications.delete()DELETE /call_control_applications/{id}Remove, detach, or clean up an existing resource.id
SIP Refer a callclient.calls.actions.refer()POST /calls/{call_control_id}/actions/referTrigger a follow-up action in an existing workflow rather than creating a new top-level resource.sipAddress, callControlId
Send SIP infoclient.calls.actions.sendSipInfo()POST /calls/{call_control_id}/actions/send_sip_infoTrigger a follow-up action in an existing workflow rather than creating a new top-level resource.contentType, body, callControlId

Other Webhook Events

Eventdata.event_typeDescription
callBridgedcall.bridgedCall Bridged

For exhaustive optional parameters, full response schemas, and complete webhook payloads, see references/api-details.md.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.98%
按下载量换算206

Claude

32.49%
按下载量换算176

Cursor

17.61%
按下载量换算96

Gemini CLI

9.77%
按下载量换算53

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills