How-to

Exotel integration

Integrate Exotel for India-focused telephony with applet-based call routing, native bridge transfers, and μ-law audio streaming.

Prerequisites

  1. Exotel account — Sign up at exotel.com and obtain your API Key, API Token, and Account SID.
  2. Exotel numbers — Purchase Indian virtual numbers with voice capability.
  3. Passthru applet — Create a passthru applet in your Exotel dashboard that forwards calls to your answer webhook.
  4. Register numbers — Add your Exotel numbers via the Numbers API with provider: "exotel".

India-Focused Provider

Exotel is primarily designed for Indian telephony infrastructure. It offers excellent connectivity, local number support, and compliance with Indian telecom regulations (TRAI).

Environment VariableDescription
EXOTEL_API_KEYExotel API key for authentication
EXOTEL_API_TOKENExotel API token for authentication
EXOTEL_SIDExotel account SID
EXOTEL_TEMPLATE_APPLET_APP_IDDefault applet ID for call routing

Applet-Based routing

Unlike Twilio and Plivo which use URL-based webhooks directly, Exotel uses an applet-based routing model.

Trigger Applet API
Exotel Routes via Applet
Customer Answers
Applet Hits Webhook
WebSocket Audio
Voice Pipeline

Passthru Applet Setup

  1. Log in to the Exotel dashboard and navigate to App Bazaar → My Apps
  2. Create a new Passthru Applet and configure the webhook URL to your server’s /exotel/answer endpoint
  3. Note the Applet App ID for the EXOTEL_TEMPLATE_APPLET_APP_ID environment variable
  4. For warm transfer, configure an additional passthru applet for the /exotel/dial-up endpoint

Applet ID Configuration

SourceSettingDescription
EnvironmentEXOTEL_TEMPLATE_APPLET_APP_IDDefault applet ID
Templatetelephony_config.applet_app_idPer-template override — takes precedence

Audio encoding

ParameterValue
Encodingμ-law (G.711)
Sample Rate8000 Hz
ChannelsMono
Frame formatBase64 in JSON

Callbacks

POST /exotel/callback/status

Simplified Callbacks

Exotel uses a single status callback endpoint. Recording URLs are retrieved via the Exotel API after the status callback confirms the call has ended.

Warm transfer

Exotel warm transfer follows a unique pattern where the AI disconnects first:

AI triggers transfer
AI disconnects
Applet calls /dial-up
Returns phone number
Exotel native bridge
POST /exotel/dial-up

AI Disconnects First

In the Exotel flow, the AI disconnects before the customer is bridged to the live agent. There is a brief hold period while the applet completes the bridge.

Regional considerations

ConsiderationDetails
TRAI ComplianceOutbound calls must comply with DND regulations. Exotel handles DND filtering automatically.
Calling HoursTRAI restricts promotional calls to 9 AM – 9 PM IST.
Number FormatsIndian numbers must include +91 and 10-digit mobile number.
LatencyDeploy your server in ap-south-1 (Mumbai) for optimal audio latency.
Language SupportConfigure STT/TTS for Indian languages using compatible providers.

Production Applet Configuration

Always verify your passthru applet webhook URLs point to the correct production endpoints before going live. An incorrectly configured applet will silently drop calls.

Next steps

Was this helpful?