proxy - wrong postprocess routing info ?!

stefan <[email protected]>
Newsgroups gmane.comp.voip.nist-sip
Message-ID <[email protected]>
RFC 3261 says :

6. Postprocess routing information

         If the copy contains a Route header field, the proxy MUST
         inspect the URI in its first value.  If that URI does not
         contain an lr parameter, the proxy MUST modify the copy as
         follows:

         -  The proxy MUST place the Request-URI into the Route header
            field as the last value.

         -  The proxy MUST then place the first Route header field value
            into the Request-URI and remove that value from the Route
            header field.

         Appending the Request-URI to the Route header field is part of
         a mechanism used to pass the information in that Request-URI
         through strict-routing elements.  "Popping" the first Route
         header field value into the Request-URI formats the message the
         way a strict-routing element expects to receive it (with its
         own URI in the Request-URI and the next location to visit in
         the first Route header field value).

Which means, that the first Route header field value is to be removed, if it 
does NOT contain a lr paramter (beside putting it into the Request-URI and 
adding the original Request-URI to the end of Route headers)
But in STEP 6 (6. Postprocess routing information) of class RequestForwarding, 
method forwardRequest, something absolute different is done:
The first Route header field value is removed, if it contains the proxy 
address and a lr parameter :

                // Strip first route if it is the proxy UIR adn lr parameter
                
                ListIterator routes = 
		    clonedRequest.getHeaders(RouteHeader.NAME);
                if (routes!=null && routes.hasNext() ) {
                
                    RouteHeader  routeHeader = (RouteHeader) routes.next();
                    Address routeAddress=routeHeader.getAddress();
                    URI routeURI=routeAddress.getURI();
                
                    if (  routeURI.isSipURI() && 
			((SipURI)routeURI).hasLrParam() ) {
                        
                        String host=((SipURI)routeURI).getHost();
                        
                        if ( stackIPAddress.equals(host)) {
                            routes.remove();
                            
                            if (ProxyDebug.debug)
                                ProxyDebug.println
				("Proxy, forwardRequest(), (STEP 6) we 
removed"+
                                " the first Route header field value: it 
contained"+
                                " the proxy address and a lr parameter");
                        }
                        else {
             
                            if (ProxyDebug.debug)
                                ProxyDebug.println
			       ("RequestForwarding, forwardRequest(), (STEP 
6)"+
                                "lr parameter detected but no match...");
                        }
                    }
                    else
                          if (ProxyDebug.debug)
                    	ProxyDebug.println
			("RequestForwarding, forwardRequest(), (STEP 6)"+
                    	" no Postprocess routing information to do " + 
			"(the route has no lr parameter)...");
                }
                else {
             
                 if (ProxyDebug.debug)
                    ProxyDebug.println("RequestForwarding, forwardRequest(), 
(STEP 6)"+
                    " no Postprocess routing information to do (No routes 
detected)...");
                }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.