Skip to main content

CallEvent

Enum CallEvent 

Source
#[non_exhaustive]
pub enum CallEvent {
Show 14 variants Ringing { reliable: bool, }, EarlyMediaStarted, Answered, Dtmf { digit: Digit, duration: Duration, }, PlaybackFinished { playback: PlaybackId, completed: bool, }, RecordingFinished { duration: Duration, }, TransferRequested { target: Uri, attended: bool, }, TransferProgress(TransferState), Hold, Resumed, Muted, Unmuted, ApplicationRequest(ApplicationRequest), Ended(EndCause),
}
Expand description

Something that happened to a call, in the order it happened.

Carries what docs/specs/app-contract.md §5.3 needs as the “extra fields” of its wire event of the same shape; building the full per-event call snapshot from a Call’s other state is the interpreter’s job (C-5), not this enum’s.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Ringing

A provisional response was sent or received (RFC 3262), other than a bare 100 Trying — which acknowledges only that a request arrived, not that anything is ringing.

Fields

§reliable: bool

Whether the provisional was reliable (100rel, RFC 3262), i.e. numbered and PRACK-acknowledged rather than fire-and-forget.

§

EarlyMediaStarted

A provisional answer completed offer/answer and the early dialog’s media session is now running (RFC 3960 section 3.2).

Emitted after the session starts and before Self::Answered, exactly once. This is the signal an application uses to stop a locally generated ringing tone and render what the far end is sending instead. A provisional that carries no usable reliable answer never emits it.

§

Answered

The 2xx/ACK exchange completed. Media may flow.

§

Dtmf

A telephone-event run ended: one full keypress (RFC 4733).

Fields

§digit: Digit

Which key.

§duration: Duration

How long it was held, from the event’s own duration field.

§

PlaybackFinished

A playback ran out, or was cut short.

Emitted by Call::play and by Call::start_playback — every playback either call starts resolves here exactly once, whether it ran out, was stopped, was interrupted by a keypress, or was cut off by the call ending (M-17).

Fields

§playback: PlaybackId

Which playback. Clips queue, so a call may have several outstanding at once and “a playback finished” on its own does not say which one to move on from.

§completed: bool

Whether it ran to the end, as opposed to being stopped or interrupted.

§

RecordingFinished

A recording resolved.

Emitted by Call::record_until_idle and Call::record_at_least, whichever ended the recording.

Fields

§duration: Duration

How much was recorded — the audio itself, not counting the trailing silence that detected the end of it.

§

TransferRequested

The far end asked to transfer this call here (RFC 3515 REFER).

Fields

§target: Uri

Where the transferor wants the call sent.

§attended: bool

Whether the Refer-To carries a Replaces — an attended transfer, handing this call the place of one the transferor already has, rather than a blind one.

§

TransferProgress(TransferState)

A transfer this side asked for moved on (RFC 3515 NOTIFY).

§

Hold

The far end put the call on hold.

§

Resumed

The far end took the call off hold.

§

Muted

This side gated its own outbound audio (Call::mute).

A local decision, not a signalled one: unlike Self::Hold this reports something this side did, and the far end was told nothing about it. It is emitted only on a transition — muting a call that is already muted is not something that happened.

The contract’s own vocabulary has no wire event for this, deliberately (docs/specs/app-contract.md §5.3 — mute is an instruction that completes immediately). What a remote app sees is media.muted on the next snapshot (§5.2). This variant is what lets the interpreter build that snapshot from a push rather than by polling the call.

§

Unmuted

This side let its outbound audio through again (Call::unmute).

§

ApplicationRequest(ApplicationRequest)

An application-owned method arrived inside this dialog.

INFO and MESSAGE are admitted directly. A private extension token appears here only after Call::admit_dialog_method admitted it. The owned value must be answered or dropped; either outcome resolves its server transaction.

§

Ended(EndCause)

The call is over. Always the last event on the stream — the channel’s delivery policy reserves a slot for it specifically so this is never the one an overflow drops.

Trait Implementations§

Source§

impl Clone for CallEvent

Source§

fn clone(&self) -> CallEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CallEvent

Source§

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

Formats the value using the given formatter. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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,