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);

      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


    String callId = ((CallIdHeader) ct.getRequest().getHeader(
        CallIdHeader.NAME)).getCallId();
    SessionAssociation sa = (SessionAssociation) cache.get(callId);

    if (sa != null) {
      Session session = sa.getSession(callId);
      session.setToBeCancelledClientTransaction(ct);
    }
  }
View Full Code Here

   * @param callId
   */
  // TODO Fix the hack referred to above
  private void setDialog(Dialog dialog, String callId) {
    SessionAssociation sa = (SessionAssociation) cache.get(callId);
    Session session = sa.getSession(callId);
    if (log.isDebugEnabled()) {
      log.debug("Setting dialog in session for callId : " + callId);
    }
    session.setDialog(dialog);
  }
View Full Code Here

    }
  }

  private Dialog getPeerDialog(String callId) {
    SessionAssociation sa = (SessionAssociation) cache.get(callId);
    Session peerSession = sa.getPeerSession(callId);
    return peerSession.getDialog();
  }
View Full Code Here

    return peerSession.getDialog();
  }

  private Dialog getDialog(String callId) {
    SessionAssociation sa = (SessionAssociation) cache.get(callId);
    Session session = sa.getSession(callId);
    return session.getDialog();
  }
View Full Code Here

   */
  private void sendRequestCancel(Dialog dialog) {
    // Send to callee
    try {
      // Retrieve the client transacation to cancel
      Session session = getSession(dialog);
      ClientTransaction ct = session.getToBeCancelledClientTransaction();
      sipUtils.sendCancel(ct);
    } catch (SipException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      sa = (SessionAssociation) cache.get(oldCallId);

      Header hNew = ct.getRequest().getHeader(CallIdHeader.NAME);
      String calleeCallIdNew = ((CallIdHeader) hNew).getCallId();

      Session oldCalleeSession = sa.getSession(oldCallId);
      oldCalleeSession.setCallId(calleeCallIdNew);

      try {
        ActivityContextInterface sipACI = activityContextInterfaceFactory
            .getActivityContextInterface(dialog);
        sipACI.attach(sbbLocalObject);
View Full Code Here

   * @return
   */
  private Session getSession(Dialog dialog) {
    final String callId = dialog.getCallId().getCallId();
    SessionAssociation sa = (SessionAssociation) cache.get(callId);
    Session session = sa.getSession(callId);
    return session;
  }
View Full Code Here

      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);
        }
      }

      // Get activity context from factory
      ActivityContextInterface sipACI = getSipActivityContextInterfaceFactory()
          .getActivityContextInterface(dialog);

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

      if (logger.isDebugEnabled()) {
        logger
            .debug("Obtained dialog in onThirdPCCTriggerEvent : callId = "
                + dialog.getCallId().getCallId());
      }
      dialog.terminateOnBye(true);
      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 canceled 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

      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.