The ClientTransactionclass defines a SIP client transaction object located on a SIP proxy.
A ClientTransactionobject is created by calling the CreateBranch () () () () method on a ServerTransaction object. To fork the proxy behavior, ServerTransaction.CreateBranchcan be called multiple times. However, a ClientTransactionobject 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 class
The ClientTransactionclass is derived from the Transaction class.
Inheritance hierarchy
ReplicatedObject
Microsoft.Rtc.Sip . . :: . . Transaction
Microsoft.Rtc.Sip . . :: . . ClientTransaction
Assembly: ServerAgent(in ServerAgent.dll)
Syntax
Visual Basic (declaration) |
---|
Public Class ClientTransaction _ Inherits Transaction |
Visual Basic (usage) |
---|
Dim instance As ClientTransaction |
C# |
---|
public class ClientTransaction : Transaction |
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: SessionInitiation Protocol).
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.
Copy code | |
---|---|
public void OnRequest(object sender, RequestReceivedEventArgs e) { Console.WriteLine("Enter OnRequest:" + System.DateTime.Now.ToLongTimeString()); ClientTransaction branch = e.ServerTransaction.CreateBranch(); branch.SendRequest(e.Request); } |