> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ExotelFrameSerializer

> Serializer for Exotel WebSocket media streaming protocol

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

<CardGroup cols={2}>
  <Card title="Exotel Serializer API Reference" icon="code" href="https://reference-server.pipecat.ai/en/latest/api/pipecat.serializers.exotel.html">
    Pipecat's API methods for Exotel WebSocket integration
  </Card>

  <Card title="Example Implementation" icon="play" href="https://github.com/pipecat-ai/pipecat-examples/tree/main/exotel-chatbot">
    Complete telephony examples with Exotel
  </Card>

  <Card title="Exotel Documentation" icon="book" href="https://developer.exotel.com/">
    Official Exotel developer documentation
  </Card>

  <Card title="Exotel Console" icon="microphone" href="https://my.exotel.com/">
    Manage phone numbers and streaming configuration
  </Card>
</CardGroup>

## Installation

The `ExotelFrameSerializer` does not require any additional dependencies beyond the core Pipecat library:

```bash theme={null}
uv add "pipecat-ai"
```

## Prerequisites

### Exotel Account Setup

Before using ExotelFrameSerializer, you need:

1. **Exotel Account**: Sign up at [Exotel Console](https://my.exotel.com/)
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

<ParamField path="stream_sid" type="str" required>
  The Exotel Media Stream SID.
</ParamField>

<ParamField path="call_sid" type="str" default="None">
  The associated Exotel Call SID (optional).
</ParamField>

<ParamField path="params" type="InputParams" default="None">
  Configuration parameters for audio settings. See [InputParams](#inputparams)
  below.
</ParamField>

### InputParams

| Parameter              | Type   | Default | Description                                                                                         |
| ---------------------- | ------ | ------- | --------------------------------------------------------------------------------------------------- |
| `exotel_sample_rate`   | `int`  | `8000`  | Sample rate used by Exotel (Hz).                                                                    |
| `sample_rate`          | `int`  | `None`  | Optional override for pipeline input sample rate. When `None`, uses the pipeline's configured rate. |
| `ignore_rtvi_messages` | `bool` | `True`  | Whether to ignore RTVI protocol messages during serialization.                                      |

## Usage

### Basic Setup

```python theme={null}
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.
