# Connect Twilio or Exotel for Voice AI Agent Calls

Connect a Twilio or Exotel phone number to Robylon so your voice agents can make and receive real calls.

> Source: https://www.robylon.ai/docs/voice/telephony
> Section: Voice

Robylon works with **Twilio** and **Exotel**. Add numbers in **Settings → Channels → Voice**, under **Phone Numbers**.

## Twilio or Exotel: which should I use?

Use the provider where your numbers already are. If you are starting fresh, Exotel is common for calls within India, and Twilio for calls in most other countries.

| | Twilio | Exotel |
| --- | --- | --- |
| Setup in your provider account | None: Robylon configures the number for you | You build a call flow in Exotel that points to Robylon |
| Fields in Robylon | Label, phone number, Account SID, Auth Token, plus an API Key SID and Secret for Human numbers | Label, domain, Account SID, API key, API token, phone number, plus an App ID for AI numbers |

## How do I connect a Twilio number?

Copy your Account SID and Auth Token from Twilio, then add the number in Robylon. Robylon sets up the number's call handling in Twilio for you.

<Steps>
  <Step title="Get your Twilio credentials">
    In the Twilio Console, copy your **Account SID** and **Auth Token** from the account dashboard. Make sure the number you want to use is in the same Twilio account.
  </Step>
  <Step title="Add the number in Robylon">
    Go to **Settings → Channels → Voice**, click **Add Phone Number**, and select **Twilio**.
  </Step>
  <Step title="Fill in the fields">
    Enter a **Label** (a name to recognise the number in Robylon), the **Twilio Phone Number** with its country code, the **Twilio Account SID** and the **Twilio Auth Token**.
  </Step>
  <Step title="Choose who uses the number">
    In **Use this number for**, choose **AI**, **Human** or both. If you choose **Human**, also enter a **Twilio API Key SID** and **Twilio API Key Secret** from your Twilio account, so your team can call customers from the browser.
  </Step>
  <Step title="Add it">
    Click **Add Number**. Robylon checks the number with Twilio and adds it to the list.
  </Step>
</Steps>

When you add a Twilio number, Robylon points that number's incoming call and call status webhooks in Twilio to Robylon. You do not need to set any URLs in Twilio yourself.

<Danger>
Adding a number to Robylon replaces the call handling that number had in Twilio. Do not add a number that is still used by another system for calls.
</Danger>

## How do I connect an Exotel number?

Get your Exotel account ready, build a call flow in Exotel that sends calls to Robylon, then add the number in Robylon.

<Steps>
  <Step title="Complete your Exotel account setup">
    Your Exotel account must be fully set up before it can place AI calls:
    - **Company verification**, which usually needs documents such as your GST certificate and PAN card.
    - **DND approval**, which Exotel may ask you to support with a screenshot of your CRM.
    - **Credits** in the account to pay for calls.
    - **Numbers** for calling. Mobile numbers are recommended over landline numbers.
  </Step>
  <Step title="Build the call flow in Exotel">
    In Exotel, create an app (call flow) for AI calling with a **Voicebot** applet whose URL is `https://api.robylon.ai/voice/exotel/incoming-call/streaming/`. If your agent hands calls over to people, add a **Connect** applet with the URL `https://api.robylon.ai/voice/exotel/connect-call/`. Note the app's ID.
  </Step>
  <Step title="Add the number in Robylon">
    Go to **Settings → Channels → Voice**, click **Add Phone Number**, and select **Exotel**.
  </Step>
  <Step title="Fill in the fields">
    Enter the details from your Exotel account:
    - **Label**: a name to recognise the number in Robylon.
    - **Domain**: your Exotel API domain (the default is `api.exotel.com`).
    - **Account SID**, **API Key** and **API Token**: from the API settings in your Exotel dashboard.
    - **Exotel Phone Number**: with its country code.
  </Step>
  <Step title="Choose who uses the number and add it">
    In **Use Calling Number For**, choose **AI**, **Human** or both. If you choose **AI**, an **App ID** field appears: enter the ID of the call flow you built. Then click **Add Number**.
  </Step>
</Steps>

<Note>
The Robylon team can set up the Exotel call flow with you over a call, or with access to your Exotel account.
</Note>

## How do I attach a number to a voice agent?

In the voice agent builder, click **Add a Calling Number**. Only numbers whose **Use this number for** includes **AI** can be attached. See [Create a voice agent](https://www.robylon.ai/docs/voice/create-voice-agent#how-do-i-attach-phone-numbers-to-a-voice-agent).

## Why is my number not working?

- **Calls do not go out:** check the provider account has credit, the number is attached to the agent as outbound, and the call is inside the agent's calling hours.
- **Twilio number rejected when adding:** check the Account SID and Auth Token belong to the account that owns the number, and that the number includes its country code.
- **Exotel calls connect but the agent is silent:** check the Voicebot applet URL in your Exotel call flow and the App ID in Robylon.
- **Label or number already used:** each label and each number can only be added once per workspace.
