Flireo AI
WebsiteLinkedin
WebsiteLinkedin
  1. Guides
  • API Reference
    • Agents
      • List all agents
      • Create a new agent
      • Get an agent
      • Update an agent
      • Delete an agent
    • Tool Templates
      • List all tool templates
      • Create a new tool template
      • Get a tool template
      • Update a tool template
      • Delete a tool template
    • Numbers
      • List all phone numbers
      • Register a phone number
      • Get a phone number
      • Update a phone number
      • Delete a phone number
    • Calls
      • List calls
      • Get call by ID
      • Initiate outbound call
    • Call Control
      • Send control command to active call
    • Usage
      • Get usage logs
    • SIP Trunks
      • List SIP trunks
      • Create a SIP trunk
      • Get a SIP trunk
      • Delete a SIP trunk
    • Voices
      • List available voices
    • BYOK
      • Get BYOK configurations
      • Add BYOK configuration
      • Delete BYOK configuration
      • Get BYOK provider configurations
    • Domains
      • Get your domain
      • Add a domain
      • Delete your domain
      • List available Resend domains
      • Select and sync a Resend domain
      • Verify domain DNS records
      • Refresh domain status
    • Webhooks
      • Dynamic assistant configuration webhook
      • Tool/Function Call
      • Call Status Update
      • End of Call Report
    • Analysis Templates
      • List analysis templates
      • Create analysis template
      • Get analysis template
      • Update analysis template
      • Delete analysis template
    • Organization
      • Get organization information
    • Campaigns
      • List all campaigns
      • Create a campaign
      • Get a campaign
      • Update a campaign
      • Delete a campaign
      • List campaign leads
      • Add a lead
      • Remove a lead
  • Documentation
    • Get started
      • Quickstart
      • Introduction
      • Authentication
    • Core concepts
      • Agents
      • Phone numbers
      • Calls
      • Webhooks
    • Api's
      • Organization
      • Agents
      • Phone numbers
      • Sip trunks
      • Calls
      • Call control
      • Usage
      • Voices
      • BYOK
      • Domains
      • Analysis templates
      • Tool templates
    • Webhooks
      • Overview
      • Assistant request
      • Tool calls
      • Status update
      • End of call report
      • Security
    • Guides
      • BYOK Setup
      • Call analysis
      • Custom Tools
      • Call Transfers
      • xAI Realtime Integration
      • Analysis templates
      • Billing
      • Error codes
      • Rate limits
      • Sip Trunks
      • Tool templates
      • Troubleshooting
WebsiteLinkedin
WebsiteLinkedin
  1. Guides

Sip Trunks

SIP trunks enable call transfers from your AI agent to external phone systems, such as your office PBX or contact center.

What is a SIP Trunk?#

A SIP trunk is a connection to a phone system that allows calls to be transferred over the internet using the SIP (Session Initiation Protocol) protocol.

When Do You Need a SIP Trunk?#

Call transfers to your PBX - Route calls to internal extensions
Contact center integration - Transfer to human agents in your call center
Multi-location routing - Route calls to different offices

Creating a SIP Trunk#

Response:
{
  "sip_trunk": {
    "id": "trunk-uuid",
    "name": "Office PBX",
    "host": "pbx.example.com",
    "port": 5060,
    "username": "flireo",
    "created_at": "2025-12-13T10:00:00.000Z"
  }
}

SIP Trunk Fields#

FieldTypeRequiredDescription
namestringYesDisplay name for the trunk
hoststringYesSIP server hostname or IP
portintegerNoSIP port (default: 5060)
usernamestringNoAuthentication username
passwordstringNoAuthentication password
Passwords are stored securely in Supabase Vault and never exposed in API responses.

Assigning a Trunk to a Phone Number#

After creating a trunk, assign it to phone numbers that should use it for transfers:
Now transfers from this phone number will route through your SIP trunk.

Using Transfers#

Agent-Initiated Transfers#

Add the transfer tool to your agent:
{
  "llm_config": {
    "tools": [
      {
        "type": "transferCall",
        "destinations": [
          {
            "type": "number",
            "number": "+31612345678",
            "description": "Human support agent",
            "message": "Ik verbind u door met een collega."
          }
        ]
      }
    ]
  }
}

API-Initiated Transfers#

Transfer an active call via the API:

SIP Trunk Configuration Examples#

FreePBX / Asterisk#

{
  "name": "FreePBX",
  "host": "192.168.1.100",
  "port": 5060,
  "username": "flireo-trunk",
  "password": "your-trunk-password"
}
FreePBX configuration:
1.
Create a new SIP trunk in Connectivity > Trunks
2.
Set the trunk name and peer details
3.
Add Flireo's IP to your firewall allowlist

3CX#

{
  "name": "3CX Office",
  "host": "yourcompany.3cx.com",
  "port": 5060,
  "username": "flireo",
  "password": "trunk-password"
}

Generic SIP Provider#

{
  "name": "SIP Provider",
  "host": "sip.provider.com",
  "port": 5060,
  "username": "your-account",
  "password": "your-password"
}

Listing SIP Trunks#

Deleting a SIP Trunk#

When you delete a SIP trunk, any phone numbers using it will have their transfer_trunk_id set to null:

Troubleshooting#

Transfers Not Connecting#

1.
Verify the SIP trunk host is accessible
2.
Check firewall allows SIP traffic (port 5060)
3.
Verify credentials are correct
4.
Test the destination number directly

Audio Issues After Transfer#

1.
Check NAT configuration on your PBX
2.
Verify RTP ports are open
3.
Ensure codecs are compatible

Related#

Call Transfers Guide
SIP Trunks API
Phone Numbers API
Modified at 2025-12-31 12:09:00
Previous
Rate limits
Next
Tool templates
Built with