public SipServletRequest createPrack() throws Rel100Exception {
if (_currentRequest.getMethod().equals("INVITE") &&
((_statusCode > 100) && (_statusCode < 200)) &&
!_isAlreadyPRACKGenerated && !isLocallyCreated()) {
if (getHeader(Header.RSEQ) == null) {
throw new Rel100Exception(Rel100Exception.NOT_1XX);
}
// Indicate that we are to send an PRACK.
_isAlreadyPRACKGenerated = true;
return getSession().createRequest("PRACK");
} else if ((_statusCode < 101) || (_statusCode > 199)) {
throw new Rel100Exception(Rel100Exception.NOT_1XX);
}
if (!_currentRequest.getMethod().equals("INVITE")) {
throw new Rel100Exception(Rel100Exception.NOT_INVITE);
}
throw new IllegalStateException(
"Not allowed to create an PRACK at this transaction state.");
}