Overview

TelnyxFrameSerializer enables integration with Telnyx’s WebSocket media streaming protocol, allowing your Pipecat application to handle phone calls via Telnyx’s voice services with bidirectional audio conversion, DTMF event handling, and support for multiple audio encodings.

Installation

The TelnyxFrameSerializer does not require any additional dependencies beyond the core Pipecat library:
pip install "pipecat-ai"

Prerequisites

Telnyx Account Setup

Before using TelnyxFrameSerializer, you need:
  1. Telnyx Account: Sign up at Telnyx Portal
  2. Phone Number: Purchase a Telnyx phone number with voice capabilities
  3. Media Streaming: Configure your phone number for WebSocket streaming
  4. Webhook Configuration: Set up webhook endpoints for call handling

Required Environment Variables

  • TELNYX_API_KEY: Your Telnyx API key for authentication and call control

Required Configuration

  • Stream ID: Provided by Telnyx during WebSocket connection
  • Audio Encodings: Configure inbound/outbound encodings (PCMU, PCMA)
  • Call Control ID: Required for automatic call termination (optional)

Key Features

  • Bidirectional Audio: Convert between Pipecat and Telnyx audio formats
  • DTMF Handling: Process touch-tone events from callers
  • Auto Hang-up: Terminate calls via Telnyx’s REST API
  • Multiple Encodings: Support for PCMU and PCMA audio formats