Learn how a forwarding proxy in a managed SIP application forwards a SIP request to a single SIP address and returns the responses to the sender. This topic discusses the object model for the forwarding behavior.

SIP forwarding proxy application

In Microsoft Lync Server 2013 SDK, you can use the Microsoft SIP Processing Language (MSPL) message filter to forward basic proxies in a managed SIP application.

SIP forwarding proxy behavior

The following illustration shows the basic flow of a forwarding proxy.

SIP Simple Forwarding Proxy Transaction

When a message is dispatched to the application by the MSPL script, a RequestReceivedEventArgsobject is returned to the method inside the application that is designated by the Dispatchcall. Attached to this object is a new ServerTransactionobject, which contains the Requestobject as the ServerTransaction.Requestproperty.

The Requestforwarding process starts by starting a single branch with a call to ServerTransaction.CreateBranch. After that, call ClientTransaction.SendRequest, passing in the cloned Request.

Responses are handled asynchronously through the ResponseReceivedEventHandlerdelegate. The ClientTransaction.ResponseReceivedevent is triggered when a response for a sent Requestis received, and the corresponding Responseobject is returned as the ResponseReceivedEventArgs.Responseproperty.

To proxy the response, call ServerTransaction.SendResponse, passing in ResponseReceivedEventArgs.Response.

When responses have been received for the forwarded request, the object space that contains the ServerTransactioninstance and its sole branch is automatically disposed of by the server agent, unless the ServerTransaction.Close()method on ServerTransactionis specifically overridden and contains post-transaction directives.

See also