if (isAlreadyLinked((SipServletRequestImpl) origRequest)) {
throw new IllegalArgumentException();
}
SipSession session1 = origRequest.getSession();
if ((session1 == null) || (session2 == null)) {
throw new NullPointerException();
}
// are sessions consistent?
if (isValidSessions((SipSessionBase) session1, (SipSessionBase) session2) &&
(origRequest.getApplicationSession(false) != null) &&
(session1.getApplicationSession()
.equals(origRequest.getApplicationSession()) == false)) {
throw new IllegalArgumentException();
}
// headerMap can only contain TO, FROM or CONTACT system headers.