code: public void processDialogTerminated(final DialogTerminatedEvent dialogTerminatedEvent) {
  		final Dialog dialog = dialogTerminatedEvent.getDialog();
  		if(logger.isDebugEnabled()) {
  			logger.debug("Dialog Terminated => dialog Id : " + dialogTerminatedEvent.getDialog().getDialogId());
  		}
  
  		getAsynchronousExecutor().execute(new Runnable() {
  			// https://github.com/RestComm/sip-servlets/issues/107 guard against NPEon concurrent cleanup
  			final TransactionApplicationData dialogAppData = (TransactionApplicationData) dialog.getApplicationData();
  			public void run() {
  				try {
  					boolean appDataFound = false;
  					TransactionApplicationData txAppData = null;
  					if(dialogAppData != null) {
  						if(dialogAppData.getSipServletMessage() == null) {
  							Transaction transaction = dialogAppData.getTransaction();
  							if(transaction != null && transaction.getApplicationData() != null) {
  								txAppData = (TransactionApplicationData) transaction.getApplicationData();
  								txAppData.cleanUp();
  							}
  						} else {
  							MobicentsSipSessionKey sipSessionKey = dialogAppData.getSipSessionKey();
  							tryToInvalidateSession(sipSessionKey, false);
  						}
  						dialogAppData.cleanUp();
  						// since the stack doesn't nullify the app data, we need to do it to let go of the refs
  						dialog.setApplicationData(null);
  					}
  					if(!appDataFound && logger.isDebugEnabled()) {
  						logger.debug("no application data for this dialog " + dialog.getDialogId());
  					}
  				} catch (Exception e) {
  					logger.error("Problem handling dialog termination", e);
  				}
  			}
  		});
  
  	}
docs: /*
  (non-Javadoc)
  @see javax.sip.SipListener#processDialogTerminated(javax.sip.DialogTerminatedEvent)