code: private SipURI getNextHop(final SipRequest request) {
  
          // normally you also need to check whether this route is
          // pointing to you and it it is you have to "consume" it
          // and look at the next one. As it stands now, if this
          // route is pointing to us and we will use it as the next
          // hop we will of course create a loop. For now, we will
          // ignore this.
          final RouteHeader route = request.getRouteHeader();
          if (route != null) {
              return (SipURI) route.getAddress().getURI();
          }
  
          return (SipURI) request.getRequestUri();
      }
docs: Calculate the next hop. In SIP, you can specify the path through the network you wish the
  message to go and this is expressed through Route-headers and the request-uri.
  
  Essentially, you check if there are {@link RouteHeader}s present, and if so, the top-most
  {@link RouteHeader} is where you will proxy this message to and otherwise you will use the
  request-uri as your target.
  
  Of course, you also need to check whether perhaps you are the ultimate target but we will
  ignore this for now. This is a simple proxy and if you send us bad traffic, bad things will
  happen :-)
  
  @param request
  @return