Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

How to: Create and manage SIP transactions

Lync 2013

Learn how to use the Transaction class to create and manage SIP transactions in a Microsoft Lync Server 2013 deployment.

Last modified: August 16, 2013

Applies to: Lync Server 2013

The Microsoft.Rtc.Sip namespace defines a base type, Transaction, that represents the basic properties that are used in a SIP transaction. This includes the request that started the transaction, responses that are handled by the transaction, and events that are used to catch transaction status changes (such as time-out events or cancellations).

The following types are derived from the Transaction class:

The ServerTransaction instance is obtained by referencing the ServerTransaction property on the RequestReceivedEventArgs instance, when a RequestReceivedEventArgs object is dispatched to the designated method. The request it was created to service can be obtained by using one of the following properties:

  • The RequestReceivedEventArgs; Request property

  • Request()

Client transactions must be created programmatically by calling CreateBranch() on the ServerTransaction. The UAC case, where a client transaction originates a request and does not have a parent server transaction, is not supported.

To fork a message, ServerTransaction.CreateBranch can be called as many times as forks are needed. To send a request to each fork, call SendRequest(Request) on each branch.

Responses to serviced requests are obtained by registering a handler for the ResponseReceived event. When this event is raised, any response that is received by Lync Server 2013 that matches the originating request is sent as a ResponseReceivedEventArgs object to the method registered by using the ResponseReceivedEventHandler delegate.

Responses can also be raised by using dispatches from the message filter script when it is set to filter responses. In this case, the response will be out-of-context because there is no ClientTransaction object on the server that originated the request. In this case, the new ClientTransaction object is obtained by referencing the ClientTransaction property on the ResponseReceivedEventArgs instance. The server transaction that forwards the response is obtained by referencing the ServerTransaction property on this ClientTransaction instance, which contains the new ServerTransaction instance to handle it.

If a CANCEL method is received for a transaction, the Canceled event is raised. When the transaction is closed, Terminated is raised. If a transaction times out, TimedOut is raised.

Show:
© 2015 Microsoft