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

# Deploy voice agents over phone and telephony

> Connect XUNA AI agents to phone numbers via Twilio for inbound and outbound calls, SIP trunking, or programmatic batch calling at scale.

XUNA AI Conversational AI integrates with telephony infrastructure so your agent can answer calls, make outbound calls, and connect to existing phone systems. The platform supports Twilio numbers, SIP trunks, and batch outbound calling via API.

## Twilio integration

XUNA AI configures your Twilio number automatically when you link it in the dashboard. You don't need to set up webhooks or TwiML manually.

<Tabs>
  <Tab title="Inbound calls">
    ### Connect a Twilio number for inbound calls

    <Steps>
      <Step title="Open the Phone Numbers tab">
        In the XUNA AI dashboard, go to **Phone Numbers**.
      </Step>

      <Step title="Add a new number">
        Click **Add phone number** and fill in the following fields:

        | Field                  | Description                                                |
        | ---------------------- | ---------------------------------------------------------- |
        | **Label**              | A friendly name for this number (e.g., "Support line").    |
        | **Phone Number**       | Your Twilio number in E.164 format (e.g., `+12025551234`). |
        | **Twilio Account SID** | Found in your Twilio console under **Account Info**.       |
        | **Twilio Auth Token**  | Found in your Twilio console under **Account Info**.       |
      </Step>

      <Step title="Save the number">
        Click **Save**. XUNA AI automatically configures the Twilio number to route inbound calls to the platform.
      </Step>

      <Step title="Assign an agent">
        Select the agent you want to handle calls on this number. Click **Assign agent**.
      </Step>

      <Step title="Test the number">
        Call the number from any phone. Your agent answers and the conversation appears in the **Conversations** tab.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Outbound calls">
    ### Make an outbound test call

    <Steps>
      <Step title="Open the Phone Numbers tab">
        In the XUNA AI dashboard, go to **Phone Numbers**.
      </Step>

      <Step title="Click Outbound call">
        Find your connected number and click **Outbound call**.
      </Step>

      <Step title="Configure the call">
        Select the agent to use and enter the destination phone number in E.164 format.
      </Step>

      <Step title="Send the test call">
        Click **Send test call**. The destination number rings and your agent starts the conversation when the call is answered.
      </Step>
    </Steps>

    <Info>
      For production outbound campaigns, use the [batch calls API](/api-reference/telephony/batch-calls) to trigger multiple calls programmatically.
    </Info>
  </Tab>
</Tabs>

## Number types

XUNA AI supports two types of Twilio numbers with different capabilities:

| Type                         | Inbound | Outbound | Notes                                                           |
| ---------------------------- | ------- | -------- | --------------------------------------------------------------- |
| **Purchased Twilio numbers** | Yes     | Yes      | Full support. Numbers you own in your Twilio account.           |
| **Verified caller IDs**      | No      | Yes      | Outbound only. Numbers you've verified but don't own in Twilio. |

## Batch outbound calls

Use the batch calls API to trigger large volumes of outbound calls programmatically — for appointment reminders, surveys, or sales campaigns.

```bash theme={null}
curl -X POST https://api.xuna.ai/v1/convai/phone-numbers/batch-calls \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "YOUR_AGENT_ID",
    "from_phone_number_id": "YOUR_PHONE_NUMBER_ID",
    "calls": [
      {
        "to_phone_number": "+12025551234",
        "conversation_config_override": {
          "agent": {
            "first_message": "Hi Alice, this is a reminder about your 3:00 PM appointment."
          }
        }
      },
      {
        "to_phone_number": "+12025555678",
        "conversation_config_override": {
          "agent": {
            "first_message": "Hi Bob, this is a reminder about your 4:30 PM appointment."
          }
        }
      }
    ]
  }'
```

Pass `variables` to inject dynamic values into your agent's prompt for each recipient. Configure these variables in your agent's [system prompt](/configure/system-prompt).

## SIP trunking

Connect XUNA AI to your existing telephony infrastructure using SIP (Session Initiation Protocol). This lets you route calls from a PBX, contact center platform, or PSTN gateway to your XUNA AI agent.

<Steps>
  <Step title="Open the Phone Numbers tab">
    Go to **Phone Numbers** in the XUNA AI dashboard.
  </Step>

  <Step title="Add a SIP trunk">
    Click **Add SIP trunk** and enter your SIP endpoint details.
  </Step>

  <Step title="Configure your PBX">
    Point your PBX or PSTN gateway to the XUNA AI SIP endpoint provided in the dashboard.
  </Step>

  <Step title="Assign an agent">
    Select the agent to handle calls that arrive on the SIP trunk.
  </Step>

  <Step title="Test the connection">
    Place a test call through your existing infrastructure and verify it routes to your agent.
  </Step>
</Steps>

<Note>
  SIP trunk availability depends on your XUNA AI plan. Contact support if you don't see the SIP trunk option in your dashboard.
</Note>

## Next steps

* Trigger outbound campaigns programmatically with the [batch calls API reference](/api-reference/telephony/batch-calls).
* Review conversation transcripts and outcomes in [analytics](/monitor/analytics).
* For web or app deployment, see the [React SDK](/deploy/react-sdk) or [mobile SDKs](/deploy/mobile-sdks).
