pub struct ClientNonInviteTransaction { /* private fields */ }Expand description
Client non-INVITE transaction implementation as defined in RFC 3261 Section 17.1.2.
This struct implements the state machine for client non-INVITE transactions, which are used for all request methods except INVITE. Non-INVITE transactions have simpler behavior than INVITE transactions, including:
- No ACK generation required (unlike INVITE transactions)
- Different timer requirements (Timers E, F, K instead of A, B, D)
- Different state transitions (e.g., non-INVITE transactions can go from Trying directly to Completed)
Key behaviors:
- In Trying state: Retransmits request periodically until response or timeout
- In Proceeding state: Continues retransmissions until final response
- In Completed state: Has received a final response, waiting for retransmissions
- In Terminated state: Transaction is finished
Implementations§
Source§impl ClientNonInviteTransaction
impl ClientNonInviteTransaction
Sourcepub fn new(
id: TransactionKey,
request: Request,
remote_addr: SocketAddr,
transport: Arc<dyn Transport>,
events_tx: Sender<TransactionEvent>,
timer_config_override: Option<TimerSettings>,
) -> Result<Self>
pub fn new( id: TransactionKey, request: Request, remote_addr: SocketAddr, transport: Arc<dyn Transport>, events_tx: Sender<TransactionEvent>, timer_config_override: Option<TimerSettings>, ) -> Result<Self>
Create a new client non-INVITE transaction.
This method creates a new non-INVITE client transaction with the specified parameters. It initializes the transaction data and spawns the transaction runner task.
Non-INVITE transactions are used for all request methods except INVITE, including:
- REGISTER: For user registration with a SIP registrar
- OPTIONS: For querying capabilities of a SIP UA or server
- BYE: For terminating a session
- CANCEL: For canceling a pending INVITE
- And others (SUBSCRIBE, NOTIFY, INFO, etc.)
§Arguments
id- The unique identifier for this transactionrequest- The non-INVITE request that initiates this transactionremote_addr- The address to which the request should be senttransport- The transport layer to use for sending messagesevents_tx- The channel for sending events to the Transaction Usertimer_config_override- Optional custom timer settings
§Returns
A Result containing the new ClientNonInviteTransaction or an error
Trait Implementations§
Source§impl ClientTransaction for ClientNonInviteTransaction
impl ClientTransaction for ClientNonInviteTransaction
Source§fn initiate(&self) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>
fn initiate(&self) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>
Initiates the transaction by sending the first request. Read more
Source§fn process_response(
&self,
response: Response,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>
fn process_response( &self, response: Response, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>
Processes an incoming response for this transaction. Read more
Source§impl Clone for ClientNonInviteTransaction
impl Clone for ClientNonInviteTransaction
Source§fn clone(&self) -> ClientNonInviteTransaction
fn clone(&self) -> ClientNonInviteTransaction
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 ClientNonInviteTransaction
impl Debug for ClientNonInviteTransaction
Source§impl Transaction for ClientNonInviteTransaction
impl Transaction for ClientNonInviteTransaction
Source§fn id(&self) -> &TransactionKey
fn id(&self) -> &TransactionKey
Returns the unique key identifying this transaction.
The key is typically derived from the branch parameter of the Via header, the method, and directionality.
Source§fn kind(&self) -> TransactionKind
fn kind(&self) -> TransactionKind
Returns the
TransactionKind of this transaction (e.g., InviteClient, InviteServer).Source§fn state(&self) -> TransactionState
fn state(&self) -> TransactionState
Returns the current
TransactionState of this transaction (e.g., Trying, Proceeding, Completed).Source§fn remote_addr(&self) -> SocketAddr
fn remote_addr(&self) -> SocketAddr
Returns the network
SocketAddr of the remote party involved in this transaction.
For client transactions, this is the destination address. For server transactions, it’s the source address.Source§impl TransactionAsync for ClientNonInviteTransaction
impl TransactionAsync for ClientNonInviteTransaction
Source§fn process_event<'a>(
&'a self,
event_type: &'a str,
message: Option<Message>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
fn process_event<'a>( &'a self, event_type: &'a str, message: Option<Message>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
Asynchronously processes a significant event relevant to the transaction. Read more
Source§fn send_command<'a>(
&'a self,
cmd: InternalTransactionCommand,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
fn send_command<'a>( &'a self, cmd: InternalTransactionCommand, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
Sends an
InternalTransactionCommand to this transaction for asynchronous processing. Read moreAuto Trait Implementations§
impl Freeze for ClientNonInviteTransaction
impl !RefUnwindSafe for ClientNonInviteTransaction
impl Send for ClientNonInviteTransaction
impl Sync for ClientNonInviteTransaction
impl Unpin for ClientNonInviteTransaction
impl !UnwindSafe for ClientNonInviteTransaction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> TransactionExt for Twhere
T: Transaction + ?Sized,
impl<T> TransactionExt for Twhere
T: Transaction + ?Sized,
Source§fn as_client_transaction(&self) -> Option<&(dyn ClientTransaction + 'static)>
fn as_client_transaction(&self) -> Option<&(dyn ClientTransaction + 'static)>
Attempts to downcast to a ClientTransaction reference. Read more
Source§impl<T> TransactionExt for Twhere
T: Transaction + ?Sized,
impl<T> TransactionExt for Twhere
T: Transaction + ?Sized,
Source§fn as_server_transaction(&self) -> Option<&(dyn ServerTransaction + 'static)>
fn as_server_transaction(&self) -> Option<&(dyn ServerTransaction + 'static)>
Attempts to downcast to a ServerTransaction reference. Read more