SIP Forwarding Proxy Application

A forwarding proxy forwards a SIP request to a single SIP address and returns the responses to the sender. Basic forwarding proxies are best handled in the MSPL message filter. This description shows the object model for the forwarding behavior.

SIP Forwarding Proxy Behavior

The following diagram illustrates 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 RequestReceivedEventArgs object is returned to the method inside the application designated by the Dispatch call. Attached to this object is a new ServerTransaction object, which contains the Request object as the ServerTransaction.Request property.

The Request forwarding process starts by initiating 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 ResponseReceivedEventHandler delegate. The ClientTransaction.ResponseReceived event is triggered when a response for a sent Request is received, and the corresponding Response object is returned as the ResponseReceivedEventArgs.Response property.

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

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