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 type | Domain | Port(s) | Protocol |
|---|---|---|---|
| SIP signaling | your-termination-domain | 5061 | TLS (TCP) |
| Media (RTP/SRTP) | your-termination-domain | 10000 – 20000 | UDP |
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.| Setting | Value |
|---|---|
| Trunk type | IP-authenticated (no registration required) |
| Remote host | your-termination-domain |
| Remote port | 5061 |
| Transport protocol | TLS |
| Media encryption | SRTP – your SBC must offer RTP/SAVP with a crypto line in SDP |
| Codec priority | G.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: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:| Component | Description | Example |
|---|---|---|
| Scheme | SIP protocol identifier. Always sip:. | sip: |
| User / Resource | The agent extension you configured in VIVI. This is the number your PBX routes to. | 3000 |
| Host / Domain | VIVI’s SIP termination domain. Shown in your channel’s Termination information. | your-termination-domain |
| Port | Standard port for SIP-over-TLS. | 5061 |
| Transport | Encryption 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
TheP-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.
"Jane Doe" <sip:+12145551234@sbc.yourcompany.com:5061;transport=tls>
X-Agent-Extension
Your SBC must inject a customX-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 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
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: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-Extensionand 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-addon the appropriate dial-peer - FreePBX / Asterisk – Use
SIPAddHeader()in the dialplan beforeDial() - Microsoft Teams (Direct Routing) – An SBC is required as an intermediary. Contact VIVI support for guidance
Testing Checklist
Before testing your first call, confirm the following:- Firewall allows bidirectional SIP (
5061/TLS) and media (10000–20000/UDP) to and fromyour-termination-domain - SIP trunk is created and pointed at
your-termination-domain:5061with TLS and SRTP - Agent extension is registered on your PBX and routed through the VIVI SIP trunk
-
P-Asserted-Identityheader contains your SBC’s external FQDN, matching the Origination domain -
X-Agent-Extensionheader 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-ExtensionandP-Asserted-Identityheaders 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

