> ## Documentation Index
> Fetch the complete documentation index at: https://docs.telegent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Elastic SIP Trunk Documentation

> Use-case samples, PCAP snippets, and a reference guide for SIP INVITEs and expected header-handling behavior when interworking T-Mobile, Joonto SBC/OpenSIPS, and UC partners.

## Overview

The following provides specific use-case samples and examples of various SIP documentation, PCAP snippets, and reference guide for SIP INVITEs and expected header-handling behavior when interworking T-Mobile, Joonto SBC/OpenSIPS, and UC partners.

<Note>
  Telegent highly recommends sending the `Identity` header received from T-Mobile whenever possible. If an upstream partner does not provide the `Identity` header, the call should still be allowed to proceed, but may have potential for STIR/SHAKEN attestation issues.
</Note>

***

## Voice Origination – OTT

* The `Diversion` header allows an OTT call to not automatically be marked as scam likely on the T-Mobile network, because the call didn't originate on the device
* `PRACK` is required for T-Mobile to ring the device

### Inbound INVITE sample where no Identity header is passed to Telegent SBC

```text theme={null}
INVITE sip:+19087645402@13.83.167.165:5060 SIP/2.0
Via: SIP/2.0/UDP 137.192.80.69:5060;branch=z9hG4bKa3b9hn207o8hmq36oqj0.1
Max-Forwards: 69
From: <sip:+17328532203@137.192.80.69>;tag=06gN621vNF84F
To: <sip:+19087645402@13.83.167.165:5060>
Call-ID: d42edea3-7661-123f-989f-be10809469ca
CSeq: 110219115 INVITE
Contact: <sip:gw+rayo@137.192.80.69:5060;gw=rayo;transport=udp>
User-Agent: vp2-inteliquent
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 394
Remote-Party-ID: "+17328532203" <sip:+17328532203@137.192.80.69>;party=calling;screen=yes;privacy=off
P-Asserted-Identity: <sip:+17328532203@137.192.80.69;user=phone>
Diversion: <sip:+19087645402@msg.pc.t-mobile.com>;reason=deflection
```

<Frame caption="Use Case 2A: UC places outbound call via OTT through Tmo PSTN — Phase II">
  <img src="https://mintcdn.com/telegent-1ac592f4/ef1pXiQpHyJR4nNF/images/sip/voice-origination-ott.png?fit=max&auto=format&n=ef1pXiQpHyJR4nNF&q=85&s=bb162d7580023b765b254dba5e2de5a6" alt="Voice Origination flow diagram: outbound voice originated with OTT, UC sends SIP traffic to Telegent mPaaS SBC, Telegent sends SIP traffic to Tmo iSBC, receiving device rings with Tmo MSISDN and Tmo STIR/SHAKEN token" width="1840" height="1065" data-path="images/sip/voice-origination-ott.png" />
</Frame>

***

## Voice Termination – Single SIM Device Endpoint

### Step 1: Inbound INVITE sent first to UC partner for inbound ringing with Identity header

```text theme={null}
INVITE sip:+14155837080@3.232.127.185 SIP/2.0
Via: SIP/2.0/UDP 13.83.167.160:5060;branch=z9hG4bKeade.3d49cb14.0
Max-Forwards: 62
From: <sip:+15302899128@13.83.167.160>;tag=as1eb30ca5
To: <sip:+14155837080@3.232.127.185>
Call-ID: 511cb1aa5180c4b84a1ab34e06988c55@12.7.192.27
CSeq: 102 INVITE
Contact: <sip:13.83.167.160;did=dde.45d132a2>
Supported: replaces
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY,INFO,PUBLISH,MESSAGE
P-Asserted-Identity: tel:+15302899128
Content-Type: application/sdp
Content-Length: 318
Session-Expires: 1800;refresher=uas
Identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9zdGlyLm5hNC5saXZldm94LmNvbS9jZXJ0L1I5ZmZsdGZMIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxNDE1NTgzNzA4MCJdfSwiaWF0IjoxNzY5NTM2NTAxLCJvcmlnIjp7InRuIjoiMTUzMDI4OTkxMjgifSwib3JpZ2lkIjoiNGQxOGM4ODQtZmJhOS0xMWYwLWI1ZDEtMWJlMGJiM2QzMDkyIn0.yY88EdiWSNEig4loaAUqF6eqh0Z2J_H42AaIbtnhcwcvf7wGGi48DNG10QhCz-pSYkJbh5nQY9gLHd_hQ3llgQ;info=<https://stir.na4.livevox.com/cert/R9ffltfL>;alg=ES256;ppt="shaken"

v=0
o=ccs-0-303-11 0300111855943011 1470322392 IN IP4 13.83.167.160
s=CX-IVS-SBC
c=IN IP4 13.83.167.160
b=AS:80
b=RS:1000
b=RR:3000
t=0 0
m=audio 31562 RTP/AVP 0 101
b=AS:80
b=RS:1000
b=RR:3000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
a=rtcp:31563
a=ptime:20
```

