Edit

Share via


ClientTransaction Class

Definition

The ClientTransaction class defines a SIP client transaction object located on a SIP proxy.A ClientTransaction object is created by calling the CreateBranch() method on a ServerTransaction object. To fork the proxy behavior, ServerTransaction.CreateBranch can be called multiple times. However, a ClientTransaction object can service only one request. To send the request, call the SendRequest(Request) method.To handle the responses for the request that are sent by a specific client transaction, you must register for the ResponseReceived event. This event returns a ResponseReceivedEventArgs object whenever it is raised, and contains the response as a Response class object.Currently, the User Account Control (UAC) client transaction case is not supported, where the server originates a client transaction. Only proxy behaviors are available for this classThe ClientTransaction class is derived from the Transaction class.

public ref class ClientTransaction : Microsoft::Rtc::Sip::Transaction
public class ClientTransaction : Microsoft.Rtc.Sip.Transaction
Public Class ClientTransaction
Inherits Transaction
Inheritance
ClientTransaction

Remarks

Client transactions are used by UACs and proxies.

For information about the nature of client transactions, the UAC, inbound and outbound proxies, and server transactions, see Section 17 of RFC 3261 (SIP: Session

Example Code

The following code example logs the time a request is passed to the "OnRequest" dispatch handler, and then forwards the request by creating a branch on the server transaction that is passed to the handler. Requests are dispatched to this method from the MSPL script in the application manifest by using the Dispatch MSPL function.

public void OnRequest(object sender, RequestReceivedEventArgs e)
{

Console.WriteLine("Enter OnRequest:" + System.DateTime.Now.ToLongTimeString());

ClientTransaction branch = e.ServerTransaction.CreateBranch();
branch.SendRequest(e.Request);

}

Constructors

ClientTransaction()

Protected constructor that prevents direct creation of the server transaction objects by general callers.

ClientTransaction(ServerAgent)

Creates a new client transaction.

Fields

simpleProxy

For internal use.

(Inherited from Transaction)
state (Inherited from ReplicatedObject)

Properties

IsForked

Fork state of the outgoing client transaction.

MarshalContent

Determines whether the content body of the SIP message is marshaled or is not marshaled.

(Inherited from Transaction)
OriginationTime

Time the transaction was originated.

(Inherited from Transaction)
Request

Request that started the transaction.

(Inherited from Transaction)
Responses

Collection of responses in the transaction.

(Inherited from Transaction)
ServerAgent

The ServerAgent which created this transaction.

(Inherited from Transaction)
ServerTransaction

The ServerTransaction property contains the root ServerTransaction object for which this client transaction is a branch.

SyncRoot

Object space used for synchronizing access to a group of objects related to a server or a UAC transaction.

(Inherited from Transaction)
TraceCorrelationGuid (Inherited from Transaction)
TraceCorrelationId

Trace Correlation ID.

(Inherited from Transaction)
TraceFilterMatch

Determines whether the message matches any existing trace filter.

(Inherited from Transaction)

Methods

Cancel()

Cancels the client transaction.

Cancel(CancelContext)

Cancels the client transaction.

CheckDisposed()

Throws an ObjectDisposedException if the object is in the disposed state.

(Inherited from Transaction)
Close()

Allows derived classes to provide custom lifetime management.

(Inherited from Transaction)
Dispose()

Releases all resources used by this object.

(Inherited from Transaction)
Dispose(Boolean)

Releases the unmanaged resources used by this object and optionally releases the managed resources.

(Inherited from Transaction)
GetCorrelationId()

Trace correlation ID.

(Inherited from Transaction)
InitializeMarshaled(ServerAgent, ObjectSpace, UInt32) (Inherited from ReplicatedObject)
InitializeUnmarshaled(ReplicatedObject) (Inherited from ReplicatedObject)
InitializeUnmarshaled(ServerAgent, ObjectSpace) (Inherited from ReplicatedObject)
IsTraceFilterMatch()

Determines whether the message matches any existing trace filter.

(Inherited from Transaction)
OnCanceled(String) (Inherited from Transaction)
OnResponseReceived(ResponseReceivedEventArgs)

The OnResponseReceived method raises the ResponseReceived event.

OnTerminated()

Raises the Terminated event.

(Inherited from Transaction)
OnTimedOut()

Raises the TimedOut event.

(Inherited from Transaction)
SendRequest(Request)

The SendRequest method sends a SIP request to a server transaction on a proxy or user account system (UAS).

SetMarshaled() (Inherited from ReplicatedObject)

Events

Canceled

Occurs when the transaction has been canceled.

(Inherited from Transaction)
ResponseReceived

The ResponseReceived event is raised when a response message for the request sent by the ClientTransaction object is received.

Terminated

Occurs when the transaction is terminated.

(Inherited from Transaction)
TimedOut

Occurs when the transaction has timed out.

(Inherited from Transaction)

Applies to