CSeqHeader cSeqHeader = headerFactory.createCSeqHeader(Integer .parseInt(headerValue), Request.INVITE);
CSeqHeader cSeqHeader = headerFactory.createCSeqHeader(Long .parseLong(headerValue), Request.INVITE);
	public Request createInvite(String headerName, String headerValue,			String callerId, String tagVal, String peerHostPort)			throws ParseException, InvalidArgumentException {		String fromSipAddressDomain = "", toSipAddressDomain = "";		String fromDisplayName = "";		String toDisplayName = "";		String fromVal = "", toVal = "";		if (headerName.equals("first")) {			fromVal = auser;			fromSipAddressDomain = aSipAddressDomain;			fromDisplayName = aDisplayName;			toVal = buser;			toSipAddressDomain = bSipAddressDomain;			toDisplayName = bDisplayName;		} else if (headerName.equals("second")) {			fromVal = buser;			fromSipAddressDomain = bSipAddressDomain;			fromDisplayName = bDisplayName;			toVal = auser;			toSipAddressDomain = aSipAddressDomain;			toDisplayName = aDisplayName;		}		logger.info("CreateInvite ");		// create >From Header		SipURI fromAddress = addressFactory.createSipURI(fromVal,				fromSipAddressDomain);		Address fromNameAddress = addressFactory.createAddress(fromAddress);		fromNameAddress.setDisplayName(fromDisplayName);		FromHeader fromHeader = headerFactory.createFromHeader(fromNameAddress,				new Integer((int) (Math.random() * 10000)).toString());		// create To Header		SipURI toAddress = addressFactory.createSipURI(toVal,				toSipAddressDomain);		Address toNameAddress = addressFactory.createAddress(toAddress);		toNameAddress.setDisplayName(toDisplayName);		ToHeader toHeader = headerFactory.createToHeader(toNameAddress, null);		// create Request URI		SipURI requestURI = addressFactory.createSipURI(toVal, peerHostPort);		// Create ViaHeaders		ArrayList viaHeaders = new ArrayList();		ViaHeader viaHeader = headerFactory.createViaHeader("127.0.0.1",				sipProvider.getListeningPoint(transport).getPort(), transport,				null);		viaHeaders.add(viaHeader);		// Create a new CallId header		CallIdHeader callIdHeader = null;		if (callerId == null) {			callIdHeader = sipProvider.getNewCallId();		} else {			callIdHeader = headerFactory.createCallIdHeader(callerId);		}		// Create a new Cseq header		CSeqHeader cSeqHeader = headerFactory.createCSeqHeader(Integer				.parseInt(headerValue), Request.INVITE);		// Create a new MaxForwardsHeader		MaxForwardsHeader maxForwards = headerFactory				.createMaxForwardsHeader(70);		// Create the request.		Request request = messageFactory.createRequest(requestURI,				Request.INVITE, callIdHeader, cSeqHeader, fromHeader, toHeader,				viaHeaders, maxForwards);		// Create contact headers		String host = "127.0.0.1";		SipURI contactUrl = addressFactory.createSipURI(fromVal, host);		contactUrl.setPort(udpListeningPoint.getPort());		// Create the contact name address.		SipURI contactURI = addressFactory.createSipURI(fromVal, host);		contactURI.setPort(sipProvider.getListeningPoint(transport).getPort());		Address contactAddress = addressFactory.createAddress(contactURI);		// Add the contact address.		contactAddress.setDisplayName(fromVal);		contactHeader = headerFactory.createContactHeader(contactAddress);		request.addHeader(contactHeader);		// Allow header. With PUBLISH, to indicate that we'd like to have an		// server-sided PA		String methods = Request.INVITE + ", " + Request.ACK + ", "				+ Request.OPTIONS + ", " + Request.CANCEL + ", " + Request.BYE				+ ", " + Request.INFO + ", " + Request.REFER + ", "				+ Request.MESSAGE + ", " + Request.NOTIFY + ", "				+ Request.SUBSCRIBE;		AllowHeader allowHeader = headerFactory.createAllowHeader(methods);		request.addHeader(allowHeader);		return request;	}