# How to set up a 3CX AI receptionist with Hail

> A 3CX AI receptionist from Hail helps customers get answers faster, any day of the week. It uses your approved information and asks follow-up questions to understand what the caller needs. Connect your help desk so your team can pick up issues that need a person.

- URL: https://hail.so/blog/3cx-ai-receptionist
- Type: Tutorial
- Tags: voice-agent, inbound, answering-service, knowledge-base
- Reading time: 13 min

Customers have a better experience when they get a clear answer on the first call. With Hail on 3CX, they can ask questions day or night, seven days a week, and get answers based on your [support docs and FAQs](https://hail.so/blog/ai-voice-agent-knowledge-base). They still dial the business number they know.

If a caller asks about a missing delivery, the agent can ask for the order number and check its status once you connect your order system. If the issue needs a person, your [help desk integration](https://hail.so/blog/ai-voice-agent-crm-integration#how-an-ai-agent-creates-support-tickets-from-calls) can create a ticket with the transcript and, when available, a short summary. Your team can see what the caller already said and what still needs attention.

## Start with one test call
[Create a Hail agent](https://hail.so/create-ai-agent) and start with a question customers ask often. In **Instructions**, add the answer and one related detail. For example, include your return window and how to start a return. You can also create the agent from Claude or ChatGPT through [Hail MCP](https://hail.so/mcp). Then [get your connection details in Hail](https://hail.so/blog/3cx-ai-receptionist#get-connection-details).

Once Hail verifies the number, call it from your mobile. This guide shows how to route calls from your mobile to the agent while the team keeps taking customer calls. When you are ready, you can send after-hours calls, missed calls, or a single phone menu option to the agent.

## What you need in 3CX and Hail
- **3CX admin access.** This guide uses a self-hosted or on-premises 3CX V20 PRO or Enterprise system that can add a generic SIP trunk. A SIP trunk carries calls over the internet. If you use Hosted by 3CX, [check which trunks you can add](https://www.3cx.com/docs/manual/sip-trunks/).
- **Access to change the connection in Hail.** A workspace owner or admin can create the connection and choose which agent answers.
- **Room for the extra call leg.** Each call sent to Hail uses two of your 3CX call channels, one for the caller and one for Hail. A handover to a 3CX extension uses one more. See [Hail's phone system docs](https://hail.so/docs/connect-phone-system).

## How a call reaches Hail
```flow
A customer calls your business number
3CX receives the call through your existing phone provider
3CX sends the calls you choose to Hail over a SIP trunk
The Hail agent answers and can hand the call to your team
```

## Step 1: Get your connection details in Hail
1. In the Hail console sidebar, open **Phone system**.
2. Name the connection, for example `Main office`, and select **Create connection**.
3. If the **SIP server** address ends in dots, select **Get full address**. Send the email it opens so Hail's team can give you the complete address.
4. Copy the **Username** and **Password** from the same page. You will enter them in 3CX with the server address.

## Step 2: Add a generic SIP trunk in 3CX
Allow SIP to Hail's server on port 5060 and audio (RTP) in both directions. Turn off SIP ALG. The [3CX firewall guide](https://www.3cx.com/docs/manual/firewall-router-configuration/) lists the ports.

1. In the 3CX admin console, go to **Admin > Voice & Chat** and select **Add Trunk**.
2. In the **Country** menu, select **Generic**. Then choose **Generic SIP Trunk (IP Based)**. If you cannot find it, check [3CX Support’s instructions](https://www.3cx.com/community/threads/at-t-ip-flex-not-supported-anymore-3cx.126277/).
3. Fill in the **General** tab:
   - **Name**: `Hail`.
   - **Default route**: **End Call**.
   - **Main Trunk Number**: your business number.
   - **Authentication ID** and **Authentication password**: the username and password from Hail. 3CX answers Hail's password request with them.
   - **Registrar/Server**: the full SIP server address from Hail's support team. **Port**: `5060`. Leave **Outbound Proxy** empty.
4. Leave the **DID Numbers** tab empty. Your number already arrives on your carrier's trunk.
5. In the trunk options, use G.711 audio (PCMU or PCMA) and set key presses (DTMF) to RFC 2833. Hail sends the ownership code as key presses.
6. Select **Save**.

![Fill in the trunk's name, default route End Call, main trunk number, authentication fields and server with port 5060.](https://hail.so/assets/third-party/3cx/screenshots/trunk-general.png)

In this example, the authentication fields are empty. Enter Hail's username and password there. If the Event Log later shows `401` or `407`, set **Type of authentication** to an option that sends them.

## Step 3: Create a 3CX outbound rule for the Hail trunk
**`4242` is an example prefix.** Choose a prefix that does not match the start of numbers your team already dials or conflict with an existing access code. Use your chosen prefix in the outbound rule and every forwarding target. 3CX strips the prefix before sending the number to Hail in [international format](https://www.itu.int/rec/T-REC-E.164), with a `+` and country code.

1. Go to **Outbound Rules** and select **Add**. Name it `Hail`.
2. **Calls to numbers starting with prefix**: enter your chosen prefix. The examples below use `4242`.
3. Leave **Calls from extension(s)** and **Calls to numbers with a length of** empty. The rule needs no length, and a wrong one stops it from matching.
4. **Route 1**: the `Hail` trunk.
5. **Strip digits**: enter the length of your prefix. For `4242`, enter `4`. If the international format drops a leading zero from the national number, strip that digit too. For the GB example, enter `5`.
6. **Prepend**: `+` and your country code, such as `+1`.
7. Leave **Outbound caller ID** empty.
8. Select **Save**. 3CX adds a new rule at the bottom of the list. Select it and use **Move Up** until it is first. The first matching rule wins.

![Set the prefix, leave the extension and length fields empty, and on Route 1 strip the prefix and prepend the country code.](https://hail.so/assets/third-party/3cx/screenshots/outbound-rule.png)

To get your forwarding target, put your chosen prefix in front of your business number in national format. Use digits only. The table uses `4242` and fictional business numbers.

| Country | Example business number | Example forwarding target | Strip | Prepend | Hail receives |
| --- | --- | --- | --- | --- | --- |
| US | (201) 555-0123 | `42422015550123` | 4 digits | `+1` | `+12015550123` |
| GB | 020 7946 0018 | `424202079460018` | 5 digits | `+44` | `+442079460018` |

## Step 4: Send test calls to Hail with a caller ID rule
Set up a temporary caller ID rule for your mobile number. 3CX checks this rule before it looks at which number you dialed. While the rule is active, calls from your mobile to any number on that carrier trunk go to Hail. Use it only for your tests. See [3CX's routing notes](https://www.3cx.com/blog/releases/v20-release-candidate-3/).

1. Go to **Advanced > CID Rules** and add a rule.
2. **Name**: `Hail test`.
3. **Caller ID**: your mobile number, as 3CX shows it in its call log.
4. **Choose a SIP Trunk to link to this Inbound rule**: select the carrier trunk that receives calls to the number you will test.
5. **Route calls to**: select **Forward to Outside Number** and enter the forwarding target for the number you want to test. Use the table in step 3 as a guide.

![Name the rule, enter your mobile number, pick your carrier's trunk, and forward to the outside number that starts with the prefix.](https://hail.so/assets/third-party/3cx/screenshots/caller-id-rule.png)

## Step 5: Verify your number and make your first test call
Hail verifies ownership by calling the number and receiving the call back through 3CX. The check can come from a different number each time, so it needs a temporary route for the number you verify. While that route is active, customers who call the number may get disconnected. Schedule a maintenance window for this check.

1. On Hail's **Phone system** page, add the number you want to verify.
2. In 3CX, note where that number's calls go today. Temporarily set its inbound route to **Forward to Outside Number** and enter the forwarding target for that number, using step 3 as a guide.
3. Select **Check** in Hail. An answered check is billed as a normal call.
4. When the check finishes, restore your previous 3CX route, even if the check fails. If Hail still needs to verify the number, see [the ownership check results](https://hail.so/blog/3cx-ai-receptionist#troubleshoot).
5. When the number shows **Connected**, use **Choose the agent** to select your receptionist.
6. Call the verified number from the mobile you used in step 4. Ask the question you set up and one related follow-up. If you used the return example, ask how long you have to return an item and how to start. Check both answers against what you entered in **Instructions**.

## Step 6: Pass the real caller's number to your agent
By default, 3CX sends a trunk's main number as the caller ID on calls it places ([3CX trunk guide](https://www.3cx.com/docs/manual/sip-trunks/)). Your agent would then see your own number on every call, so it could not tell callers apart or show their number on a handover.

3CX can pass the original caller's number instead, with its `OriginatorCallerID` value ([3CX caller ID guide](https://www.3cx.com/docs/cid-reformatting/)). In 3CX V20, that setting lives in the trunk's provider template. Ask your 3CX partner to set the Hail trunk's **From** user part to `OriginatorCallerID`.

Call from your mobile again, then open the call in **Activity** in Hail. Check that the caller is your mobile number before you route customer calls to the agent.

After your last test call, including any handover test in step 7, delete the `Hail test` rule in **Advanced > CID Rules**. You can do this before you are ready to send customer calls to Hail.

## Step 7: Let the agent hand callers to your team
For urgent calls, give the agent a 3CX extension it can ring. Ask Hail's team to help set up calls back to your 3CX system.

1. On Hail's **Phone system** page, add your 3CX system's address. Work with Hail's team to [set up the return route to your extensions](https://hail.so/docs/connect-phone-system#calls-out-and-handover).
2. In **Contacts**, save the person with their 3CX extension.
3. Open your agent and add the contact under **Hand over**. In **When to use**, enter a rule such as "Send urgent repair calls to Dana." Select **Save**.
4. Make another test call and say you need an urgent repair. Check that Dana’s extension rings and shows your mobile number.

The person has up to 30 seconds to answer. If the call goes unanswered, the agent comes back and offers to take a message.

## Step 8: Go live with the calls you choose
Pick the calls your AI receptionist answers:

- **All calls.** Every call to your business number goes to the agent first.
- **After hours.** The agent answers when your office is closed.
- **One menu option.** Callers pick an option in your Digital Receptionist, such as "press 3 to book a visit".
- **Missed calls.** The agent answers when nobody picks up if your 3CX route supports **Forward to Outside Number**.

Set the chosen route to **Forward to Outside Number** and enter the forwarding target you built in step 3. Give callers a greeting if they need to choose a menu option. Before testing the live route, confirm that `Hail test` is gone from **Advanced > CID Rules**. Then call your business number the way a customer would. If you started with after-hours calls, check that regular-hours calls still reach your team.

For a ring group or queue, check **Allow forwarding to external numbers in ring group and queues** under **Admin > System > Options > General > System Settings**. 3CX limits this option to dedicated deployments. If you use Multi Company Mode, start with a route that offers **Forward to Outside Number**. See [3CX Support’s guidance](https://www.3cx.com/community/threads/call-handling-options-missing-in-v20-enterprise-ai-license.137541/).

## Troubleshoot the 3CX trunk with the Event Log
3CX lists failed calls in the **Event Log** on its dashboard ([3CX trunk checker](https://www.3cx.com/docs/voip-provider-checker/)). Each line shows a SIP code and the address that answered, so you can tell your carrier's answer from Hail's.

| What you see | What it means | What to do |
| --- | --- | --- |
| `403` from your carrier's address | The call left on your carrier's trunk, so the Hail rule did not match | Check the prefix, the two empty fields, and that the rule is first |
| `401` or `407` from Hail's SIP server | The username or password does not match | Copy both again from the **Phone system** page |
| `486 Busy Here` from Hail's SIP server | Hail could not answer the call | Check that the number has an agent, and that your balance has credit |
| No line at all | The call never reached the forward | Check the caller ID rule's number and trunk |
| No audio, or audio one way only | Audio may be blocked by the firewall | Open the RTP ports and turn off SIP ALG, as the [3CX firewall guide](https://www.3cx.com/docs/manual/firewall-router-configuration/) shows |

To test the trunk itself, go to **Admin > Voice & Chat** and select **Check SIP Trunk**.

The ownership check in Hail shows its own result:

- **"No call arrived".** Check that your inbound route forwards to the forward target during the check (step 5), then the trunk's username, password and the outbound rule.
- **"The call came in on another connection's trunk".** Copy the username and password of this connection, not another one.
- **"The check code did not come through".** Turn on RFC 2833 key presses on the Hail trunk.

## Hail and the built-in 3CX AI receptionist
This guide uses Hail as the receptionist. If you are still choosing, [3CX's AI agent setup guide](https://www.3cx.com/docs/ai-agent-configuration/) explains the built-in option.

| | Hail over SIP | 3CX built-in AI agents |
| --- | --- | --- |
| What you need | A 3CX system that can add a generic SIP trunk | 3CX AI Edition and your own OpenAI or xAI account |
| Call length | Set the time limit on the Hail agent | Up to 3 minutes for the [3CX AI Receptionist](https://www.3cx.com/phone-system/ai-receptionist/) |
| Which calls it answers | The routes you send through the Hail trunk | The routes you assign in 3CX |

Choose Hail if you want the same agent to handle calls, texts, and email. The 3CX trunk carries voice. Connect texting and email to the agent separately in Hail.

## 3CX AI receptionist FAQ

### Does 3CX have its own AI receptionist?

Yes. The [3CX AI Edition](https://www.3cx.com/docs/ai-agent-configuration/) includes a built-in receptionist. To use a Hail agent, send the calls you choose to Hail through the SIP trunk in this guide.

### Can I add an AI agent to 3CX without the AI Edition?

Yes. A Hail agent connects as a generic SIP trunk, so 3CX PRO or Enterprise, self-hosted or on-premise, is enough. You forward the calls you choose to it, and the rest of your 3CX stays as it is. The [trunk steps](https://hail.so/blog/3cx-ai-receptionist#add-a-generic-sip-trunk) show each field.

### Can the AI receptionist answer from my own documents?

Yes. Give the agent your manuals, product sheets, and FAQs, and it answers callers from them. The [knowledge base guide](https://hail.so/blog/ai-voice-agent-knowledge-base) shows which documents to start with.

### Do I need a new phone number for an AI receptionist on 3CX?

No. Your number stays with your carrier and arrives on your 3CX as before. 3CX forwards the calls you choose to the agent. The [keep your business phone number guide](https://hail.so/blog/keep-your-business-phone-number#connect-your-phone-system) compares this with forwarding and porting.

### Which 3CX editions work with Hail?

3CX V20 systems that can add a generic SIP trunk: PRO or Enterprise, self-hosted or on-premise. The [3CX trunk guide](https://www.3cx.com/docs/manual/sip-trunks/) shows where to add one.

### Can the AI agent hand calls to my 3CX extensions?

Yes. Set up the return route with Hail's team, then add the person's 3CX extension to your agent's handover contacts. [Step 7](https://hail.so/blog/3cx-ai-receptionist#hand-callers-to-your-team) shows how to try it.

### How many calls can the agent answer at once on 3CX?

Each call uses 2 of your 3CX simultaneous calls. Count them when you choose your 3CX license. The [phone system docs](https://hail.so/docs/connect-phone-system) list what each call and handover uses.

### What does an AI receptionist on 3CX cost with Hail?

Hail charges per minute of call, with no monthly fee for a connected number. Your 3CX license and carrier plan stay as they are. See [Hail pricing](https://hail.so/pricing) for current rates.
