ServerTransaction

The ServerTransaction class defines a SIP server transaction object located on a SIP proxy or user agent server (UAS).

A ServerTransaction instance is generated as the RequestReceivedEventArgs.ServerTransaction property, available on the RequestReceivedEventArgs object dispatched to a specific method by the MSPL script filter. (For more information, see the Dispatch MSPL built-in function.) There are no public constructors for this class.

The request being serviced by this server transaction can be forwarded by calling ServerTransaction.CreateBranch, which will create an associated ClientTransaction. To fork a message, CreateBranch can be called for each fork. The collection of branches for this server transaction can be obtained as a BranchCollection object by referencing the ServerTransaction.Branches property. Requests are sent by calling ClientTransaction.SendRequest on each branch.

To send a response for the request the server transaction was created to service, call ServerTransaction.SendResponse with the Response Sip Class object created by calling Request.CreateResponse () on the Request Sip Class object available in the RequestReceivedEventArgs.Request property.

The ServerTransaction class is derived from the Microsoft.Rtc.Sip.Transaction class.

Public Methods

The ServerTransaction class has the following public methods.

Method

Description

Transaction.Cancel

Inherited from Transaction Sip Class. Cancels the transaction and raises the Transaction.Canceled event.

ServerTransaction.ChallengeRequest

Sends an authentication challenge response to the client transaction whose request is attempting to initiate this server transaction.

ServerTransaction.CreateBranch

Adds a new ClientTransaction object to the Branches property.

Transaction.Dispose ()

Inherited from Transaction. Releases all resources used by this object and destroys it.

EqualString

Inherited from System.Object. Determines whether the specified System.Object is equal to the current System.Object.

GetHashCode()

Inherited from System.Object. Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

GetType()

Inherited from System.Object. Gets the System.Type of the current instance.

ServerTransaction.SendResponse

Sends a SIP response message to the client transaction whose request initiated this server transaction.

ToString()

Inherited from System.Object. Returns a System.String that represents the current System.Object.

Public Properties

The ServerTransaction class has the following public properties.

Property

Description

ServerTransaction.Branches

Data type: BranchCollection

Access type: Read-only

Contains all branches (client transactions) associated with this server transaction as a BranchCollection object.

ServerTransaction.EnableForking

Data type: Boolean

Access type: Read/write

Indicates whether request forking is enabled or not.

Transaction.OriginationTime

Data type: DateTime

Access type: Read-only

Inherited from Transaction. Contains the date and time the transaction originated.

Transaction.Request

Data type: Request

Access type: Read-only

Inherited from Transaction. Contains the Request object that initiated the transaction.

Transaction.Responses

Data type: ResponseCollection

Access type: Read-only

Inherited from Transaction. Contains a collection of all Response objects associated with the transaction.

Transaction.SyncRoot

Data type: Object

Access type: Read-only

Inherited from Transaction. Contains an object used for synchronizing access to a group of objects related to a server or client transaction.

Public Events

The ServerTransaction class has the following public events.

Event

Description

Transaction.Canceled

Inherited from Transaction. Occurs when the transaction is canceled.

Transaction.Terminated

Inherited from Transaction. Occurs when the transaction is terminated.

Transaction.TimedOut

Inherited from Transaction. Occurs when the transaction times out.

Protected Methods

The ServerTransaction class has the following protected methods.

Method

Description

Transaction.CheckDisposed

Inherited from Transaction. Throws ObjectDisposedException if the transaction is in the disposed state.

Transaction.Close

Inherited from Transaction. Releases all resources associated with the transaction.

Transaction.Dispose (bool)

Inherited from Transaction. Destroys this transaction and releases all unmanaged resources as well as optionally releasing all managed ones.

Transaction.Finalize

Inherited from Transaction. Provides a finalizer for this instance of the Transaction class.

Transaction.OnCanceled

Inherited from Transaction. Raises the Transaction.Canceled event.

Transaction.OnTerminated

Inherited from Transaction. Raises the Transaction.Terminated event.

Transaction.OnTimedOut

Inherited from Transaction. Raises the Transaction.TimedOut event.

Requirements

Redistributable: Requires Microsoft Lync Server 2010

Namespace:Microsoft.Rtc.Sip

Assembly: ServerAgent (in ServerAgent.dll)

See Also