sip

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 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      SIP-layer counters
protocol/sip/observability dependency-free Prometheus-style registry

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 state for pkg/sip1 (Call-ID, tags, early/confirmed).
Package dialog tracks minimal SIP dialog state for pkg/sip1 (Call-ID, tags, early/confirmed).
Package gateway wires the pure SIP stack (stack + transaction + uas) into a ready-to-run UDP UAS with logrus logging.
Package gateway wires the pure SIP stack (stack + transaction + uas) into a ready-to-run UDP UAS with logrus logging.
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.
internal
siplog
Package siplog provides the shared logrus logger for protocol/sip subpackages.
Package siplog provides the shared logrus logger for protocol/sip subpackages.
Package metrics is the SIP-signaling-layer observability surface.
Package metrics is the SIP-signaling-layer observability surface.
Package metrics is a tiny, dependency-free Prometheus exposition backend tailored to VoiceServer's needs.
Package metrics is a tiny, dependency-free Prometheus exposition backend tailored to VoiceServer's needs.
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 SIP/2.0 signaling layer for pkg/sip.
Package stack is the SIP/2.0 signaling layer for pkg/sip.
Package transaction provides SIP UDP transaction helpers layered under pkg/sip/stack.Endpoint.
Package transaction provides SIP UDP transaction helpers layered under pkg/sip/stack.Endpoint.
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-side) SIP method handlers on stack.Endpoint using typed callbacks.
Package uas registers inbound (UAS-side) SIP method handlers on stack.Endpoint using typed callbacks.

Jump to

Keyboard shortcuts

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