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

# Phone Number

> Test an agent over phone calls or SMS.

Connect an agent that customers reach by calling or texting a phone number.

![The Phone connection type with the agent's phone number entered](https://mintcdn.com/bluejay/EeUk0hD_moG9tWmI/images/agent-phone-number.png?fit=max\&auto=format\&n=EeUk0hD_moG9tWmI\&q=85\&s=5104800957c7120184546a4dc1966e86)

## Connect

**1. Create the agent**

For calls, create a Voice agent with the **Phone** connection type. For texts, create a Text agent with the **SMS** connection type. Enter your agent's number in E.164 format, for example `+15551234567`. An Outbound Voice agent with an **Outbound Trigger Webhook URL** does not need a number.

**2. Choose who starts the conversation**

* **Inbound**: your agent answers. When a run starts, each Digital Human calls or texts your agent's number.
* **Outbound**: your agent calls or texts each Digital Human first. Set up a trigger so your agent knows when to start, as described in [Outbound agents](#outbound-agents).

**3. Give the Digital Humans numbers**

Each Digital Human calls, texts, or answers on its own number, so give each one a number. See [Digital Human numbers](#digital-human-numbers).

**4. Run a simulation**

[Create a simulation](/test/simulations/create.md) for the agent and run it. Each test goes over the real carrier network, and Bluejay records, transcribes, and grades each conversation against your success criteria and custom metrics.

To start an SMS run from the API, use [Queue SMS Simulation Run](/api-reference/endpoint/queue-sms-simulation-run.md).

## Outbound agents

The Digital Humans wait on their lines until your agent reaches them or the run times out. Tell your agent when a run starts and which numbers to contact with one of these triggers:

* **Outbound Trigger Webhook URL** on the agent. Bluejay sends one `POST` for each conversation, and your system then calls or texts the Digital Human. See [Outbound trigger webhook](/test/simulations/reference.md#outbound-trigger-webhook) for the body, headers, and retries.
* The `outbound_simulation_started` event on a [webhook](/api-reference/webhooks.md). For a voice agent, Bluejay sends one event per run, and the [event payload](/api-reference/webhook/events-webhook.md) lists the numbers to call.

![The Connect Your Agent dialog for an Outbound Phone agent, with an Outbound Trigger Webhook URL entered and the Trigger Payload Template field below it](https://mintcdn.com/bluejay/EeUk0hD_moG9tWmI/images/agent-phone-outbound.png?fit=max\&auto=format\&n=EeUk0hD_moG9tWmI\&q=85\&s=33915a87252e2633da2aea23ccccd1f3)

For an Outbound SMS agent, text from the number saved on the agent. Bluejay matches each message to its test by your agent's number and the Digital Human's number, so a text from another number is not part of the test.

## Digital Human numbers

Buy numbers in the [workspace](/administration/workspaces.md) where your Digital Humans live, because a number stays in the workspace you buy it in. Then add a number on each Digital Human's **Connection** tab. See [Connection](/test/simulations/digital-humans.md#connection).

## Troubleshooting

| What you see | What to do |
| - | - |
| The result shows SIP\_DIAL\_FAILED | The number is not valid. Check the agent's number. |
| The result shows UNUSABLE\_CALLER\_ID | The caller ID is not verified. See [Error codes](/test/simulations/reference.md#error-codes). |
| The result shows SIP\_TRUNK\_RECYCLED | A newer simulation reused the Digital Human's number while this test was running, so Bluejay stopped this test. Run it again when the other simulation ends. |
| Tool calls or traces from your agent do not attach to the result | Bluejay sends the result ID in a SIP header, but the phone network usually drops custom SIP headers. Connect the agent over [SIP](/integrations/sip.md) or through your voice platform's integration page. |

## Related

* [SIP](/integrations/sip.md)
* [Create a Simulation](/test/simulations/create.md)
* [Digital Human Reference](/test/simulations/digital-humans.md)
* [Uptime Monitoring](/monitor/uptime/overview.md)
* [Agents API](/api-reference/endpoint/add-agent.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.