//from
SipHeaderFieldName fromName = new SipHeaderFieldName(RFC3261.HDR_FROM);
SipHeaderFieldValue cancelFrom = cancelHeaders.get(fromName);
SipHeaderFieldValue inviteFrom = inviteHeaders.get(fromName);
cancelFrom.setValue(inviteFrom.getValue());
SipHeaderParamName tagParam = new SipHeaderParamName(RFC3261.PARAM_TAG);
cancelFrom.removeParam(tagParam);
cancelFrom.addParam(tagParam, inviteFrom.getParam(tagParam));
//top-via
// cancelHeaders.add(new SipHeaderFieldName(RFC3261.HDR_VIA),
// Utils.getInstance().getTopVia(inviteRequest));
SipHeaderFieldValue topVia = Utils.getTopVia(inviteRequest);
String branchId = topVia.getParam(new SipHeaderParamName(RFC3261.PARAM_BRANCH));
//route
SipHeaderFieldName routeName = new SipHeaderFieldName(RFC3261.HDR_ROUTE);
SipHeaderFieldValue inviteRoute = inviteHeaders.get(routeName);
if (inviteRoute != null) {