Expand description
Client-initiated connections — Outbound (RFC 5626).
The problem it solves: a UA behind a NAT registers a Contact naming an address that only
exists inside the NAT, and the binding the registrar records is unroutable the moment the
mapping lapses. Outbound’s answer is to stop routing to an address and route down a flow
instead — the connection the client itself opened — identified by a token the registrar puts in
Path and hands back to itself later.
Everything here is a decision, not an action: which parameters a REGISTER carries, whether the
registrar accepted the mechanism, how long to wait before the next keep-alive, and how long to
wait before retrying a flow that failed. The randomised choices take the fraction as an
argument so a test can pin them, with a thin rand wrapper for callers that do not care.
Structs§
- Flow
- The identity of one Outbound flow: the device, and which of its flows this is (RFC 5626 §4.1, §4.2).
- Instance
Id - A device identity that outlives a reboot, a re-address and a change of network (§4.1).
- RegId
- Which flow a registration is for (§4.2).
Enums§
- Keepalive
- How a flow is kept alive, which depends on the transport (§4.4).
- Power
- Whether the device is one where a keep-alive every two minutes is a battery problem (§4.4.1).
Constants§
- MAX_
RECOVERY_ WAIT - The longest §4.5 will ever have a UA wait between attempts to re-establish a flow.
- MAX_
REG_ ID - The largest
reg-idRFC 5626 §4.2 allows: values run from 1 to 2^31 - 1. - OPTION_
TAG - The option tag, registered in RFC 5626 §11.4.
- PONG_
TIMEOUT - How long a UA waits before pronouncing a CRLF-kept flow dead (§4.4.1).
Functions§
- accepted
- Whether the registrar actually performed an outbound registration (§6).
- contact
- The
Contacta REGISTER for one flow carries. - flow_
timer - The
Flow-Timerthe registrar named, if any (§6, §4.4). - fraction
- Draw a fraction for the randomised choices above.
- keepalive_
for - Pick the keep-alive technique §4.4 mandates for a transport.
- keepalive_
interval - How long to wait before the next keep-alive (§4.4.1, §4.4.2).
- recovery_
delay - How long to wait before trying to re-establish a failed flow (§4.5).
- required_
by - Whether a registrar demands Outbound of its clients —
Require: outboundon a failure. - with_ob
- Add the
obURI parameter to a contact for a dialog-forming request (§4.3).