Skip to main content

SessionError

Enum SessionError 

Source
pub enum SessionError {
Show 27 variants SessionNotFound(String), InvalidTransition(String), DialogError(String), MediaError(String), MediaIntegration { reason: String, }, SDPNegotiationFailed(String), ConfigurationError(String), ConfigError(String), InvalidInput(String), Timeout(String), NetworkError(String), ProtocolError(String), UnreliableProvisionalsNotSupported, MissingCredentialsForInviteAuth, MissingCredentialsForRequestAuth { method: Method, }, InviteAuthRetryExhausted, RequestAuthRetryExhausted { method: Method, }, InternalError(String), IoError(Error), NotImplemented(String), TransferFailed(String), AuthError(String), RegistrationFailed(String), Other(String), HeaderPolicy { method: Method, header: HeaderName, reason: ViolationReason, }, MissingRequiredHeader { method: Method, names: Vec<HeaderName>, }, Conflict { method: Method, },
}
Expand description

Errors returned by the rvoip-sip session layer.

Variants§

§

SessionNotFound(String)

No session with the given identifier exists in the registry.

§

InvalidTransition(String)

A requested state-machine transition is not legal from the current state.

§

DialogError(String)

An error originating in the dialog layer (rvoip-sip-dialog).

§

MediaError(String)

An error originating in the media layer (rvoip-media-core).

§

MediaIntegration

SIP signalling succeeded but wiring media to the negotiated session failed.

Fields

§reason: String

Human-readable description of the media-integration failure.

§

SDPNegotiationFailed(String)

SDP offer/answer negotiation failed (no common codec, malformed SDP, etc.).

§

ConfigurationError(String)

Invalid or inconsistent configuration supplied to a builder or coordinator.

§

ConfigError(String)

Configuration error (legacy alias of SessionError::ConfigurationError).

§

InvalidInput(String)

An application-supplied argument was malformed or out of range.

§

Timeout(String)

An operation did not complete within its allotted time.

§

NetworkError(String)

A transport-level network error occurred.

§

ProtocolError(String)

A SIP protocol violation was detected.

§

UnreliableProvisionalsNotSupported

RFC 3262 — the remote peer did not advertise Supported: 100rel on the INVITE, so we cannot send a reliable 183 Session Progress. Raised by send_early_media. Today we fail fast; a future send_progress(sdp) API could fall back to an unreliable 183.

§

MissingCredentialsForInviteAuth

RFC 3261 §22.2 — the server challenged our INVITE with 401/407 but the session has no credentials on file. Set credentials via StreamPeerBuilder::with_credentials (per-peer default) or control.invite(...).with_credentials(...) (per-call).

§

MissingCredentialsForRequestAuth

RFC 3261 §22.2 — the server challenged an outbound request with 401/407 but the request flow has no credentials on file.

Fields

§method: Method

SIP method that was challenged.

§

InviteAuthRetryExhausted

RFC 3261 §22.2 — INVITE auth has already been retried once and the server challenged again. Prevents loops against a broken server or wrong credentials.

§

RequestAuthRetryExhausted

RFC 3261 §22.2 — outbound request auth has already been retried once and the server challenged again.

Fields

§method: Method

SIP method whose auth retry limit was exceeded.

§

InternalError(String)

An unexpected internal invariant was violated.

§

IoError(Error)

An underlying std::io error (transport sockets, file I/O).

§

NotImplemented(String)

The requested capability is recognized but not yet implemented.

§

TransferFailed(String)

A call transfer (REFER flow) failed.

§

AuthError(String)

Authentication failed or could not be completed.

§

RegistrationFailed(String)

A REGISTER flow failed after any supported retry path.

§

Other(String)

A flattened/stringly error from a lower layer that has no dedicated variant.

§

HeaderPolicy

SIP_API_DESIGN_2 §8 — a builder setter or with_header call staged a header that violates the per-method policy. The most common case is staging a stack-managed name (Call-ID, CSeq, Via, Max-Forwards) or a method-shaped name that has a dedicated setter (e.g. Authorization -> with_credentials / with_auth).

Fields

§method: Method

SIP method whose per-method header policy was violated.

§header: HeaderName

The offending header name.

§reason: ViolationReason

Why the header was rejected.

§

MissingRequiredHeader

SIP_API_DESIGN_2 §8 — HeaderPolicy::validate_outbound reported one or more required application-supplied headers were missing for the chosen method.

Fields

§method: Method

SIP method that requires the missing header(s).

§names: Vec<HeaderName>

The required header names that were not supplied.

§

Conflict

SIP_API_DESIGN_2 §7.3 invariant #5 — a second .send() was attempted on the same session for a method whose pending_<method>_options stash slot is still occupied by an in-flight prior .send(). Wait for the first future to complete (or drop cleanly) before starting another of the same method.

Fields

§method: Method

SIP method whose in-flight .send() blocks a second concurrent send.

Implementations§

Source§

impl SessionError

Source

pub fn is_session_gone(&self) -> bool

True if this error means “the session is already gone from the registry” — covers both the typed SessionNotFound variant and the stringly-wrapped Other("Session not found: …") form that falls out of the From<Box<dyn Error>> flatteners above.

Useful for fire-and-forget teardown paths (e.g. SessionHandle::hangup) that race against a natural call-ended cleanup: if the race is lost, the goal is already achieved and the error should be silent.

Trait Implementations§

Source§

impl Debug for SessionError

Source§

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

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

impl Display for SessionError

Source§

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

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

impl Error for SessionError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<AuthError> for SessionError

Source§

fn from(err: AuthError) -> Self

Converts to this type from the input type.
Source§

impl From<Box<dyn Error + Send + Sync>> for SessionError

Source§

fn from(err: Box<dyn Error + Send + Sync>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<dyn Error>> for SessionError

Source§

fn from(err: Box<dyn Error>) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for SessionError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<HeaderPolicyViolation> for SessionError

Source§

fn from(v: HeaderPolicyViolation) -> Self

Converts to this type from the input type.
Source§

impl From<SessionError> for B2buaError

Source§

fn from(source: SessionError) -> Self

Converts to this type from the input type.
Source§

impl From<SessionError> for TransferError

Source§

fn from(err: SessionError) -> Self

Converts to this type from the input type.

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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.

Source§

impl<T> Instrument for T

Source§

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

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

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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