### Step 2: INVITE sent to Telegent SBC for ringing SIM device

* `PRACK` is required for T-Mobile to ring the device

```text theme={null}
INVITE sip:+14155837080@13.83.167.160:5060 SIP/2.0
Via: SIP/2.0/UDP 3.232.127.185:5060;rport;branch=z9hG4bKPjd861bc21-52a2-41fc-8f03-db9b6f353727
From: <sip:+15302899128@172.31.57.87>;tag=e7ffee04-82a3-421b-93ba-c6c0701eb71d
To: <sip:+14155837080@13.83.167.160>
Contact: <sip:asterisk@3.232.127.185:5060>
Call-ID: 427dd7b3-49bd-45b2-8525-e3030f3d0463
CSeq: 15418 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: <sip:+15302899128@172.31.57.87>
Identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9zdGlyLm5hNC5saXZldm94LmNvbS9jZXJ0L1I5ZmZsdGZMIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxNDE1NTgzNzA4MCJdfSwiaWF0IjoxNzY5NTM2NTAxLCJvcmlnIjp7InRuIjoiMTUzMDI4OTkxMjgifSwib3JpZ2lkIjoiNGQxOGM4ODQtZmJhOS0xMWYwLWI1ZDEtMWJlMGJiM2QzMDkyIn0.yY88EdiWSNEig4loaAUqF6eqh0Z2J_H42AaIbtnhcwcvf7wGGi48DNG10QhCz-pSYkJbh5nQY9gLHd_hQ3llgQ;info=<https://stir.na4.livevox.com/cert/R9ffltfL>;alg=ES256;ppt=shaken
Max-Forwards: 70
User-Agent: Asterisk PBX 18.10.0~dfsg+~cs6.10.40431411-2
Content-Type: application/sdp
Content-Length: 263

v=0
o=- 1032313863 1032313863 IN IP4 3.232.127.185
s=Asterisk
c=IN IP4 3.232.127.185
t=0 0
m=audio 17256 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
a=maxptime:150
a=sendrecv
```

### Sample of above call scenario

<Frame caption="Use Case 1B: UC receives inbound call on SIM device">
  <img src="https://mintcdn.com/telegent-1ac592f4/ef1pXiQpHyJR4nNF/images/sip/voice-termination-single-sim.png?fit=max&auto=format&n=ef1pXiQpHyJR4nNF&q=85&s=223cad7ca9ba71d166f7b03f8baaa1e8" alt="Voice Termination flow diagram: inbound voice received, SIP traffic sent to UC SBC, UC sends SIP traffic back to Telegent SBC, Telegent sends SIP traffic to SIM device and terminates the call on the SIM device" width="2021" height="1167" data-path="images/sip/voice-termination-single-sim.png" />
</Frame>

***

## Voice Termination – Forked Device Example

### Step 1: Inbound INVITE sent first to UC partner for inbound ringing with Identity header

```text theme={null}
INVITE sip:+13852213180@104.42.190.204 SIP/2.0
Via: SIP/2.0/UDP 13.83.167.160:5060;branch=z9hG4bK1a78.87ff9873.0
Max-Forwards: 64
From: <sip:+12164015165@13.83.167.160>;tag=mavodi-__stsxvrswsxw__0-80-ad-7-0-70003-0-0-0-1766076149-_155985-bb2ec
To: <sip:+13852213180@104.42.190.204>
Call-ID: 0A58AC142435-cb5-dd85f700-aca53b-69442ef5-bb1ab
CSeq: 1 INVITE
Contact: <sip:13.83.167.160;did=a67.a4a089d7>
P-Early-Media: supported
Supported: path,replaces,100rel
Allow: ACK,BYE,CANCEL,INFO,INVITE,MESSAGE,NOTIFY,OPTIONS,PRACK,REFER,UPDATE
P-Asserted-Identity: <sip:+12164015165@172.57.117.36;user=phone>
Content-Type: application/sdp
Content-Length: 268
Session-Expires: 1800;refresher=uas
Identity: eyJhbGciOi... [truncated]
```

### Step 2: INVITE forked to alternate branch (e.g. SIM/OTT app)

