Skip to main content
A SIP Trunk channel connects your existing PBX or SBC to a VIVI agent over SIP. Calls routed to the agent extension on your PBX are forwarded to VIVI, where the AI agent handles the conversation. If call transfers are enabled, VIVI can also send calls back to your PBX to reach live staff. SIP Trunk channels are ideal for enterprises that want to integrate AI agents into their existing telephony infrastructure.
Throughout this guide, your-termination-domain refers to the SIP domain shown in your channel’s Termination information → Domain field (e.g., eastus2.sip.ai.azure.com). Each channel may be assigned a different regional endpoint. Always use the exact domain from your channel settings rather than assuming a specific region.

Prerequisites

Before you begin, make sure you have:
  • Admin access to your PBX and/or SBC
  • An SBC that supports SIP over TLS (port 5061) and SRTP for media encryption
  • The ability to add custom SIP headers on outbound INVITEs (via SBC scripting, header manipulation rules, or PBX dialplan)
  • A FQDN for your SBC that is reachable from the internet

Set Up

Setting up a SIP Trunk channel requires five main steps: opening firewall ports, creating a SIP trunk, registering the agent extension, configuring required SIP headers, and optionally enabling call transfers.

Step 1: Open Firewall Ports

Allow bidirectional traffic between your network and the VIVI termination endpoint:
Traffic typeDomainPort(s)Protocol
SIP signalingyour-termination-domain5061TLS (TCP)
Media (RTP/SRTP)your-termination-domain10000 – 20000UDP
Azure IPs may rotate. Use FQDN-based firewall rules if your equipment supports it.

Step 2: Create a SIP Trunk

On your PBX or SBC, create a new outbound SIP trunk using the values from the Termination information section in your channel settings.
SettingValue
Trunk typeIP-authenticated (no registration required)
Remote hostyour-termination-domain
Remote port5061
Transport protocolTLS
Media encryptionSRTP – your SBC must offer RTP/SAVP with a crypto line in SDP
Codec priorityG.711 μ-law (PCMU), G.711 A-law (PCMA), G.722

Step 3: Register the Agent Extension

The Agent extension field in your channel settings contains the extension number your PBX uses to route calls to VIVI. Register this extension on your PBX and assign it to the SIP trunk you created above. When a caller or internal routing rule sends a call to this extension, your PBX should forward it over the trunk to VIVI. The resulting SIP Request-URI will look like this:
sip:{agent_extension}@your-termination-domain:5061;transport=tls
Example: If your agent extension is 3000, calls to extension 3000 on your PBX route outbound through the VIVI SIP trunk with a Request-URI of sip:3000@your-termination-domain:5061;transport=tls.

SIP URI Breakdown

Each part of the termination SIP URI serves a specific purpose:
sip:{agent_extension}@{domain}:{port};transport={protocol}
ComponentDescriptionExample
SchemeSIP protocol identifier. Always sip:.sip:
User / ResourceThe agent extension you configured in VIVI. This is the number your PBX routes to.3000
Host / DomainVIVI’s SIP termination domain. Shown in your channel’s Termination information.your-termination-domain
PortStandard port for SIP-over-TLS.5061
TransportEncryption is required. VIVI does not accept unencrypted SIP (UDP/TCP on 5060).transport=tls

Step 4: Configure Required SIP Headers

VIVI uses specific SIP headers to identify calls and route them to the correct AI agent. Your SBC or PBX must include the following headers on every outbound INVITE sent to VIVI.

P-Asserted-Identity

The P-Asserted-Identity (PAI) header must contain your SBC’s external FQDN as the host portion. VIVI uses this header to verify the origin of the incoming call and match it to your configured channel.
"Display Name" <sip:{caller}@{your-sbc-domain}:{port};transport=tls>
Example: "Jane Doe" <sip:+12145551234@sbc.yourcompany.com:5061;transport=tls>
Important: The host in the PAI header must match the domain you entered in Origination information → Domain when creating this channel. If these do not match, VIVI will not be able to identify the call source and the call will fail.

X-Agent-Extension

