.getSequenceNumberLong());
.getSeqNumber());
	public synchronized void processResponse(ResponseEvent responseReceivedEvent) {		logger.info("Got a response");		Response response = (Response) responseReceivedEvent.getResponse();		ClientTransaction tid = responseReceivedEvent.getClientTransaction();		CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);		logger.info("Response received : Status Code = "				+ response.getStatusCode() + " " + cseq);		if (tid == null) {			logger.info("Stray response -- dropping ");			return;		}		logger.info("transaction state is " + tid.getState());		logger.info("Dialog = " + tid.getDialog());		logger.info("Dialog State is " + tid.getDialog().getState());		try {			if (response.getStatusCode() == Response.OK) {				if (cseq.getMethod().equals(Request.INVITE)) {					if (currentState.equals("first")) {						logger.info("processResponse FIRST");						// send ACK						this.firstDialog = tid.getDialog();						Request ackRequest = firstDialog.createAck(cseq								.getSequenceNumberLong());						logger.info("Sending ACK firtInvite no media");						firstDialog.sendAck(ackRequest);						// invite second no SDP						// get call-id						String callId = ((CallIdHeader) response								.getHeader(CallIdHeader.NAME)).getCallId();						// Create second Invite						second++;						currentState = "second";						Request requestSecond = this.createInvite(currentState,								String.valueOf(second), callId, null,								peerHostPortB);						inviteSecond = sipProvider								.getNewClientTransaction(requestSecond);						inviteSecond.sendRequest();						logger.info("INVITE second sent:\n" + requestSecond);					} else if (currentState.equals("second")) {						logger.info("processResponse SECOND");						// get offer of second						byte[] content = response.getRawContent();						ContentTypeHeader cth = (ContentTypeHeader) response								.getHeader(ContentTypeHeader.NAME);						// reinvite First						Request reinvite = firstDialog.createRequest(Request.INVITE);						reinvite.removeContent();						reinvite.setContent(content, cth);						// Re-Invte offer2'						ClientTransaction ct = sipProvider								.getNewClientTransaction(reinvite);						firstDialog.sendRequest(ct);						this.secondDialog = tid.getDialog();						this.secondDialogOK = response;						logger.info("RE-INVITE sent:\n" + reinvite);						currentState = "re-invite";					} else if (currentState.equals("re-invite")) {						logger.info("processResponse re-invite");						// send ack						CSeqHeader cseq2 = (CSeqHeader) this.secondDialogOK.getHeader(CSeqHeader.NAME);						Request ackRequest = secondDialog.createAck(cseq2								.getSequenceNumberLong());// secondDialog.createRequest(Request.ACK);						logger.info("Sending ACK second " + secondDialog);						secondDialog.sendAck(ackRequest);// secondDialog.sendAck(ackRequest);						Request ackRequestFirst = this.firstDialog.createAck(										cseq.getSequenceNumberLong());						ackRequestFirst.setContent(response.getContent(),								(ContentTypeHeader) (response										.getHeader("Content-Type")));						logger.info("Sending ACK first");						firstDialog.sendAck(ackRequestFirst);						// save the dialog of the other side, for the bye...						firstDialog.setApplicationData(secondDialog);						secondDialog.setApplicationData(firstDialog);						currentState = "fin";					}				}			}		} catch (Exception ex) {			ex.printStackTrace();			System.exit(0);		}	}