```text theme={null}
INVITE sip:+13852213180@13.83.167.164 SIP/2.0
Via: SIP/2.0/UDP 13.83.167.160:5060;branch=z9hG4bK1a78.87ff9873.1
Max-Forwards: 64
From: <sip:+12164015165@13.83.167.160>;tag=mavodi-__stsxvrswsxw__0-80-ad-7-0-70003-0-0-0-1766076149-_155985-bb2ec
To: <sip:+13852213180@104.42.190.204>
Call-ID: 0A58AC142435-cb5-dd85f700-aca53b-69442ef5-bb1ab
CSeq: 1 INVITE
Contact: <sip:13.83.167.160;did=a67.a4a089d7>
P-Early-Media: supported
Supported: path,replaces,100rel
Allow: ACK,BYE,CANCEL,INFO,INVITE,MESSAGE,NOTIFY,OPTIONS,PRACK,REFER,UPDATE
P-Asserted-Identity: <sip:+12164015165@172.57.117.36;user=phone>
Content-Type: application/sdp
Content-Length: 268
Session-Expires: 1800;refresher=uas
Identity: eyJhbGciOi... [truncated]
```

<Frame caption="Use Case 1C: UC receives inbound call on ALL devices — Simult-Ring + Forking">
  <img src="https://mintcdn.com/telegent-1ac592f4/ef1pXiQpHyJR4nNF/images/sip/voice-termination-forked.png?fit=max&auto=format&n=ef1pXiQpHyJR4nNF&q=85&s=92ddaeea987e7d2da0c893d9f186f0d9" alt="Voice Termination forked flow diagram: inbound voice received, SIP traffic sent to UC SBC, UC sends SIP traffic back to Telegent SBC and rings OTT devices, Telegent sends SIP traffic to SIM device, and the call terminates on whichever device answers" width="1716" height="996" data-path="images/sip/voice-termination-forked.png" />
</Frame>

<Info>
  If the OTT branch answers first, Telegent sends `CANCEL` to the other forked INVITE branch. This stops ringing on the remaining destination and behaves like standard simultaneous ringing.
</Info>

***

## Voice Termination – Body Example

### Body samples

```text theme={null}
Message Body
    Session Description Protocol
        Session Description Protocol Version (v): 0
        Owner/Creator, Session Id (o): ccs-0-303-3 030031921555243 768119725 IN IP4 13.83.167.165
            Owner Username: ccs-0-303-3
            Session ID: 030031921555243
            Session Version: 768119725
            Owner Network Type: IN
            Owner Address Type: IP4
            Owner Address: 13.83.167.165
        Session Name (s): -
        Connection Information (c): IN IP4 13.83.167.165
            Connection Network Type: IN
            Connection Address Type: IP4
            Connection Address: 13.83.167.165
        Time Description, active time (t): 0 0
            Session Start Time: 0
            Session Stop Time: 0
        Media Description, name and address (m): audio 35508 RTP/AVP 0 100
            Media Type: audio
            Media Port: 35508
            Media Protocol: RTP/AVP
            Media Format: ITU-T G.711 PCMU
            Media Format: DynamicRTP-Type-100
        Bandwidth Information (b): AS:88
            Bandwidth Modifier: AS [Application Specific (RTP session bandwidth)]
            Bandwidth Value: 88 kb/s
        Media Attribute (a): maxptime:40
            Media Attribute Fieldname: maxptime
            Media Attribute Value: 40
        Media Attribute (a): rtpmap:0 PCMU/8000
            Media Attribute Fieldname: rtpmap
            Media Format: 0
            MIME Type: PCMU
            Sample Rate: 8000
        Media Attribute (a): rtpmap:100 telephone-event/8000
            Media Attribute Fieldname: rtpmap
            Media Format: 100
            MIME Type: telephone-event
            Sample Rate: 8000
        Media Attribute (a): fmtp:100 0-15
            Media Attribute Fieldname: fmtp
            Media Format: 100 [telephone-event]
            Media format specific parameters: 0-15
        Media Attribute (a): sendrecv
        Media Attribute (a): rtcp:35509
            Media Attribute Fieldname: rtcp
            Media Attribute Value: 35509
        Media Attribute (a): ptime:20
            Media Attribute Fieldname: ptime
            Media Attribute Value: 20
        [Generated Call-ID: 0A58AC142435-cb5-dd85f700-aca53b-69442ef5-bb1ab]
```

<Note>
  Need help or have questions? Contact [support@telegent.com](mailto:support@telegent.com)
</Note>