Your SBC must inject a custom X-Agent-Extension header containing the originally dialed extension or number that triggered the call to VIVI. This allows VIVI to identify which agent, department, or routing context the caller is trying to reach.
X-Agent-Extension: 3000
This is especially important when your SBC rewrites the SIP Request-URI – for example, replacing the dialed extension with a project identifier. The X-Agent-Extension header preserves the original dialed number so VIVI can process it.
This header must be added before any Request-URI rewriting takes place on your SBC. Most SBCs support adding custom headers via Lua scripts, header manipulation rules, or SIP normalization policies.

Example: Complete Outbound INVITE

INVITE sip:3000@your-termination-domain:5061;transport=tls SIP/2.0
Via:                    SIP/2.0/TLS sbc.yourcompany.com;branch=z9hG4bK...
From:                   "Jane Doe" <sip:+12145551234@sbc.yourcompany.com:5060>;tag=...
To:                     <sip:3000@your-termination-domain>
Contact:                "Jane Doe" <sip:+12145551234@sbc.yourcompany.com:5061;transport=TLS>
P-Asserted-Identity:    "Jane Doe" <sip:+12145551234@sbc.yourcompany.com:5061;transport=TLS>
X-Agent-Extension:      3000
Content-Type:           application/sdp

Step 5: Configure Call Transfers (Optional)

When call transfers are enabled in your channel, the AI agent can transfer callers to extensions or departments on your PBX. VIVI sends a SIP INVITE back to your SBC using this URI format:
sip:{target_extension}@{your-sbc-domain}:{port};transport={transport-protocol}
The target extension is the transfer number configured in your VIVI channel’s Call Transfer settings. The host is the domain you entered in Origination information → Domain. Make sure your SBC and firewall allow inbound SIP from your-termination-domain on the specified port and protocol so transfer calls can reach your PBX.

Unique Channel Routing

Each channel in VIVI is uniquely identified by the combination of your origin domain (the FQDN in your Origination information) and the agent extension. You cannot create two channels that share both the same origin domain and the same agent extension – VIVI uses these two values together to determine which channel and AI agent should handle an incoming call. If you need multiple AI agents reachable from the same SBC, assign a different agent extension to each channel. If you need the same agent extension across different locations, each location must use a different origin domain.

Platform-Specific Configuration

If you need help configuring custom SIP headers on your specific platform, here are some starting points:
  • Mitel MBG – Use Lua TX pipeline scripts to add X-Agent-Extension and rewrite PAI headers
  • Ribbon / Sonus SBC – Use SIP Normalization and Header Manipulation Rules
  • AudioCodes SBC – Use Message Manipulations with a Header Rule (Add) action
  • Cisco CUBE – Use SIP Profiles with sip-header-add on the appropriate dial-peer
  • FreePBX / Asterisk – Use SIPAddHeader() in the dialplan before Dial()
  • Microsoft Teams (Direct Routing) – An SBC is required as an intermediary. Contact VIVI support for guidance
If your platform is not listed, refer to your vendor’s documentation for adding custom SIP headers and configuring outbound TLS trunks, or contact VIVI support for assistance.

Testing Checklist

Before testing your first call, confirm the following:
  • Firewall allows bidirectional SIP (5061/TLS) and media (10000–20000/UDP) to and from your-termination-domain
  • SIP trunk is created and pointed at your-termination-domain:5061 with TLS and SRTP
  • Agent extension is registered on your PBX and routed through the VIVI SIP trunk
  • P-Asserted-Identity header contains your SBC’s external FQDN, matching the Origination domain
  • X-Agent-Extension header is present on every outbound INVITE with the originally dialed extension
  • If call transfers are enabled, your SBC accepts inbound SIP from VIVI’s domain

Best Practices

  • Test with a single extension first before rolling out to multiple agents or departments
  • Monitor SBC logs during initial calls to verify the X-Agent-Extension and P-Asserted-Identity headers are present and correct
  • Use FQDN-based firewall rules rather than static IPs, since cloud-hosted endpoints may rotate addresses
  • Keep your SBC firmware current to ensure TLS 1.2+ and SRTP compatibility
  • Document your SIP header configuration so other team members can replicate or troubleshoot the setup
  • Set up proper failover if your telephony infrastructure requires high availability