Skip to main content

Ringing

Struct Ringing 

Source
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

Source

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.

Source

pub fn is_reliable(&self) -> bool

Whether the provisional was sent reliably.

Source

pub fn is_acknowledged(&self) -> bool

Whether the caller has acknowledged it.

Source

pub fn peer_allows_update(&self) -> bool

Whether the caller’s Allow listed UPDATE (RFC 3311 §4).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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§

Source§

impl Debug for Ringing

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Ringing

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,