this.addRoute(rrlist); } else {  this.routeList = new RouteList(); }   ContactList contactList = sipRequest.getContactHeaders(); if (contactList != null) { this.setRemoteTarget((ContactHeader) contactList.getFirst());
ListIterator li = recordRouteList.listIterator(recordRouteList .size()); boolean addRoute = true; while (li.hasPrevious()) { RecordRoute rr = (RecordRoute) li.previous();  if (addRoute) { Route route = new Route(); AddressImpl address = ((AddressImpl) ((AddressImpl) rr .getAddress()).clone());  route.setAddress(address); route.setParameters((NameValueList) rr.getParameters() .clone());  this.routeList.add(route); } } } else {     this.routeList = new RouteList(); ListIterator li = recordRouteList.listIterator(); boolean addRoute = true; while (li.hasNext()) { RecordRoute rr = (RecordRoute) li.next();  if (addRoute) { Route route = new Route(); AddressImpl address = ((AddressImpl) ((AddressImpl) rr .getAddress()).clone()); route.setAddress(address); route.setParameters((NameValueList) rr.getParameters() .clone()); routeList.add(route); } } } } finally { if (sipStack.getLogWriter().isLoggingEnabled()) { Iterator it = routeList.iterator();  while (it.hasNext()) { SipURI sipUri = (SipURI) (((Route) it.next()).getAddress() .getURI()); if (!sipUri.hasLrParam()) { sipStack.getLogWriter().logWarning( "NON LR route in Route set detected for dialog : " + this); sipStack.getLogWriter().logStackTrace(); } } }
	public synchronized void addRoute(SIPRequest sipRequest) {		if (sipStack.isLoggingEnabled()) {			sipStack.logWriter.logDebug("setContact: dialogState: " + this					+ "state = " + this.getState());		}		if (this.dialogState == CONFIRMED_STATE				|| this.dialogState == TERMINATED_STATE) {			return;		}		// Incoming Request has the route list		RecordRouteList rrlist = sipRequest.getRecordRouteHeaders();		// Add the route set from the incoming response in reverse		// order		if (rrlist != null) {			this.addRoute(rrlist);		} else {			// Set the rotue list to the last seen route list.			this.routeList = new RouteList();		}		// put the contact header from the incoming request into		// the route set.		ContactList contactList = sipRequest.getContactHeaders();		if (contactList != null) {			this.setRemoteTarget((ContactHeader) contactList.getFirst());		}	}