# SIP Interoperability Guide

### 1. Document Purpose

This document provides telecommunications providers with the technical specifications and configuration requirements necessary to establish SIP trunk connectivity with the Trusst AI Voice Platform. The integration enables AI-powered voice agents to handle inbound and outbound telephone calls through your carrier infrastructure.

Trusst's platform supports real-time AI voice interactions for contact center automation, customer service, appointment scheduling, and various other telephony-based AI applications. This guide covers the complete configuration workflow for establishing bidirectional SIP trunk connectivity.

***

### 2. Platform Overview

#### 2.1 Architecture Summary

The Trusst AI Voice Platform operates as a cloud-based SIP endpoint that bridges traditional PSTN telephony with real-time AI voice processing. The platform accepts SIP INVITE requests for inbound calls and originates SIP sessions for outbound calls through configured trunk connections.

Key architectural components include:

* SIP signaling gateway for call control
* Media processing infrastructure for real-time audio
* AI voice agents for natural language interactions
* Call routing logic for dispatch and transfer operations

#### 2.2 Supported Use Cases

| Use Case                  | Description                                                                                          |
| ------------------------- | ---------------------------------------------------------------------------------------------------- |
| **Inbound AI Agents**     | Receive incoming calls and route to AI-powered voice agents for automated handling                   |
| **Outbound AI Campaigns** | Initiate outbound calls from AI agents for proactive customer engagement                             |
| **Hybrid Operations**     | Support for both inbound and outbound calling through a unified trunk configuration                  |
| **Call Transfer**         | AI agents can transfer calls to external numbers or contact center agents via SIP REFER or re-INVITE |

***

### 3. Technical Requirements

#### 3.1 SIP Protocol Specifications

| Parameter               | Specification                                             |
| ----------------------- | --------------------------------------------------------- |
| **SIP Version**         | SIP/2.0 (RFC 3261)                                        |
| **Transport Protocols** | UDP, TCP, TLS                                             |
| **SIP Signaling Port**  | 5060 (UDP/TCP), 5061 (TLS)                                |
| **Authentication**      | Digest Authentication (username/password) or IP-based ACL |
| **Session Timers**      | Supported (RFC 4028)                                      |
| **DTMF Method**         | RFC 2833 (telephone-event) – Required                     |

#### 3.2 Audio Codec Requirements

The Trusst platform supports standard telephony codecs. Codec negotiation follows SDP offer/answer model (RFC 3264). The following codecs are supported in order of preference:

| Codec              | Payload Type  | Sample Rate | Bandwidth |
| ------------------ | ------------- | ----------- | --------- |
| G.711 µ-law (PCMU) | 0             | 8 kHz       | 64 kbps   |
| G.711 A-law (PCMA) | 8             | 8 kHz       | 64 kbps   |
| G.722              | 9             | 16 kHz      | 64 kbps   |
| telephone-event    | 101 (dynamic) | 8 kHz       | N/A       |

{% hint style="info" %}
**Important:** G.711 (PCMU or PCMA) is strongly recommended as the primary codec for optimal compatibility with PSTN interconnection and AI voice processing quality. The platform requires RFC 2833 for DTMF; in-band DTMF detection is not supported.
{% endhint %}

#### 3.3 Media (RTP) Specifications

| Parameter              | Specification                                                |
| ---------------------- | ------------------------------------------------------------ |
| **RTP Port Range**     | 10000–20000 (dynamic allocation)                             |
| **Media Encryption**   | SRTP supported (AES-128-CM); optional based on configuration |
| **Packetization Time** | 20ms (ptime=20)                                              |
| **SDP Protocol**       | RTP/AVP (unencrypted) or RTP/SAVP (encrypted)                |
| **IP Version**         | IPv4 (IPv6 available upon request)                           |

#### 3.4 Network Requirements

To ensure optimal voice quality for AI interactions, the following network parameters must be maintained:

| Metric                 | Requirement                                                           |
| ---------------------- | --------------------------------------------------------------------- |
| **Latency**            | < 150ms one-way (< 100ms recommended for real-time AI responsiveness) |
| **Jitter**             | < 30ms                                                                |
| **Packet Loss**        | < 1%                                                                  |
| **Bandwidth per Call** | \~100 kbps (G.711 with overhead)                                      |

***

### 4. Inbound Trunk Configuration

Configure inbound trunking to route incoming calls from your network to the Trusst platform. This enables AI agents to answer and process inbound customer calls.

#### 4.1 Trusst SIP Endpoint

Direct SIP INVITE requests for inbound calls to the Trusst SIP endpoint. Your dedicated SIP URI will be provided during onboarding in the following format:

```
sip:sip.{your-tenant-id}.trusst.cloud
```

If your carrier configuration requires an endpoint format without the `sip:` prefix, use:

```
sip.{your-tenant-id}.trusst.cloud
```

#### 4.2 Configuration Steps

