// strip the params from the via of the response and use the params from the
// original request
Via via = this.lastResponseTopMostVia;
via.removeParameters();
if (originalRequest != null && originalRequest.getTopmostVia() != null) {
NameValueList originalRequestParameters = originalRequest.getTopmostVia()
.getParameters();
if (originalRequestParameters != null && originalRequestParameters.size() > 0) {
via.setParameters((NameValueList) originalRequestParameters.clone());
}
}
via.setBranch(Utils.getInstance().generateBranchId()); // new branch
vias.add(via);
sipRequest.setVia(vias);