public boolean isValidInternal() { return getSipSession().isValidInternal(); }
public SipServletResponse createResponseToOriginalRequest( SipSession session, int status, String reasonPhrase) { if (session == null) { throw new NullPointerException("Null arg"); } final MobicentsSipSession sipSession = (MobicentsSipSession) session; if(!sipSession.isValidInternal()) { throw new IllegalArgumentException("sip session " + sipSession.getId() + " is invalid !"); } final MobicentsSipServletMessage sipServletMessageImpl = sipSession.getSessionCreatingTransactionRequest(); if(!(sipServletMessageImpl instanceof SipServletRequestImpl)) { throw new IllegalStateException("session creating transaction message is not a request !"); } final SipServletRequestImpl sipServletRequestImpl = (SipServletRequestImpl) sipServletMessageImpl; if(RoutingState.FINAL_RESPONSE_SENT.equals(sipServletRequestImpl.getRoutingState())) { // checked by TCK test com.bea.sipservlet.tck.agents.api.javax_servlet_sip.B2buaHelperTest.testCreateResponseToOriginalRequest101 throw new IllegalStateException("subsequent response is inconsistent with an already sent response. a Final response has already been sent for this request " + sipServletRequestImpl); } if(logger.isDebugEnabled()) { logger.debug("creating response to original request " + sipServletRequestImpl + " on session " + session); } return sipServletRequestImpl.createResponse(status, reasonPhrase); }
private void checkSessionValidity() { if(this.originalRequest.getSipSession().isValidInternal() && this.originalRequest.getSipSession().getSipApplicationSession().isValidInternal()) return; throw new IllegalStateException("Invalid session."); }
MobicentsSipSession sipSession = sipContext.getSipManager().getSipSession(sipSessionKey, false, null, this); if(sipSession != null) { if(sipSession.isValidInternal()) { if(internal) { retSipSessions.add(sipSession);
while (itDerivedSessions.hasNext()) { MobicentsSipSession derivedSipSession = itDerivedSessions.next(); logger.debug("Derived sip session : " + derivedSipSession.getKey() + " isValid " + derivedSipSession.isValidInternal() + " isReadyToInvalidate " + derivedSipSession.isReadyToInvalidateInternal()); if(parentSession.isValidInternal()) { if(logger.isDebugEnabled()) { logger.debug("not removing parent sip session " + parentSession.getKey() + " without derived sessions since it's still valid"); while (itDerivedSessions.hasNext()) { MobicentsSipSession derivedSipSession = itDerivedSessions.next(); logger.debug("Derived sip session : " + derivedSipSession.getKey() + " isValid " + derivedSipSession.isValidInternal() + " isReadyToInvalidate " + derivedSipSession.isReadyToInvalidateInternal());
public void onTerminatedState() { if(isValidInternal()) { onReadyToInvalidate(); if(this.parentSession != null) { Iterator<MobicentsSipSession> derivedSessionsIterator = parentSession.getDerivedSipSessions(); while (derivedSessionsIterator.hasNext()) { MobicentsSipSession mobicentsSipSession = (MobicentsSipSession) derivedSessionsIterator .next(); if(mobicentsSipSession.isValidInternal() && !mobicentsSipSession.isReadyToInvalidate()) { return; } } this.parentSession.onReadyToInvalidate(); } } }
if(logger.isDebugEnabled()) { logger.debug("Is Sip Session Key " + sipSession.getKey() + " ready to be invalidated, " + "isvalidInternal " + sipSession.isValidInternal() + ", isReadyToInvalidate " + sipSession.isReadyToInvalidateInternal()); if(sipSession.isValidInternal() && !sipSession.isReadyToInvalidate()) { if(logger.isDebugEnabled()) { logger.debug("Sip Session not ready to be invalidated : " + sipSession.getKey());
final MobicentsSipSessionKey sipSessionKey = key.getKey(); if(checkSession) { if(!((MobicentsSipSession)session).isValidInternal() || State.TERMINATED.equals(key.getState()) || sessionMap.get(sipSessionKey) == null) {
boolean allSipSessionsInvalidated = true; for(MobicentsSipSession sipSession : getSipSessions(true)) { if(sipSession.isValidInternal()) { allSipSessionsInvalidated = false; break;
if(checkSession && !mobicentsSipSession.isValidInternal()) { throw new IllegalArgumentException("the session " + mobicentsSipSession + " is invalid");
public List<SipServletMessage> getPendingMessages(SipSession session, UAMode mode) { final MobicentsSipSession sipSessionImpl = (MobicentsSipSession) session; if(!sipSessionImpl.isValidInternal()) { throw new IllegalArgumentException("the session " + sipSessionImpl.getId() + " is invalid");
if(!((MobicentsSipSession)session1).isValidInternal() || !((MobicentsSipSession)session2).isValidInternal() || State.TERMINATED.equals(((MobicentsSipSession)session1).getState()) || State.TERMINATED.equals(((MobicentsSipSession)session2).getState()) ||
if(session.isValidInternal()) { boolean lockSession = false; if(bypassCheck && sipContext.getConcurrencyControlMode() == ConcurrencyControlMode.SipSession) {
batchStarted = sipContext.enterSipAppHa(true); if(logger.isDebugEnabled()) { logger.debug("sip session " + sipSessionKey + " is valid ? :" + sipSessionImpl.isValidInternal()); if(sipSessionImpl.isValidInternal()) { if(sipSessionImpl.isValidInternal() &&
sipServletRequestImpl.getSipSession().cleanDialogInformation(false); if(!force && linkedRequest.getSipSession().isValidInternal() && if(sipServletRequestImpl.getSipSession().isValidInternal() &&