How can we help? 👋

Voice AI: FusionPBX Integration Guide

Overview

This guide documents the integration between FusionPBX and Talkative Voice AI. Inbound PSTN calls arrive on FusionPBX via a Twilio SIP trunk, are routed to the Talkative Voice AI bot via a second Talkative-provisioned SIP trunk, and are then transferred back to FusionPBX via SIP REFER based on the bot's outcome.

Voice Assist is not yet available on this platform. Configuration guides for this will be available in the near future.

Architecture

The full call flow is:

Step
Description
1
Caller dials UK DID number
2
Trunk delivers INVITE to FusionPBX
3
FusionPBX dialplan matches the DID and bridges to Talkative SIP trunk
4
Talkative Voice AI bot answers and handles the conversation
5
Bot sends SIP REFER to FusionPBX with Refer-To extension based on outcome
6
FusionPBX routes call to destination extension / queue based on REFER target

Prerequisites

This guide assumes the following are already in place:

  • FusionPBX installed with a valid domain and SSL cert
  • A SIP trunk from your carrier configured with a DID routing to FusionPBX
  • A softphone registered to FusionPBX (e.g. Linphone, Zoiper)
  • Access to Talkative Engage (eu.engage.app) with Voice AI configured
  • For the purpose of this guide, we will refer to eu.engage.app - please ensure you swap the region for your correct instance region.
ℹ️ See the FusionPBX Setup Guide for steps to complete the above prerequisites.

Step 1: Obtain Talkative SIP Trunk Credentials

Talkative provisions a SIP trunk per company via their Twilio infrastructure. Credentials are obtained from the Engage portal.

Navigate to https://eu.engage.app/voice-routes and edit your Voice Route. The form will display your SIP trunk credentials:

Credential
Description
SIP Username
e.g. siptrunkuser — used to register the gateway
SIP Password
Authentication password for the trunk
Trunk Domain
UUID-based Twilio domain, e.g. {uuid}.sip.twilio.com
ℹ️ If your Voice Route does not have any SIP credentials configured, contact Talkative support at support@gettalkative.com to set up the trunk.

Step 2: Add the Talkative Gateway in FusionPBX

Notion image

Go to Accounts → Gateways → Add and complete the form with your Talkative trunk credentials:

Field
Value
Gateway name
talkative-vai (or your preference)
Username
SIP username from Engage voice route
Password
SIP password from Engage voice route
Proxy
{uuid}.sip.twilio.com (trunk domain from Engage)
From Domain
your.subdomain.com
Register
true
Context
public
Port
5060
Enabled
true

Save the gateway.

ℹ️ Verify from SSH with: fs_cli -x "sofia status" — look for the gateway in the list with REGED status. Note the full gateway name shown — you will need the exact name for the dialplan.

Step 3: Create a Virtual Extension for the Bot

Notion image

FusionPBX's destination form requires a real extension as its action target. Create a Virtual extension that acts as a routing placeholder for the bot — it never registers but allows the destination to save and route correctly.

Go to Accounts → Extensions → Add:

Field
Value
Extension
50001 (pilot number for bot — can be any unused extension)
Password
Any value
Type
Virtual
Domain
your.subdomain.com
Enabled
true
ℹ️ The Virtual type means the extension never registers. Calls sent to it will not ring a phone — instead the dialplan will handle them via the talkative-vai dialplan entry created in Step 4.

Step 4: Create the Dialplan Entry

The dialplan bridges calls destined for extension 50001 out through the Talkative gateway. This must be added via the FusionPBX dialplan manager using the advanced edit view.

4.1 Add the Dialplan Entry

Go to Dialplan → Dialplan Manager → Add. Enter a name (e.g. talkative-vai) and save with minimal data. The list will show the new entry — click it to open the full edit view.

4.2 Configure in the Edit View

In the full edit view, configure the following:

Field
Value
Name
talkative-vai
Context
fusion.yourdomain.com (your domain context)
Enabled
true

In the conditions/actions table at the bottom, set up the rows:

Tag
Type
Data
Order
condition
destination_number
^(5000\d)$
1
action
set
effective_caller_id_number=${caller_id_number}
10
action
bridge
sofia/gateway/{gateway}/{destination}
20

The complete configuration will look something like this:

Notion image

4.3 Reload the Dialplan

After saving, reload the dialplan:

fs_cli -x "reloadxml"

Step 5: Configure Inbound DID to Route to Bot

The inbound DID destination needs to route calls to extension 50001, which triggers the talkative-vai dialplan and bridges to the bot.

5.1 Update the Destination

Go to Destinations → edit your DID destination. Change the Action to extension 50001 (it will now appear in the dropdown since you created the Virtual extension in Step 3). Save the destination.

Notion image

5.2 Test Inbound Routing

Call the DID from a mobile phone. Monitor the FreeSWITCH log to confirm the call is matching the dialplan and attempting to bridge to the Talkative gateway:

fs_cli

You should see the dialplan matching talkative-vai and a bridge attempt to the Talkative gateway. If the bridge succeeds, the Talkative bot should answer.

Step 6: Configure Voice Route in Talkative Engage

Notion image

In Talkative Engage → Voice Routes, edit the relevant Voice Route and set the SIP endpoint to match the extension number and domain of your FusionPBX:

sip:50001@1234d68-cd55-4b38-9c20-889267938bf1.sip.twilio.com
Notion image

This tells the Talkative bot to accept calls arriving at this SIP address and associate them with the configured Voice AI bot.

💡

The incoming SIP addresses will soon be available in the platform to make it easier to reconcile the incoming routes. Keep an eye on our product updates for more information.

Step 7: Configure Return Routing (SIP REFER)

When the Voice AI bot has finished processing a call, it sends a SIP REFER back to FusionPBX with a Refer-To header indicating the target extension. FusionPBX then routes the call to the appropriate destination.

7.1 Bot Transfer Configuration

In the Talkative bot's transfer tool configuration, the REFER target should be a full SIP URI pointing at a FusionPBX extension, queue, or ring group:

sip:1001@fusion.yourdomain.com        (transfer to extension 1001)
sip:queue-sales@fusion.yourdomain.com (transfer to sales queue)

These destination can be configured from within the bot itself - simply specify the return destination, as a fully formed SIP address and the bot will be able to use this as a transfer destination.

Notion image

7.2 FusionPBX Return Route

Create extensions or queues in FusionPBX to receive the returned calls. The REFER targets must exist as valid dialplan destinations. Ensure the Talkative gateway's source IP is whitelisted in your FusionPBX providers ACL so that the REFER is accepted without a 407 challenge.



Debugging Reference

Key Commands

Command
Purpose
fs_cli -x "sofia status"
List all SIP profiles and gateway registration status
fs_cli -x "reloadxml"
Reload dialplan after changes
fs_cli -x "reloadacl"
Reload ACL after adding IP ranges
fs_cli -x "sofia profile external restart"
Restart external SIP profile
fs_cli
Enter interactive console to watch live call logs

Common Issues

Error
Cause
Fix
INVALID_GATEWAY
Gateway name in bridge string doesn't match registered name
Run sofia status and use exact name shown
REGED shows UNREGED
Wrong SIP credentials or proxy hostname
Verify username/password/proxy from Engage
407 on inbound REFER
Talkative IP not in providers ACL
Add Twilio/Talkative IP ranges to ACL
Did this answer your question?
😞
😐
🤩