pub enum TransactionState {
Nothing,
Calling,
Trying,
Proceeding,
Completed,
Confirmed,
Terminated,
}Expand description
SIP Transaction State
TransactionState represents the various states a SIP transaction can be in
during its lifecycle. These states implement the transaction state machines
defined in RFC 3261 for both client and server transactions.
§States
Nothing- Initial state for client transactions createdCalling- Initial state for client transactions when request is sent or receivedTrying- Request has been sent/received, waiting for response/processingProceeding- Provisional response received/sent (1xx except 100 Trying)Completed- Final response received/sent, waiting for ACK (INVITE) or cleanupConfirmed- ACK received/sent for INVITE transactionsTerminated- Transaction has completed and is being cleaned up
§State Transitions
§Client Non-INVITE Transaction
Nothing → Calling → Trying → Proceeding → Completed → Terminated§Client INVITE Transaction
Nothing → Calling → Trying → Proceeding → Completed → Terminated
↓
Confirmed → Terminated§Server Transactions
Calling → Trying → Proceeding → Completed → Terminated
↓
Confirmed → Terminated (INVITE only)§Examples
use rsipstack::transaction::TransactionState;
let state = TransactionState::Proceeding;
match state {
TransactionState::Nothing => println!("Transaction starting"),
TransactionState::Calling => println!("Request sent"),
TransactionState::Trying => println!("Request sent/received"),
TransactionState::Proceeding => println!("Provisional response"),
TransactionState::Completed => println!("Final response"),
TransactionState::Confirmed => println!("ACK received/sent"),
TransactionState::Terminated => println!("Transaction complete"),
}Variants§
Trait Implementations§
Source§impl Clone for TransactionState
impl Clone for TransactionState
Source§fn clone(&self) -> TransactionState
fn clone(&self) -> TransactionState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransactionState
impl Debug for TransactionState
Source§impl Display for TransactionState
impl Display for TransactionState
Source§impl PartialEq for TransactionState
impl PartialEq for TransactionState
impl StructuralPartialEq for TransactionState
Auto Trait Implementations§
impl Freeze for TransactionState
impl RefUnwindSafe for TransactionState
impl Send for TransactionState
impl Sync for TransactionState
impl Unpin for TransactionState
impl UnwindSafe for TransactionState
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
Mutably borrows from an owned value. Read more