Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ClientTransaction class

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 class

The ClientTransaction class is derived from the Transaction class.

System.Object
  ReplicatedObject
    Microsoft.Rtc.Sip.Transaction
      Microsoft.Rtc.Sip.ClientTransaction

Namespace:  Microsoft.Rtc.Sip
Assembly:  ServerAgent (in ServerAgent.dll)
public class ClientTransaction : Transaction

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 Initiation 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.

public void OnRequest(object sender, RequestReceivedEventArgs e)
{

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

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

}

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.