#[non_exhaustive]pub enum Error {
Show 38 variants
Io(Error),
Media(SetupError),
Transport(Error),
Build(BuildError),
IdentityAuthentication(AuthenticationError),
Sdp(String),
Profile(ProfileError),
UnspecifiedMediaAddress,
DtlsUnavailable,
Dtls(String),
DtlsSetup(SetupRoleError),
DtlsEarlyMedia,
DtlsRenegotiation,
RtcpModeChange {
current: RtcpMode,
proposed: RtcpMode,
},
NoResponse,
Rejected {
status: u16,
reason: String,
},
AuthenticationChallenge {
status: u16,
reason: String,
challenge: Box<Challenge>,
},
NoDialog,
Cancelled(Duration),
InvitationCancelled,
InvalidDialogTag,
SignallingTeardownTimeout(Duration),
InvalidDialogResponse,
NoReplaces,
NoReferral,
NoCommonCodec,
IntervalTooBrief(Duration),
SessionExpired,
UnacknowledgedProvisional,
NoEarlySession,
StackOwnedDialogMethod(Method),
ApplicationBodyTooLarge {
actual: usize,
limit: usize,
},
ApplicationContentTypeRequired,
ProtectedApplicationHeader(HeaderName),
ApplicationFinalResponseRequired(u16),
ApplicationResponseAlreadySent,
ApplicationRuntimeUnavailable,
DialogEnded,
}Expand description
What can go wrong establishing or running a call.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
A socket failed.
Media(SetupError)
Negotiated media could not be constructed safely.
Transport(Error)
The transport failed.
Build(BuildError)
A message could not be built.
IdentityAuthentication(AuthenticationError)
A selected authentication service could not attest the outbound caller identity.
Sdp(String)
The SDP could not be read.
Profile(ProfileError)
A named browser-audio policy boundary refused setup or renegotiation.
UnspecifiedMediaAddress
SDP was asked to advertise an unspecified address which no peer can reach.
DTLS-SRTP was selected in a build that does not contain its handshake implementation.
Dtls(String)
A selected DTLS-SRTP media path could not be keyed.
DtlsSetup(SetupRoleError)
The DTLS setup exchange selected no role this endpoint can hold.
DtlsEarlyMedia
DTLS-SRTP was selected through an early-dialog API that cannot yet preserve its ordering.
DtlsRenegotiation
A running DTLS-SRTP call was asked to renegotiate without a rekeying exchange.
RtcpModeChange
An in-dialog description tried to change which sockets carry RTCP.
Fields
NoResponse
The INVITE got no final response.
Rejected
The far end refused.
AuthenticationChallenge
A supported digest challenge returned by an INVITE attempt.
crate::dial and crate::dial_once consume this internally when credentials were
supplied. It can surface from crate::dial_early, whose handle names one INVITE and
therefore does not silently replace it with a retry.
Fields
NoDialog
A 2xx that established no dialog — no To tag, or no Contact to send to.
Cancelled(Duration)
The caller gave up before the far end answered, and cancelled the invitation.
Distinct from a rejection: nobody refused the call, we stopped waiting for it.
InvitationCancelled
An invitation was answered after the caller had already withdrawn it (RFC 3261 §9.2).
The other side of Self::Cancelled: there, this stack gave up on an INVITE it sent;
here, the far end gave up on one it sent us, the invitation was answered 487 Request Terminated, and there is nothing left to accept. Answering anyway would put a 200 on a
transaction that has already finished and leave this side holding a call the caller does
not have.
InvalidDialogTag
A caller-selected signalling-dialog tag was empty, overlong or not a SIP token.
The rejected value is deliberately absent: reflecting arbitrary application or fixture bytes in an error is unnecessary and makes it too easy to copy them into a log.
SignallingTeardownTimeout(Duration)
An originated BYE did not receive a final response inside its caller-owned failure bound.
InvalidDialogResponse
A final response to an originated BYE did not name that dialog and CSeq.
The mismatching values are intentionally absent so an untrusted packet is not reflected into logs by displaying this error.
NoReplaces
An INVITE asked to replace a dialog it did not name, or named one this is not.
Deliberately one error for both. Telling a caller “the Call-ID matched but the tags did not” would be telling them how far their guess got.
NoReferral
A transfer was accepted or refused when none had been asked for.
NoCommonCodec
Negotiation produced no usable audio stream.
IntervalTooBrief(Duration)
A 422 refused the session interval we asked for (RFC 4028 §6), naming its own minimum.
Carries the minimum rather than folding into Self::Rejected because the whole point
of a 422 is that it is retryable, and only the value it carries makes the retry possible.
SessionExpired
The far end never refreshed the session, so it was torn down locally (RFC 4028 §10).
UnacknowledgedProvisional
A 2xx was asked for while a reliable provisional carrying SDP is unacknowledged.
RFC 3262 §5 makes the delay a MUST, and this is where it is enforced rather than
silently deferred: a description sent in a provisional that never arrived, followed by a
200 that carries none, leaves the caller in a confirmed dialog with no answer at all.
Keep feeding messages to Ringing::on_prack and try again.
NoEarlySession
An invitation was treated as having an early session when it never had one.
On the answering side: either it was rung with ring rather than ring_early, or it has
already been answered — a Ringing hands its media port and its dialog over exactly once.
On the calling side, from Dialing::update: the far end has
established a dialog but has not answered our offer in a reliable provisional, so RFC
3311 §5.1 does not yet allow an UPDATE to carry one.
Dialing::has_early_session is the same question
asked in advance.
StackOwnedDialogMethod(Method)
A stack-owned or unadmitted method was passed to the application-owned dialog API.
ApplicationBodyTooLarge
Application content exceeded the retained request-body bound.
ApplicationContentTypeRequired
A non-empty application-owned body did not name its media type.
ProtectedApplicationHeader(HeaderName)
An application tried to supply a dialog- or transaction-owned header.
ApplicationFinalResponseRequired(u16)
An application response must end the transaction rather than being provisional.
ApplicationResponseAlreadySent
The request’s exactly-once response capability was already claimed.
A response capability could not capture the runtime that owns its transport work.
DialogEnded
An operation requiring a live dialog was attempted after call teardown.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<AuthenticationError> for Error
impl From<AuthenticationError> for Error
Source§fn from(source: AuthenticationError) -> Self
fn from(source: AuthenticationError) -> Self
Source§impl From<BuildError> for Error
impl From<BuildError> for Error
Source§fn from(source: BuildError) -> Self
fn from(source: BuildError) -> Self
Source§impl From<ProfileError> for Error
impl From<ProfileError> for Error
Source§fn from(source: ProfileError) -> Self
fn from(source: ProfileError) -> Self
Source§impl From<SetupError> for Error
impl From<SetupError> for Error
Source§fn from(source: SetupError) -> Self
fn from(source: SetupError) -> Self
Source§impl From<SetupRoleError> for Error
impl From<SetupRoleError> for Error
Source§fn from(source: SetupRoleError) -> Self
fn from(source: SetupRoleError) -> Self
Auto Trait Implementations§
impl !Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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