Skip to main content

Overview

ExotelFrameSerializer enables integration with Exotel’s WebSocket media streaming protocol, allowing your Pipecat application to handle phone calls via Exotel’s voice services with bidirectional audio conversion and DTMF event handling for Indian telephony infrastructure.

Installation

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

Prerequisites

Exotel Account Setup

Before using ExotelFrameSerializer, you need:
  1. Exotel Account: Sign up at Exotel Console
  2. Phone Number: Purchase an Exotel 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 Configuration

  • Stream ID: Provided by Exotel during WebSocket connection
  • Call SID: Associated Exotel Call SID (optional)

Key Features

  • Bidirectional Audio: Convert between Pipecat and Exotel audio formats
  • DTMF Handling: Process touch-tone events from callers
  • Indian Telephony: Optimized for Indian voice infrastructure
  • WebSocket Streaming: Real-time audio streaming via WebSocket protocol

Configuration

stream_sid
str
required
The Exotel Media Stream SID.
call_sid
str
default:"None"
The associated Exotel Call SID (optional).
params
InputParams
default:"None"
Configuration parameters for audio settings. See InputParams below.

InputParams

ParameterTypeDefaultDescription
exotel_sample_rateint8000Sample rate used by Exotel (Hz).
sample_rateintNoneOptional override for pipeline input sample rate. When None, uses the pipeline’s configured rate.
ignore_rtvi_messagesboolTrueWhether to ignore RTVI protocol messages during serialization.

Usage

Basic Setup

from pipecat.serializers.exotel import ExotelFrameSerializer
from pipecat.transports.network.websocket_server import WebSocketServerTransport

serializer = ExotelFrameSerializer(
    stream_sid=stream_sid,
    call_sid=call_sid,
)

transport = WebSocketServerTransport(
    params=WebSocketServerParams(
        audio_out_enabled=True,
        add_wav_header=False,
        serializer=serializer,
    )
)

Notes

  • Linear PCM audio: Exotel uses raw 16-bit linear PCM audio, not mu-law encoding. The serializer handles resampling between Exotel’s sample rate and the pipeline rate.
  • No auto hang-up: Unlike Twilio and Plivo, the Exotel serializer does not include automatic call termination.
  • DTMF support: Touch-tone digit events from callers are converted to InputDTMFFrame objects.