code: public void addSubscription(MobicentsSipServletMessage sipServletMessageImpl) throws SipException {
  		EventHeader eventHeader = null;
  		if(sipServletMessageImpl instanceof SipServletResponseImpl) {
  			eventHeader =  (EventHeader) ((SipServletRequestImpl)((SipServletResponseImpl)sipServletMessageImpl).getRequest()).getMessage().getHeader(EventHeader.NAME);
  		} else {
  			eventHeader =  (EventHeader) sipServletMessageImpl.getMessage().getHeader(EventHeader.NAME);
  		}
  		if(eventHeader != null) {
  			if(logger.isDebugEnabled()) {
  				logger.debug("adding subscription " + eventHeader + " to sip session " + getId());
  			}
  			if(subscriptions == null) {
  				this.subscriptions = new CopyOnWriteArraySet<String>();
  			}
  			subscriptions.add(eventHeader.toString());
  
  			if(logger.isDebugEnabled()) {
  				logger.debug("Request from Original Transaction is " + originalMethod);
  				logger.debug("Dialog is " + sessionCreatingDialog);
  			}
  			if(subscriptions.size() < 2 && Request.INVITE.equals(originalMethod)) {
  				sessionCreatingDialog.terminateOnBye(false);
  			}
  		}
  	}
docs: {@inheritDoc}