pub struct ServerInviteTransaction { /* private fields */ }Expand description
Server INVITE transaction implementation as defined in RFC 3261 Section 17.2.1.
This struct implements the state machine for server INVITE transactions, which are used for handling session establishment requests. INVITE server transactions have unique behavior, including:
- A four-state machine (Proceeding, Completed, Confirmed, Terminated)
- Special handling for ACK requests in the Completed state
- Response retransmission in the Completed state
- Unique timer requirements (Timers G, H, I)
Key behaviors:
- In Proceeding state: Sends provisional (1xx) responses
- In Completed state: Retransmits final non-2xx response until ACK is received
- In Confirmed state: Waits for Timer I before terminating
- In Terminated state: Transaction is finished
Implementations§
Source§impl ServerInviteTransaction
impl ServerInviteTransaction
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>
Creates a new server INVITE transaction.
This method creates a new INVITE server transaction with the specified parameters. It validates that the request is an INVITE, initializes the transaction data, and spawns the transaction runner task.
According to RFC 3261 Section 17.2.1, INVITE server transactions start in the Proceeding state.
§Arguments
id- The unique identifier for this transactionrequest- The INVITE request that initiated this transactionremote_addr- The address to which responses 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 ServerInviteTransaction or an error
Trait Implementations§
Source§impl Clone for ServerInviteTransaction
impl Clone for ServerInviteTransaction
Source§fn clone(&self) -> ServerInviteTransaction
fn clone(&self) -> ServerInviteTransaction
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 ServerInviteTransaction
impl Debug for ServerInviteTransaction
Source§impl ServerTransaction for ServerInviteTransaction
impl ServerTransaction for ServerInviteTransaction
Source§fn process_request(
&self,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>
fn process_request( &self, request: Request, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>
Processes an incoming request associated with this transaction. Read more
Source§fn send_response(
&self,
response: Response,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>
fn send_response( &self, response: Response, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>
Sends a response for this transaction, triggering appropriate state transitions. Read more
Source§fn last_response(&self) -> Option<Response>
fn last_response(&self) -> Option<Response>
Returns the last response sent by this transaction. Read more
Source§fn original_request_sync(&self) -> Option<Request>
fn original_request_sync(&self) -> Option<Request>
Synchronous accessor for the original request if it’s available without async operations.
This is an internal helper method that should be implemented by transaction types
that can provide synchronous access to the original request. Read more
Source§fn original_request_call_id(&self) -> Option<String>
fn original_request_call_id(&self) -> Option<String>
Gets the Call-ID from the original request that created this transaction. Read more
Source§impl Transaction for ServerInviteTransaction
impl Transaction for ServerInviteTransaction
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 ServerInviteTransaction
impl TransactionAsync for ServerInviteTransaction
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 ServerInviteTransaction
impl !RefUnwindSafe for ServerInviteTransaction
impl Send for ServerInviteTransaction
impl Sync for ServerInviteTransaction
impl Unpin for ServerInviteTransaction
impl !UnwindSafe for ServerInviteTransaction
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