1. **Configure Origination URI:** Set the Trusst SIP endpoint as the origination destination for the phone numbers designated for AI handling.
2. **Set Transport Protocol:** Configure TCP or TLS transport. TLS (port 5061) is recommended for production environments.
3. **Configure Number Format:** Set destination number format to E.164 with leading '+' (e.g., `+15105550100`).
4. **Associate Phone Numbers:** Assign the purchased DID numbers to the configured SIP connection/trunk.
5. **Verify Routing:** Confirm that inbound calls to the designated numbers are routed to the Trusst endpoint.

***

### 5. Outbound Trunk Configuration

Configure outbound trunking to enable the Trusst platform to initiate calls through your carrier network. This is required for outbound AI campaigns, callbacks, and call transfers.

#### 5.1 Authentication Configuration

Trusst supports digest authentication (username/password) for outbound trunk connectivity. Provide the following credentials during trunk provisioning:

| Parameter              | Description                                             |
| ---------------------- | ------------------------------------------------------- |
| **SIP Domain/Address** | Your carrier's SIP proxy FQDN (e.g., `sip.carrier.com`) |
| **Auth Username**      | SIP digest authentication username                      |
| **Auth Password**      | SIP digest authentication password                      |
| **Outbound Numbers**   | E.164 formatted numbers authorized for caller ID        |
| **Transport**          | UDP, TCP, or TLS                                        |

#### 5.2 IP Allowlisting (If Required)

If your carrier requires IP-based authorization for outbound calls, note that Trusst operates from dynamically allocated cloud infrastructure. We recommend using digest authentication rather than IP allowlisting.

If IP allowlisting is mandatory, please contact Trusst support for current egress IP ranges for your deployment region.

#### 5.3 Number Format Requirements

Ensure your carrier is configured to accept the following number formats from Trusst:

| Header                      | Format                                               |
| --------------------------- | ---------------------------------------------------- |
| **Caller ID (From header)** | E.164 format with leading '+' (e.g., `+15105550100`) |
| **Destination (To header)** | E.164 format with leading '+'                        |
| **Request URI**             | `sip:+{number}@{carrier-domain}`                     |

***

### 6. Security Considerations

#### 6.1 Encryption Recommendations

For production deployments handling sensitive customer interactions, we recommend:

* **TLS 1.2 or TLS 1.3** for SIP signaling encryption
* **SRTP (Secure RTP)** for media encryption using AES-128
* **Digest Authentication** rather than IP-only authorization

{% hint style="info" %}
**Note:** When using SRTP, TLS must also be enabled for SIP signaling to protect the encryption keys exchanged in SDP.
{% endhint %}

#### 6.2 Fraud Prevention

Implement standard telephony fraud prevention measures including:

* Call rate limiting
* Geographic restrictions where appropriate
* Caller ID validation
* Monitoring for anomalous call patterns

Trusst implements platform-level protections, but carrier-side controls provide defense in depth.

***

### 7. Testing and Validation

#### 7.1 Pre-Production Checklist

Complete the following validation steps before enabling production traffic:

| Test Case                                              | Status |
| ------------------------------------------------------ | ------ |
| Inbound call connects and audio path established       | ☐      |
| Outbound call connects with correct caller ID          | ☐      |
| Bidirectional audio confirmed (no one-way audio)       | ☐      |
| DTMF tones detected correctly (RFC 2833)               | ☐      |
| Call hangup terminates session cleanly (BYE processed) | ☐      |
| Codec negotiation successful                           | ☐      |
| Call transfer completes successfully (if applicable)   | ☐      |
| TLS/SRTP encryption verified (if enabled)              | ☐      |

***

### 8. Support Contact

For technical assistance with SIP trunk integration, contact [Trusst support](/product-guides/support.md)

**When contacting support, please have the following information ready:**

* Tenant ID
* Carrier name
* Sample call SIP traces (if available)
* Timestamps of failed calls (UTC)

***

### Appendix A: Sample SDP

The following is an example SDP offer from the Trusst platform:

```
v=0
o=trusst 1234567890 1234567891 IN IP4 203.0.113.50
s=Trusst AI Voice Session
c=IN IP4 203.0.113.50
t=0 0
m=audio 16000 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
```

#### SDP Field Reference

| Field      | Description                                              |
| ---------- | -------------------------------------------------------- |
| `v=0`      | SDP version                                              |
| `o=`       | Origin/session identifier                                |
| `s=`       | Session name                                             |
| `c=`       | Connection information (media destination IP)            |
| `t=`       | Timing (0 0 = permanent session)                         |
| `m=`       | Media description (audio, port, protocol, payload types) |
| `a=rtpmap` | Codec mapping                                            |
| `a=fmtp`   | Format parameters (DTMF events 0-16)                     |
| `a=ptime`  | Packetization time in milliseconds                       |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trusst.ai/product-guides/sip-interoperability-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
