pub struct Ringing { /* private fields */ }Expand description
An invitation that has been rung but not yet answered.
Holding this is what makes a reliable 180 possible at all: the response has to be
retransmitted until a PRACK arrives, and something has to own the sequence number and the
early dialog’s tag in the meantime.
Implementations§
Source§impl Ringing
impl Ringing
Sourcepub fn tag(&self) -> &str
pub fn tag(&self) -> &str
The To tag this side chose, which the eventual 200 must reuse.
A provisional that establishes a dialog has already told the caller what the remote tag is (RFC 3261 §12.1.1). Answering later with a different tag creates a second dialog, and the caller ACKs the one it knows about while this side waits for an ACK to the other.
Sourcepub fn is_reliable(&self) -> bool
pub fn is_reliable(&self) -> bool
Whether the provisional was sent reliably.
Sourcepub fn is_acknowledged(&self) -> bool
pub fn is_acknowledged(&self) -> bool
Whether the caller has acknowledged it.
Sourcepub fn peer_allows_update(&self) -> bool
pub fn peer_allows_update(&self) -> bool
Whether the caller’s Allow listed UPDATE (RFC 3311 §4).
Sourcepub fn has_early_session(&self) -> bool
pub fn has_early_session(&self) -> bool
Whether the session was described and answered before the call was accepted.
True only after ring_early. It is what makes an offer-carrying UPDATE legal in this
dialog: RFC 3311 §5.1 will not let one out while an offer/answer exchange is open, and
before the 200 the only way to close one is RFC 3262 §5’s answer in a reliable
provisional.
Sourcepub fn media(&self) -> Option<&MediaSession>
pub fn media(&self) -> Option<&MediaSession>
The running media session described by the reliable provisional, when there is one.
ring_early starts it before returning, so an answerer can send an announcement and
receive caller audio before the INVITE is accepted. crate::answer_early moves this
exact session into the resulting crate::Call.
Sourcepub async fn on_update(&mut self, incoming: &Incoming) -> Result<bool>
pub async fn on_update(&mut self, incoming: &Incoming) -> Result<bool>
Answer an UPDATE that arrived in the early dialog (RFC 3311 §5.2).
Returns whether it was one for this dialog. The rules are the same code the calling
side runs from Dialing::on_update: §5.1 makes UPDATE
something either end may send, so a second copy of §5.2 here would be a second place for
it to drift.
An offer arriving before this side has answered the INVITE’s own — that is, after
ring rather than ring_early — draws the 500 of §5.2’s third rule. Not 491:
nothing of ours is outstanding, the peer is simply early, and telling it otherwise would
send it into a back-off instead of the retry that will work.
Sourcepub async fn update(&mut self, direction: Direction) -> Result<()>
pub async fn update(&mut self, direction: Direction) -> Result<()>
Renegotiate the early session from this side (RFC 3311 §5.1).
Requires ring_early: without an answer already given to the INVITE’s offer this side
owes one, and RFC 3264 forbids a second offer while one is open — the far end would
answer 500 and be right to.
Sourcepub async fn on_prack(&mut self, incoming: &Incoming) -> Result<bool>
pub async fn on_prack(&mut self, incoming: &Incoming) -> Result<bool>
Handle an in-dialog PRACK. Returns whether it was one for this ringing.
§3: a PRACK that matches is answered 2xx and stops the retransmissions; one that matches nothing “MUST” be answered 481. Answering 481 matters more than it looks — it tells a caller that acknowledged something we never sent that the two sides disagree, instead of leaving its PRACK transaction to time out looking like a lost packet.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Ringing
impl !RefUnwindSafe for Ringing
impl Send for Ringing
impl Sync for Ringing
impl Unpin for Ringing
impl UnsafeUnpin for Ringing
impl !UnwindSafe for Ringing
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
§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