sip

package
v1.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package sip provides a pure SIP/2.0 signaling stack (no RTP, no AI).

Layering:

protocol/sip/stack        message parse/serialize, UDP Endpoint, TCP framing (ReadMessage)
protocol/sip/transaction  INVITE/non-INVITE client & server transactions, CANCEL, ACK, timers
protocol/sip/dialog       Call-ID, tags, early/confirmed dialog registry
protocol/sip/uas          UAS handler registration and transaction wiring on stack.Endpoint
protocol/sip/sdp          SDP parse/generate (signaling bodies only)
protocol/sip/outbound     UAC signaling (INVITE/CANCEL/BYE, TCP/TLS pool)
protocol/sip/historyinfo  RFC 7044 / RFC 5806 transfer headers
protocol/sip/identity     RFC 3325 P-Asserted-Identity / Privacy
protocol/sip/session_timer RFC 4028 Session-Expires negotiation
protocol/sip/gateway      UDP UAS + optional UAC Endpoint on one socket; TCP/TLS listeners
protocol/sip/transfer     B2BUA transfer signaling (REFER/NOTIFY, retarget headers)
protocol/sip/stir         STIR/SHAKEN passport header helpers
protocol/sip/hooks        Lifecycle + recording sink interfaces (no ORM)
protocol/sip/signalinglog Optional logrus SIP message audit hook
protocol/sip/metrics      Prometheus registry + SIP-layer counters

RTP, codec negotiation, media sessions, and transfer bridging:

protocol/sipmedia         (see protocol/sipmedia/doc.go)

AI / voice dialog:

protocol/voice

Quick start:

# Pure signaling UAS: examples/sip-uas-demo
# Outbound signaling: examples/sip-outbound-demo

Logging uses github.com/sirupsen/logrus (StandardLogger); no bootstrap required.

Directories

Path Synopsis
Package dialog tracks minimal SIP dialog identifiers for UAS-centric call legs.
Package dialog tracks minimal SIP dialog identifiers for UAS-centric call legs.
Package gateway wires stack + transaction + uas (+ optional outbound) into a runnable SIP server.
Package gateway wires stack + transaction + uas (+ optional outbound) into a runnable SIP server.
Package historyinfo implements RFC 7044 History-Info and RFC 5806 Diversion header processing for the SIP call-transfer / retargeting path.
Package historyinfo implements RFC 7044 History-Info and RFC 5806 Diversion header processing for the SIP call-transfer / retargeting path.
Package hooks defines optional callbacks for call lifecycle and recording delivery.
Package hooks defines optional callbacks for call lifecycle and recording delivery.
Package identity implements RFC 3325 P-Asserted-Identity (PAI) and Privacy header processing for both outbound (UAC) and inbound (UAS) signaling paths.
Package identity implements RFC 3325 P-Asserted-Identity (PAI) and Privacy header processing for both outbound (UAC) and inbound (UAS) signaling paths.
Package metrics is the SIP stack observability surface: a dependency-free Prometheus registry plus typed SIP counters.
Package metrics is the SIP stack observability surface: a dependency-free Prometheus registry plus typed SIP counters.
Package outbound implements SIP UAC (outbound) signaling without media binding.
Package outbound implements SIP UAC (outbound) signaling without media binding.
Package sdp parses and generates minimal audio SDP bodies for SIP/VoIP.
Package sdp parses and generates minimal audio SDP bodies for SIP/VoIP.
Package session_timer implements RFC 4028 Session Timers in SIP.
Package session_timer implements RFC 4028 Session Timers in SIP.
Package signalinglog provides optional logrus hooks for SIP signaling audit trails.
Package signalinglog provides optional logrus hooks for SIP signaling audit trails.
Package stack is the lowest SIP/2.0 signaling layer in lingllm.
Package stack is the lowest SIP/2.0 signaling layer in lingllm.
Package transaction implements RFC 3261 SIP transaction-layer behavior over UDP.
Package transaction implements RFC 3261 SIP transaction-layer behavior over UDP.
Package transfer implements B2BUA-style call transfer signaling (RFC 3515 REFER + NOTIFY).
Package transfer implements B2BUA-style call transfer signaling (RFC 3515 REFER + NOTIFY).
Package uas registers inbound (UAS) SIP method handlers on stack.Endpoint.
Package uas registers inbound (UAS) SIP method handlers on stack.Endpoint.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL