pub struct Registration {
pub registrar: Uri,
pub aor: String,
pub contact: String,
pub expires: Duration,
pub call_id: String,
pub cseq: u32,
pub instance: Option<InstanceId>,
pub reg_id: Option<RegId>,
pub gruu: Option<Kind>,
pub push: Option<Device>,
pub headers: Vec<Header>,
}Expand description
What to register.
Fields§
§registrar: UriThe registrar’s URI, which is the Request-URI of the REGISTER.
aor: StringThe address of record being registered.
contact: StringWhere to reach this user agent.
expires: DurationHow long a lease to ask for.
call_id: StringThe Call-ID, constant across refreshes.
cseq: u32The CSeq, increasing across refreshes.
instance: Option<InstanceId>The device identity this registration presents (RFC 5626 §4.1, RFC 5627 §4.1).
One field, and that is the point. Outbound and GRUU both identify the instance with
the same +sip.instance media feature tag, and they must present the same value: a
registrar that correlates them sees one device asking to be two. Two fields would
eventually hold two values, and the resulting fault appears at the registrar rather than
here — which is the worst place to discover it.
When set, the Contact carries +sip.instance.
reg_id: Option<RegId>Which Outbound flow this registration is (RFC 5626 §4.2), when Outbound is in use.
Together with Registration::instance it makes the Contact an Outbound one and has
the REGISTER offer the outbound option tag. A reg-id without an instance is not an
Outbound registration — §4.2 needs both — and is ignored rather than half-offered.
gruu: Option<Kind>Which GRUU this UA will use once the registrar issues them (RFC 5627 §4.4).
Some asks for one: §4.1 has the REGISTER offer the gruu option tag alongside the
instance ID. None does not ask, and no registrar will volunteer.
push: Option<Device>How a push notification service can wake this device (RFC 8599 §4.1.2).
Beside the instance identity rather than in a story of its own, because it is the same
claim: this is the device, and this is how to reach it when there is no flow. When set,
the Contact URI carries pn-provider, pn-param and pn-prid — inside the angle
brackets, which is where a registrar’s URI parser looks.
None registers without push, which is every client that holds a connection of its own.
headers: Vec<Header>Validated application-owned fields repeated on retries and refreshes.
Implementations§
Source§impl Registration
impl Registration
Sourcepub fn request(&self) -> Result<Request, BuildError>
pub fn request(&self) -> Result<Request, BuildError>
Build the REGISTER request.
Note the two URIs that are easy to confuse: the Request-URI names the registrar, the
To names the user. A REGISTER addressed to the user reaches nothing.
Sourcepub fn contact(&self) -> String
pub fn contact(&self) -> String
The Contact to register: the configured one, plus whatever the instance identity adds.
+sip.instance appears exactly once, however many mechanisms want it — RFC 5626 §4.1 and
RFC 5627 §4.1 name the same tag, and it is emitted from the one field that holds it.
The push parameters go on first and go inside: RFC 8599 §8.7 registers them as URI
parameters, so they belong in the URI’s own grammar, while +sip.instance and reg-id are
contact-params and belong after the angle brackets. Two lists, two meanings, and putting
either in the other’s place produces a Contact that parses and says the wrong thing.
Trait Implementations§
Source§impl Clone for Registration
impl Clone for Registration
Source§fn clone(&self) -> Registration
fn clone(&self) -> Registration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for Registration
impl RefUnwindSafe for Registration
impl Send for Registration
impl Sync for Registration
impl Unpin for Registration
impl UnsafeUnpin for Registration
impl UnwindSafe for Registration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more