Skip to main content

Module transaction

Module transaction 

Source
Expand description

Transactions (RFC 3261 §17, amended by RFC 6026).

Four state machines, all of them sans-IO: they read no clock, own no socket and spawn nothing. Time arrives as Timer inputs and leaves as Output::SetTimer. That is what makes retransmission behaviour — the part of SIP that is hardest to get right and hardest to test — reachable from an ordinary unit test with no sleeping and no flakiness.

The state tables in docs/specs/sip-transaction.md are the specification; this code is written from them and the tests walk them row by row.

Structs§

ClientTransaction
A client transaction.
ServerTransaction
A server transaction.
Timers
The three constants everything else is derived from.
TransactionLayer
Holds the transactions in flight and routes messages to them.

Enums§

ClientState
The state of a client transaction.
Dispatch
Where a message went.
Output
Something the driver must do on the transaction’s behalf.
Reason
Why a transaction ended.
Reliability
Whether the transport delivers reliably, which decides half the timer behaviour.
ServerState
The state of a server transaction.
Timer
The timers of RFC 3261 §17.
TransactionKey
A key identifying a transaction.
TuEvent
What the transaction has to tell the transaction user.

Functions§

sent_messages
Convenience: pull the messages to send out of a batch of outputs.
tu_events
Convenience: pull the transaction-user events out of a batch of outputs.