Package org.mobicents.slee.util

Examples of org.mobicents.slee.util.Session


      String calleeCallId = ((CallIdHeader) h).getCallId();

      SessionAssociation sa = new SessionAssociation(
          "org.mobicents.slee.service.callcontrol.CallControlSbb$InitialState");

      Session calleeSession = new Session(calleeCallId);
      calleeSession.setSipAddress(calleeAddress);
      calleeSession.setToBeCancelledClientTransaction(ct);

      // The dialog for the client transaction in which the INVITE is sent
      Dialog dialog = ct.getDialog();
      if (dialog != null && logger.isDebugEnabled()) {
        logger
            .debug("Obtained dialog from ClientTransaction : automatic dialog support on");
      }
      if (dialog == null) {
        // Automatic dialog support turned off
        try {
          dialog = getSipProvider().getNewDialog(ct);
          if (logger.isDebugEnabled()) {
            logger
                .debug("Obtained dialog for INVITE request to callee with getNewDialog");
          }
        } catch (Exception e) {
          logger.error("Error getting dialog", e);
        }
      }

      if (logger.isDebugEnabled()) {
        logger
            .debug("Obtained dialog in onThirdPCCTriggerEvent : callId = "
                + dialog.getCallId().getCallId());
      }
      // Get activity context from factory
      ActivityContextInterface sipACI = getSipActivityContextInterfaceFactory()
          .getActivityContextInterface(dialog);

      ActivityContextInterface clientSipACI = getSipActivityContextInterfaceFactory()
          .getActivityContextInterface(ct);

      calleeSession.setDialog(dialog);
      sa.setCalleeSession(calleeSession);

      /**
       * Actually callerSession is not required for this example and clean
       * up is needed
       */
      Session callerSession = new Session();

      // Create a new caller address from caller URI specified in the
      // event (the real caller address) since we need this in the next
      // INVITE.
      callerAddress = getSipUtils().convertURIToAddress(callerSip);
      callerSession.setSipAddress(callerAddress);
      // Since we don't have the client transaction for the caller yet,
      // just set the to be cancelled client transaction to null.
      callerSession.setToBeCancelledClientTransaction(null);
      sa.setCallerSession(callerSession);

      // put the callId for the callee dialog in the cache
      getCacheUtility().put(calleeCallId, sa);

View Full Code Here

TOP

Related Classes of org.mobicents.slee.util.Session

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.