SIP Forking Proxy Application
A forking proxy forwards a SIP request to multiple SIP addresses and returns the responses to the sender. Basic forking proxies are best handled in the MSPL message filter. This description shows the object model for the forking behavior.
SIP Forking Proxy Behavior
The following diagram illustrates the basic flow of a forking proxy.
When a message is dispatched to the application by the MSPL script, aobject is returned to the method inside the application designated by the call. Attached to this object is a new object, which contains the object as the property.
To fork the Request, clone ServerTransaction.Request for each recipient. First, ensure that the property is set to true. If this property has been set to false (the default is true), ArgumentException will be thrown when you call a second time.
For each proxied request, call ServerTransaction.CreateBranch and then immediately call , passing in the cloned Request.
Responses are handled asynchronously through thedelegate. The event is triggered when a response for a sent Request is received, and the corresponding object is returned as the property.
To proxy the response, call ResponseReceivedEventArgs.Response., passing in
When a final response is passed to the server transaction, the object space containing the ServerTransaction and its branches will be automatically disposed of by the server agent, unless the ServerTransaction.Close() method on ServerTransaction has been overridden.