* Section 19.1.1). This URI MAY be different for each destination
* the request is forwarded to. The URI SHOULD NOT contain the
* transport parameter.
*/
ListeningPoint defaultLP = jiplet.getListeningPointDefault();
SipProvider sipProvider = jiplet.getSipProvider(defaultLP);
if (addRecordRoute)
{
// Only in stateful forwarding
// We add our jiplet RecordRoute header to the top of the
// list - use the following recommended mechanism to handle multi-homing
/*
* If the URI placed in the Record-Route header field needs to
* be rewritten when it passes back through in a response, the
* URI MUST be distinct enough to locate at that time. (The
* request may spiral through this proxy, resulting in more than
* one Record-Route header field value being added). Item 8 of
* Section 16.7 recommends a mechanism to make the URI
* sufficiently distinct.
*
* The proxy MAY include parameters in the Record-Route header
* field value. These will be echoed in some responses to the
* request such as the 200 (OK) responses to INVITE. Such
* parameters may be useful for keeping state in the message
* rather than the proxy.
*/
if (stateful)
{
SipURI sipURI = addressFactory.createSipURI(null, defaultLP
.getIPAddress());
sipURI.setPort(defaultLP.getPort());
sipURI.setTransportParam(defaultLP.getTransport());
sipURI.setLrParam();
// save the IP address and port the request came in on, for
// rewriting the record route header later in the response
// put it in this forwarded message itself - user part of RR
SipProvider sourceProvider = (SipProvider) requestEvent
.getSource();
ListeningPoint sourceLp = sourceProvider
.getListeningPoints()[0];
sipURI.setUser(sourceLp.getIPAddress() + '-' + sourceLp.getPort());
Address address = addressFactory
.createAddress(null, sipURI);
RecordRouteHeader recordRouteHeader = headerFactory
.createRecordRouteHeader(address);