} else if (this.dialogState == CONFIRMED_STATE) {
// cannot add route list after the dialog is initialized.
// Remote target is updated on RE-INVITE but not
// the route list.
if (sipResponse.getStatusCode() / 100 == 2 && !this.isServer()) {
ContactList contactList = sipResponse.getContactHeaders();
if (contactList != null
&& SIPRequest.isTargetRefresh(sipResponse.getCSeq()
.getMethod())) {
this.setRemoteTarget((ContactHeader) contactList
.getFirst());
}
}
if (!this.pendingRouteUpdateOn202Response)
return;
}
// Update route list on response if I am a client dialog.
if (!isServer() || this.pendingRouteUpdateOn202Response) {
// only update the route set if the dialog is not in the
// confirmed state.
if ((this.getState() != DialogState.CONFIRMED && this
.getState() != DialogState.TERMINATED)
|| this.pendingRouteUpdateOn202Response) {
RecordRouteList rrlist = sipResponse
.getRecordRouteHeaders();
// Add the route set from the incoming response in reverse
// order for record route headers.
if (rrlist != null) {
this.addRoute(rrlist);
} else {
// Set the rotue list to the last seen route list.
this.routeList = new RouteList();
}
}
ContactList contactList = sipResponse.getContactHeaders();
if (contactList != null) {
this
.setRemoteTarget((ContactHeader) contactList
.getFirst());
}
}
} finally {