pub struct SipTransaction {
pub id: String,
pub kind: TransactionKind,
pub state: TransactionState,
pub method: SipMethod,
pub branch: String,
pub call_id: String,
pub original_request: Option<SipMessage>,
pub last_response: Option<SipMessage>,
pub retransmit_count: u32,
pub created_at: Instant,
pub last_retransmit: Option<Instant>,
}Fields§
§id: String§kind: TransactionKind§state: TransactionState§method: SipMethod§branch: String§call_id: String§original_request: Option<SipMessage>§last_response: Option<SipMessage>§retransmit_count: u32§created_at: Instant§last_retransmit: Option<Instant>Implementations§
Source§impl SipTransaction
impl SipTransaction
Sourcepub fn new_client(request: &SipMessage) -> Option<Self>
pub fn new_client(request: &SipMessage) -> Option<Self>
Create a new client transaction from an outgoing request
Sourcepub fn new_server(request: &SipMessage) -> Option<Self>
pub fn new_server(request: &SipMessage) -> Option<Self>
Create a new server transaction from an incoming request
Sourcepub fn process_response(&mut self, response: &SipMessage) -> TransactionAction
pub fn process_response(&mut self, response: &SipMessage) -> TransactionAction
Process an incoming response for a client transaction
Sourcepub fn send_response(&mut self, response: &SipMessage) -> TransactionAction
pub fn send_response(&mut self, response: &SipMessage) -> TransactionAction
Process an outgoing response for a server transaction
Sourcepub fn should_retransmit(&self) -> bool
pub fn should_retransmit(&self) -> bool
Check if the transaction should retransmit (for unreliable transport)
Sourcepub fn retransmit_interval(&self) -> Duration
pub fn retransmit_interval(&self) -> Duration
Get the next retransmit interval
Sourcepub fn mark_retransmit(&mut self)
pub fn mark_retransmit(&mut self)
Mark that a retransmission was done
Sourcepub fn is_timed_out(&self) -> bool
pub fn is_timed_out(&self) -> bool
Check if the transaction has timed out
Sourcepub fn is_terminated(&self) -> bool
pub fn is_terminated(&self) -> bool
Check if the transaction is in a terminal state
Sourcepub fn matches(&self, msg: &SipMessage) -> bool
pub fn matches(&self, msg: &SipMessage) -> bool
Check if this transaction matches a given message
Trait Implementations§
Source§impl Clone for SipTransaction
impl Clone for SipTransaction
Source§fn clone(&self) -> SipTransaction
fn clone(&self) -> SipTransaction
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 moreAuto Trait Implementations§
impl Freeze for SipTransaction
impl RefUnwindSafe for SipTransaction
impl Send for SipTransaction
impl Sync for SipTransaction
impl Unpin for SipTransaction
impl UnsafeUnpin for SipTransaction
impl UnwindSafe for SipTransaction
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