code: public void removeSubscription(MobicentsSipServletMessage sipServletMessageImpl) {
  		EventHeader eventHeader =  (EventHeader) sipServletMessageImpl.getMessage().getHeader(EventHeader.NAME);
  		if(eventHeader != null) {
  			if(logger.isDebugEnabled()) {
  				logger.debug("removing subscription " + eventHeader + " to sip session " + getId());
  			}
  			boolean hasOngoingSubscriptions = false;
  			if(subscriptions != null) {
  				subscriptions.remove(eventHeader.toString());
  				if(subscriptions.size() > 0) {
  					hasOngoingSubscriptions = true;
  				}
  				if(!hasOngoingSubscriptions) {
  					if(subscriptions.size() < 1) {
  						if((originalMethod != null && okToByeSentOrReceived) || !Request.INVITE.equals(originalMethod) ) {
  							setState(State.TERMINATED);
  						}
  					}
  				}
  			}
  		}
  		if(isReadyToInvalidateInternal()) {
  			if(logger.isDebugEnabled()) {
  				logger.debug("no more subscriptions in session " + getId());
  			}
  			if(sessionCreatingDialog != null) {
  				sessionCreatingDialog.delete();
  			}
  		}
  	}
docs: {@inheritDoc}