Unified SIP Header Pipelines

Unified SIP Header Pipelines

To maintain seamless functional tracking across disparate network segments, the Asterisk 2 ecosystem implements standard custom SIP headers. These headers are injected into live voice streams by edge gateway hardware and proxy servers to pass hardware identity variables down to the core logic layer.


Header Lifecycles & Leg Propagation

The diagram below maps out how custom hardware attributes are extracted from hardware endpoints and injected across active call links:

graph LR
    %% Hardware Origin
    subgraph GatewayOrigin["Physical Hardware Layer"]
        SimBank["Dinstar GSM Rack Array"]
        SimCard["Active SIM Profile<br/>(Slot 3, Port 12)"]
    end

    %% Network Injection
    subgraph ProxyEdge["Signaling Proxy Hub"]
        KamHeaderInject["Header Injection Engine<br/>(append_hf Directives)"]
    end

    %% Voice Node Leg B Execution
    subgraph PbxCore["Asterisk Processing Node"]
        PJSIP_Driver["PJSIP Endpoint Channel"]
        ARI_Reader["ARI Channel Context Engine"]
    end

    %% Database Ledger
    subgraph DataStorage["Enterprise Audit Tier"]
        DbStore[("TelephonyDbContext<br/>(CDR & CEL Tracking Ledgers)")]
    end

    %% Flow Vectors
    SimBank -->|"Extract Hardware Tokens"| SimCard
    SimCard ==>|"Inbound INVITE w/ Raw Tokens"| KamHeaderInject
    KamHeaderInject ==>|"Standardized Injection<br/>(X-PORT-NO, X-IMEI, X-IMSI)"| PJSIP_Driver
    PJSIP_Driver ==>|"Expose via ARI Channel Vars"| ARI_Reader
    ARI_Reader ==>|"Persist Session Meta"| DbStore

    %% Design Palette
    classDef origToken fill:#0f172a,stroke:#38bdf8,stroke-width:2px,color:#fff,rx:6px,ry:6px;
    classDef injectToken fill:#1e293b,stroke:#a855f7,stroke-width:2px,color:#fff,rx:6px,ry:6px;
    classDef coreToken fill:#312e81,stroke:#ec4899,stroke-width:2px,color:#fff,rx:6px,ry:6px;
    classDef auditToken fill:#065f46,stroke:#10b981,stroke-width:2px,color:#fff,rx:6px,ry:6px;

    class GatewayOrigin,SimBank,SimCard origToken;
    class ProxyEdge,KamHeaderInject injectToken;
    class PbxCore,PJSIP_Driver,ARI_Reader coreToken;
    class DataStorage,DbStore auditToken;

Custom Header Reference Manual

| Primary Header Field | Injecting Agent Scope | Format Example Payload | Technical Downstream Action Mapping | | :--- | :--- | :--- | :--- | | X-PORT-NO | Hardware Gateway Racks | X-PORT-NO: 3-12 | Maps active call streams to specific physical SIM bank module slots. Used to track individual port line utilization. | | X-IMEI | Mobile SIM Gateways | X-IMEI: 358921104592011 | Transmits the physical hardware cellular modem serial number. Essential for carrier integration tracking. | | X-IMSI | Dinstar SIM Banks | X-IMSI: 404450912345678 | Passes the unique SIM subscriber identity string. Critical for multi-tenant organizational billing isolation. | | X-Webaltica-Session-Id | Kamailio / ASP.NET Logic | X-Webaltica-Session-Id: a7b2-9f3c | Global tracing string attached to Leg A and Leg B sessions to link multi-segment audio branches across data stores. |


Formatted Example: Raw Ingress SIP INVITE Payload

Below is an authentic sample of an incoming session request complete with embedded hardware identity tags passing downstream logic boundaries:

INVITE sip:9001@docs.webaltica.com SIP/2.0
Via: SIP/2.0/UDP 192.168.10.50:5060;branch=z9hG4bK-d87543-1
Max-Forwards: 70
From: "GSM Gateway Alpha" <sip:gateway1@docs.webaltica.com>;tag=987654321
To: <sip:9001@docs.webaltica.com>
Call-ID: a8b7c6d5-e4f3-2d1c@192.168.10.50
CSeq: 101 INVITE
Contact: <sip:gateway1@192.168.10.50:5060>
X-PORT-NO: 2-04
X-IMEI: 860123049582103
X-IMSI: 404201987654321
X-Webaltica-Session-Id: c5267782-7820-4109-900a-949ba7ca05c0
Content-Type: application/sdp
Content-Length: 235

v=0
o=Dinstar 123456 654321 IN IP4 192.168.10.50
s=SIP Call
c=IN IP4 192.168.10.50
t=0 0
m=audio 12000 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-15