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§
- Client
Transaction - A client transaction.
- Server
Transaction - A server transaction.
- Timers
- The three constants everything else is derived from.
- Transaction
Layer - Holds the transactions in flight and routes messages to them.
Enums§
- Client
State - 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.
- Server
State - The state of a server transaction.
- Timer
- The timers of RFC 3261 §17.
- Transaction
Key - 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.