if (response.getStatusCode() == Response.OK
&& ((CSeqHeader) response.getHeader(CSeqHeader.NAME))
.getMethod().equals(Request.INVITE)) {
Dialog dialog = tid.getDialog();
CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);
Request ackRequest = dialog.createAck(cseq.getSeqNumber());
dialog.sendAck(ackRequest);
}
if ( tid != null ) {
Dialog dialog = tid.getDialog();
logger.info("Dialog State = " + dialog.getState());