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

# In-Call Messages

> Send WhatsApp messages during active calls

## Overview

In-call WhatsApp functions send messages **during** active AI calls. The AI agent automatically triggers the message based on the description you provide.

**Common Use Cases:**

* Send OTP for phone verification
* Share payment links
* Send documents or forms
* Provide reference numbers
* Share meeting links

## How It Works

```
[Call Active] → [AI Detects Trigger] → [WhatsApp Message Sent] → [Call Continues]
```

The AI monitors the conversation and sends the WhatsApp message when it detects the trigger condition you specified.

## Configuration

<img src="https://mintcdn.com/callkaroai/n3GQgJELQTnqC5vq/images/whatsapp/in-call.png?fit=max&auto=format&n=n3GQgJELQTnqC5vq&q=85&s=1c5277ee7d8cbece117a3bb95efee657" alt="In-Call WhatsApp" width="2880" height="1622" data-path="images/whatsapp/in-call.png" />

<Steps>
  <Step title="Navigate to WhatsApp Tab">
    Go to your agent → WhatsApp configuration
  </Step>

  <Step title="Click Add">
    Click the Add button to create a new function
  </Step>

  <Step title="Select Type">
    Choose "During the Call (in-call)"
  </Step>

  <Step title="Enter Function Name">
    Use snake\_case (e.g., `send_otp`)
  </Step>

  <Step title="Select Provider">
    Choose WhatsApp provider (Facebook, Heltar, or AI Sensy)
  </Step>

  <Step title="Select Template">
    Choose your WhatsApp message template
  </Step>

  <Step title="Map Variables">
    Connect template placeholders to call data
  </Step>

  <Step title="Add Description">
    Describe when AI should send this message
  </Step>

  <Step title="Save">
    Save the function
  </Step>
</Steps>

## Description (AI Trigger)

The description tells the AI **when** to send the WhatsApp message.

**Example Descriptions:**

**For OTP:**

```
Send OTP when customer confirms their phone number and requests verification code
```

**For Payment Link:**

```
Share payment link when customer agrees to make payment
```

**For Documents:**

```
Send appointment confirmation PDF when customer books an appointment
```

<Tip>
  Be specific in your description. The AI uses this to understand exactly when to trigger the message.
</Tip>

## Variable Sources

In-call functions can use three variable sources:

### 1. Call Metadata

Customer information from your system (name, email, phone, etc.)

**Example:**

* `customer_name` - From call metadata
* `customer_email` - From call metadata

### 2. In-Call Variables (Dynamic)

Data extracted from the live conversation.

**Configuration:**

* **Variable Name**: What data to extract (e.g., `otp_code`)
* **Description**: Tell AI what to look for

**Example:**

```
Variable Name: otp_code
Description: 6-digit OTP code generated during the call
```

The AI will extract this value from the conversation and use it in the message.

### 3. Static Values

Fixed text that doesn't change.

**Example:**

* Company name
* Support email
* Website URL

<Card title="Variable Mapping Guide" icon="code-branch" href="/agents/whatsapp/variable-mapping">
  Detailed guide on mapping template variables
</Card>

## Example: Send OTP

**Function Name:** `send_otp`

**Template:** (WhatsApp template with 2 variables)

```
Your OTP code is {{1}}. Valid for 5 minutes.
If you didn't request this, please contact us at {{2}}.
```

**Variable Mapping:**

* `{{1}}` → In-Call Variables
  * Name: `otp_code`
  * Description: "6-digit verification code generated during call"
* `{{2}}` → Static Value
  * Value: `support@company.com`

**Description:**

```
Send OTP when customer confirms their phone number and requests verification
```

**Call Flow:**

```
Customer: "Yes, please send me the OTP"
AI: "I'll send it to your WhatsApp right now. The code is 123456"
[WhatsApp message sent with OTP 123456]
AI: "You should receive it shortly. Please enter the code when you get it."
```

## Provider-Specific Notes

### WhatsApp (Facebook)

* Templates must be **approved** by Meta
* Create in Meta Business Manager
* Only APPROVED templates available

### Heltar

* Templates from Heltar dashboard
* No Meta approval needed

### AI Sensy

**Basic Plan:**

* Enter campaign name manually
* Add variables as needed

**Pro Plan:**

* Select from existing campaigns
* Variables from campaign template

## Best Practices

* **Specific descriptions** - Be clear about when to send
* **Test in-call variables** - Verify AI extracts data correctly
* **Keep templates simple** - Short, actionable messages
* **Include context** - Tell customer why they received the message
* **Add support contact** - Provide help if issues arise

<Warning>
  In-call messages are sent during active calls. Ensure the timing doesn't interrupt important conversation flow.
</Warning>
