***

title: Asterisk-based PBX Systems
subtitle: Transfer calls between Synthflow and Asterisk-based PBX systems
slug: transfer-calls-between-synthflow-and-pbx
description: null
-----------------

This guide outlines how warm transfers are handled between **Synthflow** and **Asterisk-based PBX systems**, and how to configure both your PBX and Synthflow UI for seamless call handoff to human agents.

***

## How warm transfer works

When a caller asks the AI assistant (Synthflow) to speak to a human agent:

1. Synthflow sends a new SIP `INVITE` to the human agent (transferee).
2. Once the human agent answers, Synthflow sends a `REFER` request on the original call with a `Refer-To:` URI.
3. The Asterisk PBX must accept the \`\` and open a new channel using the `Refer-To` URI.
4. The `Refer-To` URI includes a random ID prefixed with `0875704225`.
5. This URI bridges the customer and the human agent, completing the warm transfer.

***

## Asterisk PBX configuration

### 1. `extensions.ael` example

```ael
context from-synthflow {
  +12345678912 => {
    Dial(PJSIP/${EXTEN});
    Hangup();
  }
  _0875704225. => {
    Dial(PJSIP/synthflow/sip:${EXTEN}@sip:sipin.synthflow.ai:32681);
    Hangup();
  }
}
```

### 2. `extensions.conf` example

```conf
[from-synthflow]
exten => +12345678912,1,Dial(PJSIP/${EXTEN})
same => n,Hangup()

exten => _0875704225.,1,Dial(PJSIP/synthflow/sip:${EXTEN}@sip:sipin.synthflow.ai:32681)
same => n,Hangup()
```

<Note>
  **Note**: The `_0875704225.` extension pattern must match the prefix used in the `Refer-To` URI to successfully complete the transfer.
</Note>

***

## Set up the warm transfer in Synthflow

### Step 1. Create an outbound agent

<Steps>
  <Step>
    Go to the **Agents** tab on the left-hand sidebar.
  </Step>

  <Step>
    Create a new outbound agent. For more details on how to create an agent, see [Create an agent](/create-an-agent).
  </Step>

  <Step>
    Add a **DID number** (this can be a test/dummy DID if needed).
  </Step>
</Steps>

### Step 2. Configure call actions for warm transfer

<Steps>
  <Step>
    On the left-hand sidebar, click **Agents**.
  </Step>

  <Step>
    Select the agent you want to configure the action for.
  </Step>

  <Step>
    On the navigation sidebar, select **Actions**.
  </Step>

  <Step>
    Switch to the **During the call** tab and click <Icon icon="fa-plus" /> **Add Action** > <Icon icon="fa-arrow-right-arrow-left" /> **Call Transfer**.
  </Step>

  <Step>
    Enter the phone number of the human agent and click **Add Actions**. If you're adding a new number, you'll be prompted to validate it.
  </Step>

  <Step>
    Click on the action you've just created and select **Transfer Settings**.
  </Step>

  <Step>
    Set **Transfer Mode** to **“Warm transfer with message”**. You can set a custom message the agent will say before transferring the call (for example, "“The user requested the manager; merging you now!").
  </Step>

  <Step>
    Click **Save**.
  </Step>
</Steps>

***

## Test the warm transfer

<Steps>
  <Step>
    On the left-hand sidebar, click **Agents**.
  </Step>

  <Step>
    Select the agent you want to test.
  </Step>

  <Step>
    On the nevigation sidebar under your agent's nae, click <Icon icon="fa-regular fa-call" /> **Test Agent**.
  </Step>

  <Step>
    Dial the number and begin a conversation with the AI bot. In your conversation, say: "Please transfer to a human agent." The system will dial the transferee. Once the agent answers, they will hear the configured prompt before being merged into the call.
  </Step>
</Steps>
