Skip to main content

Module capture

Module capture 

Source
Expand description

Recording the signalling an endpoint exchanged, for attaching to a bug report.

docs/specs/sip-transport.md §13. Off by default; when off, the cost is one Option check per message and nothing is opened, allocated or spawned.

§The two things worth knowing before reading the code

Ordering is established in the driver loop; the write is not performed there (§13.2). The loop stamps each record with a sequence number and a timestamp and hands it to a writer over a bounded channel. Writing inline reads as the more faithful design and is the opposite: the loop that would do the writing is the loop that fires retransmission timers, so an inline write puts the filesystem in the retransmission path and delays Timer A on a slow or full disk — which is the “observation that perturbs a retransmission race” the story forbids. Faithfulness comes from the order being decided at the observation point, which the sequence number records; the writer may fall behind but cannot reorder what it was given.

A capture is a security surface. It is written to be handed to someone outside the trust boundary it was recorded in, so redaction removes the secrets that would still be valid in another person’s hands: digest responses, opaque Bearer and Basic tokens, SRTP master keys, push tokens, instance URNs. What it cannot remove is identity — To, From and the SDP addresses survive, and they are enough to say who called whom and from where. Redaction makes a capture safe to attach, not safe to publish. See §13.3, and the section comment further down for why the scan is structural rather than a header-name prefix.

Redaction is internal on purpose: it is a policy that grows as new credential-bearing headers are registered, and publishing it would make each addition a breaking change under A-8.

Structs§

CaptureConfig
How a capture is configured (Config::capture).
HepConfig
Best-effort export of the existing signalling capture as HEP3 datagrams.

Enums§

Direction
Which way a message was going.