pub enum CallState {
Initiating,
Proceeding,
Ringing,
Connected,
Terminating,
Terminated,
Failed,
Cancelled,
IncomingPending,
}Expand description
Current state of a call in its lifecycle
Represents the various states a call can be in, from initiation through termination. These states correspond to SIP call flow stages and help determine what operations are valid at any given time.
§State Transitions
Typical outgoing call flow:
Initiating → Proceeding → Ringing → Connected → Terminating → Terminated
Typical incoming call flow:
IncomingPending → Connected → Terminating → Terminated
§Examples
use rvoip_client_core::call::CallState;
let state = CallState::Connected;
assert!(state.is_active());
assert!(state.is_in_progress());
assert!(!state.is_terminated());Variants§
Initiating
Call is being initiated (sending INVITE)
Initial state for outgoing calls when the INVITE request is being sent but no response has been received yet.
Proceeding
Received 100 Trying or similar provisional response
The remote party has acknowledged receipt of the INVITE and is processing the call request.
Ringing
Received 180 Ringing
The remote party’s phone is ringing. This indicates the call setup is progressing normally.
Connected
Call is connected and media is flowing
The call has been answered and media (audio/video) can be exchanged. This is the primary active state for established calls.
Terminating
Call is being terminated (sending/received BYE)
Either party has initiated call termination but the termination process is not yet complete.
Terminated
Call has ended normally
The call was successfully terminated by either party. This is a final state.
Failed
Call failed to establish
The call setup failed due to network issues, busy signal, rejection, or other errors. This is a final state.
Cancelled
Call was cancelled before connection
The call was cancelled by the caller before the remote party answered. This is a final state.
IncomingPending
Incoming call waiting for user decision
A call invitation has been received and is waiting for the user to accept, reject, or ignore it.
Implementations§
Source§impl CallState
impl CallState
Sourcepub fn is_active(&self) -> bool
pub fn is_active(&self) -> bool
Check if the call is in an active state (can send/receive media)
Returns true only for the Connected state where media can be
actively exchanged between parties.
§Examples
use rvoip_client_core::call::CallState;
assert!(CallState::Connected.is_active());
assert!(!CallState::Ringing.is_active());
assert!(!CallState::Terminated.is_active());Sourcepub fn is_terminated(&self) -> bool
pub fn is_terminated(&self) -> bool
Check if the call is in a terminated state
Returns true for any final state where the call has ended and
no further operations are possible.
§Examples
use rvoip_client_core::call::CallState;
assert!(CallState::Terminated.is_terminated());
assert!(CallState::Failed.is_terminated());
assert!(CallState::Cancelled.is_terminated());
assert!(!CallState::Connected.is_terminated());
assert!(!CallState::Ringing.is_terminated());Sourcepub fn is_in_progress(&self) -> bool
pub fn is_in_progress(&self) -> bool
Check if the call is still in progress
Returns true for any non-terminal state where the call is still
active or progressing through setup/teardown.
§Examples
use rvoip_client_core::call::CallState;
assert!(CallState::Connected.is_in_progress());
assert!(CallState::Ringing.is_in_progress());
assert!(CallState::Initiating.is_in_progress());
assert!(!CallState::Terminated.is_in_progress());
assert!(!CallState::Failed.is_in_progress());Trait Implementations§
Source§impl<'de> Deserialize<'de> for CallState
impl<'de> Deserialize<'de> for CallState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for CallState
impl StructuralPartialEq for CallState
Auto Trait Implementations§
impl Freeze for CallState
impl RefUnwindSafe for CallState
impl Send for CallState
impl Sync for CallState
impl Unpin for CallState
impl UnwindSafe for CallState
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> SipJson for Twhere
T: Serialize + DeserializeOwned,
impl<T> SipJson for Twhere
T: Serialize + DeserializeOwned,
Source§fn to_sip_value(&self) -> Result<SipValue, SipJsonError>
fn to_sip_value(&self) -> Result<SipValue, SipJsonError>
Source§fn from_sip_value(value: &SipValue) -> Result<T, SipJsonError>
fn from_sip_value(value: &SipValue) -> Result<T, SipJsonError>
Source§impl<T> SipJsonExt for T
impl<T> SipJsonExt for T
Source§fn path(&self, path: impl AsRef<str>) -> Option<SipValue>
fn path(&self, path: impl AsRef<str>) -> Option<SipValue>
Simple path accessor that returns an Option directly
Source§fn path_str(&self, path: impl AsRef<str>) -> Option<String>
fn path_str(&self, path: impl AsRef<str>) -> Option<String>
Get a string value at the given path
Source§fn path_str_or(&self, path: impl AsRef<str>, default: &str) -> String
fn path_str_or(&self, path: impl AsRef<str>, default: &str) -> String
Get a string value at the given path, or return the default value if not found