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

# Voice AI (Phone Numbers)

<video controls className="w-full aspect-video rounded-xl" src="https://storage.googleapis.com/msgsndr/6hlbl9oJC3URJyPfafmu/media/6889c646b67b666316860ad7.mp4" />

## Setting Up Your Bot as a Voice Agent

### Introduction

This guide shows you how to activate your AI assistant as a **voice agent**. You’ll learn how to connect a phone number, set up outbound calling, and carry context between SMS and calls using **GoHighLevel** automations and custom fields.

***

## 1. Select and Add a Voice

* Go to the top-right corner and click the **Voices icon** (three bot heads).
* Choose from existing voices or click **Import Voice** to pull one from **ElevenLabs**.
* Search for a voice (e.g., `"Zuri"`), click **Import**, and it will appear in your voice list.
* **To clone your own voice:**
  * Upload an MP3 or MP4 (under 2 minutes).
  * Go to the **Cloned** tab to find your custom voice.

***

## 2. Connect a Phone Number

* Click the **Phone icon** (top-right).
* Select an existing number or click **Buy Number** to purchase a new one using an area code.
* If an area code isn’t available, try another or wait until one becomes available.
* Click the **three dots** on a number → choose the assistant you want to connect it to → click **Save Changes**.
* The number is now live and linked to your bot for **inbound calls**.

***

## 3. Make an Outbound Call via Workflow

* Create a **GoHighLevel workflow** and use the action: **Make AI Call**.
* You’ll need your assistant’s ID:
  * Go to your assistant and click the **copy button** next to the ID (top-left).
  * Paste that ID into the workflow’s **assistant ID field**, then save and publish.
* Add any trigger you want (e.g., form submission) to start the call.

***

## 4. Create Custom Fields for Call Context

These fields help maintain conversation history across SMS and voice:

* `Message History` – large text field
* `Last Message` – text field
* `Last Call Transcript` – large text field
* `Last Call Summary` – large text field
* `Recording URL` – text field
* `Call History Summary` – large text field
* `Accumulated Call Time (sec & min)` – numerical fields

***

## 5. Set Up a Post-Call Webhook

* Create a new workflow with an **Inbound Webhook Trigger**.
* Copy the **webhook URL** and go to your assistant’s **Call Settings**.
* Paste the webhook URL into the **Post Call Webhook** field.
* Send a **test call** to generate the **mapping reference**.
* Back in your workflow, use the mapping reference to access call data like **summaries** and **recordings**.

***

## 6. Map Webhook Data to Contact Fields

* Find the contact using the **Contact ID** sent from the webhook.
* Use a **GPT step** to create a **Master Call History Summary**:
  * Combine the new call summary with previous summaries.
* Update contact fields:
  * `Call Summary`
  * `Call Transcript`
  * `Recording URL`
  * `Call Time (Seconds & Minutes)`

***

## 7. Carry Message History Across Channels

* Create a **trigger** for **Customer Replied (Any Channel)**.
* Append the **message body** to the `Message History` field.
* Update `Last Message` field with just the **new message**.
* In **outbound calls**, use **Custom Variable 1** to pass `Message History` so the bot has full **SMS context**.

***

## 8. Add Context in Prompt Using Custom Variables

* In your **outbound call workflow**, pass `Contact.MessageHistory` into **Custom Variable 1**.
* In the assistant prompt, reference `{{ custom1 }}` to give the AI full message context.
* Useful when **switching from SMS to voice** and maintaining conversation flow.

***

## Tips

* Use short, clean names for custom fields to stay organized.
* Always **test the webhook connection** before finalizing the workflow.
* Use the **logs inside the assistant** to see how post-call data is being received.
* Clone voices under 2 minutes long for best results.

***

## Summary

This SOP shows how to configure your bot as a **voice agent** by selecting a voice, assigning a number, creating outbound call workflows, and enabling post-call context syncing. You'll also learn how to build a custom field system to ensure smooth handoffs across SMS and voice channels.

* Select and add a voice (or **clone your own**).
* Connect a **Twilio phone number** to your assistant.
* Create **outbound call workflows** using the **Make AI Call** action.
* Set up a **post-call webhook** to capture **call summaries**, **transcripts**, and **recordings**.
* Use **custom fields** and **GPT** to generate context-aware history.
* Maintain message and call context across channels using **Custom Variables**.

***

© 2025 Build Assistants
