Connect Exotel to Sarvam Voice Agents
Connect your Exotel account to Sarvam Voice Agents so your AI voice agent can answer incoming calls and make outgoing calls on your Exophones.
This connector uses the Exotel Voicebot applet in AgentStream. Calls on your Exophone are streamed in real time to your Sarvam agent. You don't need a SIP trunk.
Setup has two parts:
- In Sarvam Voice Agents: add an Exotel connection using your Exotel API credentials.
- In the Exotel dashboard: create an App (call flow) with the Voicebot applet that points to Sarvam. For incoming calls, assign that App to your Exophone.
Watch the setup
Connecting your Exotel account to Sarvam Voice Agents, end to end.
How it works
Inbound
- A caller dials your Exophone.
- Exotel runs the App assigned to that Exophone.
- The Voicebot applet opens a real-time audio stream to Sarvam.
- Your Sarvam agent talks to the caller on the live call.
- When the conversation ends, the stream closes and Exotel moves to the next applet in the flow (for example, Hangup).
Outbound
- Sarvam places the call through the Exotel API, using your Exophone as the caller ID.
- The API request includes the flow ID of your Exotel App, so the call runs that App directly.
- When the customer answers, the Voicebot applet connects them to your Sarvam agent.
Prerequisites
- At least one active Exophone (Exotel's virtual phone number)
- Your Exotel API credentials: Account SID, API Key, API Token
- Access to Sarvam Voice Agents with permission to add telephony connections (Deploy → Phone Numbers)
Part A: Add the connection in Sarvam Voice Agents
Sarvam needs four values from your Exotel account:
Value | Where to find it in Exotel |
|---|---|
Account SID | |
API Key | Settings → API Settings → API Credentials. Click Create if you don't have one yet. |
API Token | Shown next to the API Key when you create it |
Base URL | Depends on your account's region (see the next table) |
Base URL by region
Your Exotel account region | Base URL |
|---|---|
India | api.in.exotel.com |
Singapore | api.exotel.com |
Important: The API Token is shown only once, when you create it. Copy it and store it securely right away. If you lose it, create a new API Key and Token.
Tip: Not sure which region you're in? Check your dashboard address. my.in.exotel.com is India, and my.exotel.com is Singapore. The Base URL must match your region, or the connection will fail with an authentication error.
Steps
- Copy your Account SID. In the Exotel dashboard, open Settings → API Settings and copy the Account SID.
- Copy your API Key. On the same page, under API Credentials, copy the API Key. If no key exists, click Create.
- Copy your API Token. Copy the API Token shown next to the key and save it securely.
- Note your Base URL. Use api.in.exotel.com for India or api.exotel.com for Singapore.
- Add the connection in Sarvam. In Sarvam Voice Agents, go to Deploy → Phone Numbers → Add Connection, select Exotel, enter the four values, and click Save.
The Exotel connection now appears under Deploy → Phone Numbers.
Part B: Configure the call flow in Exotel
Create an Exotel App that sends calls to your Sarvam agent. The App is used for both inbound and outbound calls.
Step 1: Create a new App
- In the Exotel dashboard, open App Bazaar.
- Click Create to add a new App.
- Give it a name you'll recognise, such as sarvam-prod.
Tip: If you run separate test and production agents, create one App for each (for example, sarvam-test and sarvam-prod).
Step 2: Add the Voicebot applet
In the App flow editor, drag the Voicebot applet into the Call Start flow. If you can't find it, search for "Voicebot" in the applet list.
For a full reference of this applet, see Voicebot Applet.
Step 3: Enter the Sarvam endpoint
In the Voicebot applet, under "Which bot you want to connect the enduser?", enter:
This is an HTTPS (dynamic) endpoint. At the start of each call, Exotel calls this URL, and Sarvam replies with the secure WebSocket (wss://) address to stream the call to. You don't need to enter a wss:// URL yourself.
Note: Enter the URL exactly as shown. Don't add sample-rate, custom parameters, or credentials to it unless Sarvam support asks you to.
Step 4: Set recording options
We recommend these settings in the Voicebot applet:
Setting | Recommended value |
|---|---|
Record this? | Checked |
Recording Channels? | Single |
Recording Format? | MP3 |
Encrypt DTMF? | Unchecked |
To learn about the other options (Dual channel, MP3 HQ, and RAW) and when to use them, see Recording Options in the Voicebot Applet.
Step 5: Choose what happens after the bot
When the Sarvam agent ends the conversation, Exotel closes the stream and continues to the next applet. You don't need a separate "stop stream" applet.
- To end the call, connect the Voicebot applet to a Hangup applet.
- To send call details, including the recording URL, to your own system first, add a Passthru applet before Hangup.
Step 6: Save the App
Click Save and close the App editor.
Step 7: Assign the App to your Exophone (inbound only)
This step is needed only for incoming calls. For outgoing calls, Sarvam passes the App's flow ID in the API request, so you don't need to assign the App to the number.
- Go to ExoPhones.
- Open the Exophone you want to use with Sarvam.
- Select the App you just created and save.
Incoming calls to this Exophone now go to your Sarvam agent.
Part C: Go live in Sarvam Voice Agents
- Add your Exophone. In Sarvam Voice Agents, open your Exotel connection under Deploy → Phone Numbers and add the Exophone number. See Manage Phone Numbers.
- Route calls to an agent.
- Incoming calls: create an Inbound deployment that links the number to an agent.
- Outgoing calls: add the number to a Campaign.
- Make a test call. Call the Exophone from your phone and check that the agent answers. Then open the call in your Exotel call logs to confirm it went through the Voicebot applet and has a recording.
Outbound calls
Outbound calling is available by default on your Exophones and uses the same Exotel connection. You don't need extra credentials.
- Sarvam places each call through the Exotel API and includes your App's flow ID, so the call runs the Voicebot flow automatically.
- Your Exophone is shown to the customer as the caller ID.
- You don't need to assign the App to the Exophone for outbound calls. That's only needed for inbound.
To learn how Exotel connects an API call to a flow, see Connect Voice AI with Flow API.
Calling regulations in India
If you make outbound calls to Indian numbers, you're responsible for following TRAI regulations. Before you launch a campaign:
- Respect DND preferences. Don't place promotional calls to numbers registered on the National Customer Preference Register (NCPR/DND) unless the customer has given explicit consent.
- Call only during permitted hours. Promotional calls are allowed only between 9:00 AM and 9:00 PM.
- Use the right number type. Use an Exophone that's approved for your use case (promotional or transactional/service).
- Keep proof of consent. Keep records of customer opt-ins for campaigns that need them.
Note: Regulations change over time. Check the latest TRAI guidelines, or ask your Exotel account manager, before running large campaigns.
Call transfer
You can't set up call transfer to a human agent yourself for Sarvam on Exotel. To enable it, contact the Sarvam team at [email protected].
Troubleshooting
Problem | What to check |
|---|---|
Sarvam won't save the connection, or shows an authentication error | Check the Account SID, API Key, and API Token for typos. Make sure the Base URL matches your region (India vs Singapore). |
You lost the API Token | Create a new API Key and Token in API Settings, then update the connection in Sarvam. |
Incoming calls ring but the agent never speaks | Make sure the Voicebot applet is in the Call Start flow and the endpoint URL matches exactly. |
Incoming calls go to a different flow | Check that the right App is assigned to the Exophone in ExoPhones. |
The call connects but hangs up right away | Make sure the Exophone is added in Sarvam and linked to an Inbound deployment or Campaign. |
There's no recording | Make sure Record this? is checked in the Voicebot applet, then save the App again. |
Outbound campaign calls fail | Check the connection credentials and Base URL, and make sure the number is added in Sarvam and part of the campaign. |
Still stuck?
- Exotel account, Exophone, or App issues: [email protected]
- Sarvam agent, deployment, or call transfer issues: [email protected]
Official references
Resource | Link |
|---|---|
Voicebot Applet (Exotel) | https://docs.exotel.com/exotel-agentstream/voicebot-applet |
Recording Options in the Voicebot Applet (Exotel) | https://docs.exotel.com/exotel-agentstream/recording-options-in-the-voicebot-applet |
Passthru Applet (Exotel) | https://docs.exotel.com/exotel-agentstream/passthru-applet |
Connect Voice AI with Flow API (Exotel) | https://docs.exotel.com/exotel-agentstream/connect-voice-ai-with-flow-api |
Other Voice AI connectors (Exotel) | https://docs.exotel.com/exotel-agentstream/connectors |
Exotel integration guide (Sarvam) | https://docs.sarvam.ai/conversations/deploy/telephony/exotel |
Manage Phone Numbers (Sarvam) | https://docs.sarvam.ai/conversations/deploy/telephony/manage-numbers |