if (request.getHeader(Supported.NAME) == null) throw new SipException("No Suported header in the request");  if (request.getHeader(RequireHeader.NAME) == null) throw new SipException("No require header in the request");
ListIterator list = request.getHeaders(SupportedHeader.NAME); if ( list==null || !optionPresent(list,"100rel")) { list = request.getHeaders(RequireHeader.NAME); if ( list==null || !optionPresent(list,"100rel")) { throw new SipException("No Supported/Require 100rel header in the request"); } }
	public Response createReliableProvisionalResponse(int statusCode)			throws InvalidArgumentException, SipException {		SIPServerTransaction sipServerTransaction = (SIPServerTransaction) this				.getFirstTransaction();		if (!(sipServerTransaction instanceof SIPServerTransaction)) {			throw new SipException("Not a Server Dialog!");		}		/*		 * A UAS MUST NOT attempt to send a 100 (Trying) response reliably. Only		 * provisional responses numbered 101 to 199 may be sent reliably. If		 * the request did not include either a Supported or Require header		 * field indicating this feature, the UAS MUST NOT send the provisional		 * response reliably.		 */		if (statusCode <= 100 || statusCode > 199)			throw new InvalidArgumentException("Bad status code ");		SIPRequest request = this.originalRequest;		if (!request.getMethod().equals(Request.INVITE))			throw new SipException("Bad method");		if (request.getHeader(Supported.NAME) == null)			throw new SipException("No Suported header in the request");		if (request.getHeader(RequireHeader.NAME) == null)			throw new SipException("No require header in the request");		SIPResponse response = request.createResponse(statusCode);		/*		 * The provisional response to be sent reliably is constructed by the		 * UAS core according to the procedures of Section 8.2.6 of RFC 3261. In		 * addition, it MUST contain a Require header field containing the		 * option tag 100rel, and MUST include an RSeq header field. The value		 * of the header field for the first reliable provisional response in a		 * transaction MUST be between 1 and 2**31 - 1. It is RECOMMENDED that		 * it be chosen uniformly in this range. The RSeq numbering space is		 * within a single transaction. This means that provisional responses		 * for different requests MAY use the same values for the RSeq number.		 */		Require require = new Require();		try {			require.setOptionTag("100rel");		} catch (Exception ex) {			InternalErrorHandler.handleException(ex);		}		response.addHeader(require);		RSeq rseq = new RSeq();		rseq.setSeqNumber(1L); // Note this will change when the response		// is sent out.		return response;	}