Package javax.slee

Examples of javax.slee.ActivityContextInterface


    public void onConfBridgeCreated(MsLinkEvent evt, ActivityContextInterface aci) {
        MsLink link = evt.getSource();
        String endpointName = link.getEndpoints()[1];

        logger.info("Created conference bridge: " + endpointName);
        ActivityContextInterface connectionActivity = this.getConnectionActivity();
       
        ChildRelation childRelation = this.getParticipantSbb();
        try {
            logger.info("Joining crickets: " + CRICKETS);           
            List cricketVoice = new ArrayList();
            cricketVoice.add(CRICKETS);
            Announcement crickets = (Announcement) childRelation.create();
            connectionActivity.attach(crickets);
            crickets.play(endpointName, cricketVoice, true);
                       
            logger.info("Joining mocking: " + MOCKING);
            List mockingVoice = new ArrayList();
            mockingVoice.add(MOCKING);
            Announcement mocking = (Announcement) childRelation.create();
            connectionActivity.attach(mocking);
           
            mocking.play(endpointName, mockingVoice, true);
           
//            logger.info("Joining cuckoo: " + CUCKOO);
//            Announcement cuckoo = (Announcement) childRelation.create();
View Full Code Here


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

      ChildRelation relation = getCallControlSbbChild();
      // Create child SBB
      CallControlSbbLocalObject child = (CallControlSbbLocalObject) relation
          .create();

      setChildSbbLocalObject(child);

      child.setParent(getSbbContext().getSbbLocalObject());

      // Attach child SBB to the activity context
      sipACI.attach(child);
      clientSipACI.attach(child);
      sipACI.attach(this.getSbbContext().getSbbLocalObject());
      // Send the INVITE request
      ct.sendRequest();

    } catch (ParseException parExc) {
View Full Code Here

    MsSignalGenerator generator = msProvider.getSignalGenerator(this
        .getAnnouncementEndpointName());

    try {
      ActivityContextInterface generatorActivity = mediaAcif
          .getActivityContextInterface(generator);
      generatorActivity.attach(getSbbContext().getSbbLocalObject());

      generator.apply(Announcement.PLAY, new String[] { audioFile });

      // this.initDtmfDetector(getConnection(), this.getEndpointName());
    } catch (UnrecognizedActivityException e) {
View Full Code Here

    MsSignalGenerator generator = msProvider
        .getSignalGenerator(announcementEndpoint);

    try {
      ActivityContextInterface generatorActivity = mediaAcif
          .getActivityContextInterface(generator);
      generatorActivity.attach(getSbbContext().getSbbLocalObject());

      String announcementFile = "file:" + audioFilePath;
      generator.apply(Announcement.PLAY,
          new String[] { announcementFile });
View Full Code Here

  private void initDtmfDetector(MsConnection connection, String endpointName) {
    MsSignalDetector dtmfDetector = msProvider
        .getSignalDetector(endpointName);
    try {
      ActivityContextInterface dtmfAci = mediaAcif
          .getActivityContextInterface(dtmfDetector);
      dtmfAci.attach(getSbbContext().getSbbLocalObject());
      dtmfDetector.receive(Basic.DTMF, connection, new String[] {});
    } catch (UnrecognizedActivityException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

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

      try {
        ActivityContextInterface sipACI = activityContextInterfaceFactory
            .getActivityContextInterface(dialog);
        sipACI.attach(sbbLocalObject);
        sipACI.attach(this.getParentCmp());
      } catch (UnrecognizedActivityException aci) {
        aci.printStackTrace();
      }

      cache.put(calleeCallIdNew, sa);

    }

    final String callId = dialog.getCallId().getCallId();

    if (log.isDebugEnabled()) {
      log
          .debug("Obtained dialog from ClientTransaction in sendRequestWithAuthorizationHeader "
              + " : dialog callId = " + callId);
    }
    // Store the client transaction in the cache
    // since we may need to send a cancel request associated with this
    // ClientTransaction later.
    setToBeCancelledClientTransaction(ct);

    // Store the dialog in the cache with the associated call id of the new
    // transaction.
    setDialog(dialog, callId);

    // Since we are about the send the request in a new client transaction,
    // we need to
    // attach it to the new activity context in order to receive the
    // following events.
    // We start this by getting the activity context
    ActivityContextInterface ac = null;
    try {
      ac = activityContextInterfaceFactory
          .getActivityContextInterface(ct);
    } catch (FactoryException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (NullPointerException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (UnrecognizedActivityException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    // Attach our local interface to the new ActivityContextInterface
    // This makes this Sbb receive responses to the request
    ac.attach(sbbLocalObject);

    // Finally, send the request!
    try {
      ct.sendRequest();
    } catch (SipException e) {
View Full Code Here

      }

      // Let us attach sbbLocalObject to Dialog to receive Bye latter
      try {

        ActivityContextInterface daci = activityContextInterfaceFactory
            .getActivityContextInterface(currentDialog);
        daci.attach(sbbContext.getSbbLocalObject());
      } catch (Exception e) {
        e.printStackTrace();
      }

      String sdp = new String(event.getResponse().getRawContent());

      log.debug("BeforeCalleeConfirmedState.handleOK sdpOffer = " + sdp);

      MsSession session = msProvider.createSession();
      MsConnection msConnection = session
          .createNetworkConnection(ENDPOINT_NAME);

      try {
        ActivityContextInterface aci = mediaAcif
            .getActivityContextInterface(msConnection);
        aci.attach(sbbContext.getSbbLocalObject());
        aci.attach(getParentCmp());
      } catch (Exception e) {
        e.printStackTrace();
      }

      log.info("Creating RTP connection [" + ENDPOINT_NAME + "]");
View Full Code Here

      e.printStackTrace();
    }
    MsSession session = connection.getSession();
    MsLink link = session.createLink(MsLink.MODE_FULL_DUPLEX);

    ActivityContextInterface linkActivity = null;
    try {
      linkActivity = mediaAcif.getActivityContextInterface(link);
    } catch (UnrecognizedActivityException ex) {
      ex.printStackTrace();
    }

    linkActivity.attach(getParentCmp());

    link.join(connection.getEndpoint(), ANNOUNCEMENT_ENDPOINT);
  }
View Full Code Here

    }
    // Get a client transaction and corresponding activity context interface
    // Attach ourselves to receive responses and finally send the request
    try {
      ClientTransaction ct = sipProvider.getNewClientTransaction(request);
      ActivityContextInterface acIntf = activityContextInterfaceFactory
          .getActivityContextInterface(ct);
      SbbLocalObject mySelf = sbbContext.getSbbLocalObject();
      acIntf.attach(mySelf);
      dialog.sendRequest(ct);
    } catch (Exception e) { // This catches no less than 10 distinct
      // exception types...
      log.error("Exception in sendrequest", e);
      throw new SipException(
View Full Code Here

    MsSignalGenerator generator = msProvider
        .getSignalGenerator(announcementEndpoint);

    try {
      ActivityContextInterface generatorActivity = mediaAcif
          .getActivityContextInterface(generator);
      generatorActivity.attach(getSbbContext().getSbbLocalObject());

      String announcementFile = "file:" + this.getAudioFile();
      generator.apply(Announcement.PLAY,
          new String[] { announcementFile });
View Full Code Here

TOP

Related Classes of javax.slee.ActivityContextInterface

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.