Skip to content
Development
Skill

/telnyx-voice-advanced-ruby

Advanced call control features including DTMF sending, SIPREC recording, noise suppression, client state, and supervisor controls. This skill provides Ruby SDK examples.

From plugin
ai
224200 skills3 agents

Claude Code

$ npx -y skills add team-telnyx/ai --skill telnyx-voice-advanced-ruby --agent claude-code

SKILL.md

telnyx-voice-advanced-ruby.SKILL.md
name: telnyx-voice-advanced-ruby
description: >-
  Advanced call control features including DTMF sending, SIPREC recording, noise
  suppression, client state, and supervisor controls. This skill provides Ruby
  SDK examples.
metadata:
  author: telnyx
  product: voice-advanced
  language: ruby
  generated_by: telnyx-openapi-pipeline

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

Telnyx Voice Advanced - Ruby

Installation

gem install telnyx

Setup

require "telnyx"

client = Telnyx::Client.new(
  api_key: ENV["TELNYX_API_KEY"], # This is the default and can be omitted
  public_key: ENV["TELNYX_PUBLIC_KEY"], # Required for client.webhooks.unwrap (webhook verification)
)

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:

begin
  result = client.messages.send_(to: "+13125550001", from: "+13125550002", text: "Hello")
rescue Telnyx::Errors::APIConnectionError
  puts "Network error — check connectivity and retry"
  raise
rescue Telnyx::Errors::RateLimitError
  # 429: rate limited — wait, then retry the request (bounded exponential backoff)
  sleep(1) # Check Retry-After header for actual delay
  # ...retry the call here (give up after a few attempts); otherwise re-raise:
  raise
rescue Telnyx::Errors::APIStatusError => e
  puts "API error #{e.status}: #{e.message}"
  if e.status == 422
    puts "Validation error — check required fields and formats"
  end
  raise # A failed request must never look like success to the caller
end

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).

Join AI Assistant Conversation

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)

response = client.calls.actions.join_ai_assistant("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ",
  conversation_id: "v3:abc123",
  participant: {id: "v3:abc123def456", role: :user}
)

puts(response)

Returns: `conversation_id` (uuid), `result` (string)

Update client state

Updates the client state associated with the call. Client state is an opaque value echoed back in subsequent webhooks for the call, letting you correlate events with your application's state.

`PUT /calls/{call_control_id}/actions/client_state_update` — Required: `client_state`

response = client.calls.actions.update_client_state("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ", client_state: "aGF2ZSBhIG5pY2UgZGF5ID1d")

puts(response)

Returns: `result` (string)

Start Conversation Relay

Start a Conversation Relay session on an active call. Conversation Relay connects the call audio to your WebSocket so your application can exchange realtime messages with the caller while Telnyx handles speech recognition and text-to-speech. Only one AI Assistant or Conversation Relay session can be active on a call at a time.

`POST /calls/{call_control_id}/actions/conversation_relay_start`

Optional: `assistant` (object), `client_state` (string), `command_id` (string), `conversation_relay_dtmf_detection` (boolean), `conversation_relay_settings` (object), `conversation_relay_url` (string), `custom_parameters` (object), `dtmf_detection` (boolean), `greeting` (string), `interruptible` (enum: none, any, speech, dtmf), `interruptible_greeting` (enum: none, any, speech, dtmf), `interruption_settings` (object), `language` (string), `languages` (array[object]), `provider` (string), `structured_provider` (object), `transcription` (object), `transcription_engine` (enum: Google, Telnyx, Deepgram, Azure, xAI, AssemblyAI, Speechmatics, Soniox, A, B), `transcription_engine_config` (object), `tts_provider` (string), `url` (string), `voice` (string), `voice_settings` (object)

response = client.calls.actions.start_conversation_relay("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")

puts(response)

Returns: `conversation_relay_id` (string), `result` (string)

Stop Conversation Relay

Stop the active Conversation Relay session on a call.

`POST /calls/{call_control_id}/actions/conversation_relay_stop`

Optional: `client_state` (string), `command_id` (string)

response = client.calls.actions.stop_conversation_relay("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")

puts(response)

Returns: `result` (string)

Process a payment

Collect payment details from the caller using DTMF and either charge or tokenize the payment method through a configured Pay connector. Pay pauses active call recordings while sensitive payment details are collected. When `payment_token` is supplied, the DTMF collection steps are skipped and the existing token is sent to the connector.

`POST /calls/{call_control_id}/actions/pay`

Optional: `amount` (number), `client_state` (string), `command_id` (string), `connector_name` (string), `currency` (enum: USD, usd), `description` (string), `inter_digit_timeout_millis` (int32), `language` (string), `max_attempts` (int32), `metadata` (object), `min_postal_code_length` (integer), `parameters` (object), `payment_method` (enum: credit-card, ach-debit), `payment_token` (string), `postal_code` (object), `prompts` (object), `service_level` (string), `timeout_millis` (int32), `transaction_type` (enum: charge, tokenize), `valid_card_types` (array[string]), `voice` (string)

response = client.calls.actions.pay("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ", connector_name: "Default")

puts(response)

Returns: `result` (string)

Read more
@team-telnyx
Ships withai

This repo is the one-stop shop for AI Agents and AI-first developers building with Telnyx — everything an agent needs to build production-grade applications and manage its account, from signup to funding.

224200 skills3 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
224
Star history of team-telnyx/ai on GitHub, a chart by star-history.com

Other skills on ai.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about telnyx-voice-advanced-ruby.

Which coding agents can use telnyx-voice-advanced-ruby?
telnyx-voice-advanced-ruby installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.