Package org.jdesktop.wonderland.modules.presencemanager.common

Examples of org.jdesktop.wonderland.modules.presencemanager.common.PresenceInfo


            callMigrationForm.setStatus("Migration failed");
        }
    }

    private void callMuted(CallMutedMessage msg) {
        PresenceInfo info = pm.getPresenceInfo(msg.getCallID());

        if (info == null) {
            logger.fine("No presence info for " + msg.getCallID());
            return;
        }

        pm.setMute(info, msg.isMuted());

        AvatarNameEvent avatarNameEvent;

        if (msg.isMuted()) {
            avatarNameEvent = new AvatarNameEvent(EventType.MUTE,
                    info.getUserID().getUsername(), info.getUsernameAlias());
        } else {
            avatarNameEvent = new AvatarNameEvent(EventType.UNMUTE,
                    info.getUserID().getUsername(), info.getUsernameAlias());
        }

        InputManager.inputManager().postEvent(avatarNameEvent);
    }
View Full Code Here


        InputManager.inputManager().postEvent(avatarNameEvent);
    }

    private void callSpeaking(CallSpeakingMessage msg) {
        PresenceInfo info = pm.getPresenceInfo(msg.getCallID());

        if (info == null) {
            // Issue #1113: ignore this error
            logger.fine("No presence info for " + msg.getCallID());
            return;
        }

        logger.fine("Speaking " + msg.isSpeaking() + " " + info);

        pm.setSpeaking(info, msg.isSpeaking());

        AvatarNameEvent avatarNameEvent;

        if (msg.isSpeaking()) {
            avatarNameEvent = new AvatarNameEvent(EventType.STARTED_SPEAKING,
                    info.getUserID().getUsername(), info.getUsernameAlias());
        } else {
            avatarNameEvent = new AvatarNameEvent(EventType.STOPPED_SPEAKING,
                    info.getUserID().getUsername(), info.getUsernameAlias());
        }

        InputManager.inputManager().postEvent(avatarNameEvent);
    }
View Full Code Here

        return reason;
    }

    private void callEnded(CallEndedMessage msg) {
        PresenceInfo info = pm.getPresenceInfo(msg.getCallID());

        if (info != null && info.getClientID() == null) {
            pm.removeLocalPresenceInfo(info)// it's an outworlder
        }

        String callID = msg.getCallID();
View Full Code Here

        String playerInRangeID = message.getPlayerInRangeID();
        boolean inRange = message.isInRange();
        logger.info("Player in range " + inRange + " " +
                playerID + " player in range " + playerInRangeID);

        PresenceInfo info = pm.getPresenceInfo(playerID);

        if (info == null) {
            logger.info("No PresenceInfo for " + playerID);
            return;
        }

        PresenceInfo userInRangeInfo = pm.getPresenceInfo(playerInRangeID);

        if (userInRangeInfo == null) {
            logger.info("No PresenceInfo for user in range " + playerInRangeID);
            return;
        }
View Full Code Here

        notifyUserInRangeListeners(info, userInRangeInfo, inRange);
        return;
    }

    private void transientMemberAdded(VoiceChatTransientMemberMessage message) {
        PresenceInfo info = pm.getPresenceInfo(message.getCallID());

        if (info == null) {
            logger.warning("No presence info for callID " + message.getCallID());
            return;
        }
View Full Code Here

  VoiceManager vm = AppContext.getManager(VoiceManager.class);

  String group = message.getGroup();

  PresenceInfo callee = message.getCallee();

  String externalCallID = group + "-" + callNumber++;

        callee = new PresenceInfo(callee.getCellID(), callee.getClientID(),
                                  callee.getUserID(), externalCallID);

  String softphoneCallID = message.getSoftphoneCallID();

  Call softphoneCall = vm.getCall(softphoneCallID);

  Player softphonePlayer = null;

  if (softphoneCall != null) {
      softphonePlayer = softphoneCall.getPlayer();
  }
       
   if (softphonePlayer == null) {
      logger.warning("Softphone player is not connected!");
            sender.send(clientID, new VoiceChatCallEndedMessage(
          group, callee, "Softphone is not connected!"));
      return;
  }

  logger.fine("EXTERNAL CALLID IS " + externalCallID + " "
      + " softphone callID " + softphoneCallID + " softphone call "
      + softphoneCall + " softphone player " + softphonePlayer);

  logger.fine("Got place call message " + externalCallID);

  PlayerSetup playerSetup = new PlayerSetup();
  playerSetup.x = softphonePlayer.getX();
  playerSetup.y = 1.5;
  playerSetup.z = softphonePlayer.getZ();
  playerSetup.isOutworlder = true;
  playerSetup.isLivePlayer = true;

  CallSetup setup = new CallSetup();
 
  setup.externalOutgoingCall = true;

  CallParticipant cp = new CallParticipant();

  setup.cp = cp;

  try {
      setup.bridgeInfo = vm.getVoiceBridge();
  } catch (IOException e) {
      logger.warning("Unable to get voice bridge for call " + cp + ":  "
    + e.getMessage());
            sender.send(clientID, new VoiceChatCallEndedMessage(
          group, callee, "No voice bridge available!"));
      return;
  }

  AudioGroup audioGroup = vm.getAudioGroup(group);

  if (audioGroup == null) {
      logger.warning("No audio group " + group);
            sender.send(clientID, new VoiceChatCallEndedMessage(
          group, callee, "Audio group not found!"));
      return;
  }

  cp.setPhoneNumber(message.getPhoneNumber());
  cp.setName(callee.getUsernameAlias());
  cp.setCallId(externalCallID);
  cp.setConferenceId(vm.getVoiceManagerParameters().conferenceId);
  cp.setVoiceDetection(true);
  cp.setDtmfDetection(true);
  cp.setVoiceDetectionWhileMuted(true);
  cp.setHandleSessionProgress(true);

  new VoiceChatPhoneStatusListener(group, callee, externalCallID, clientID);
 
  Call externalCall;

  try {
            externalCall = vm.createCall(externalCallID, setup);
  } catch (IOException e) {
      logger.warning("Unable to create call " + cp + ":  "
    + e.getMessage());
            sender.send(clientID, new VoiceChatCallEndedMessage(
          group, callee, "Can't create call!"));
      return;
  }

  Player externalPlayer = vm.createPlayer(externalCallID, playerSetup);

  externalCall.setPlayer(externalPlayer);

  externalPlayer.setCall(externalCall);

        callee = new PresenceInfo(null, null, callee.getUserID(), externalCallID);

  VoiceChatHandler.getInstance().addPlayerToAudioGroup(audioGroup,
      externalPlayer, callee, message.getChatType());

  //if (message.getChatType() == ChatType.PUBLIC) {
View Full Code Here

    }

    private static final String JOIN_SOUND = "joinBELL.au";

    private void placeCall(WonderlandClientID clientID, PlaceCallRequestMessage msg) {
        PresenceInfo info = msg.getPresenceInfo();

        CellMO cellMO = CellManagerMO.getCellManager().getCell(info.getCellID());

        AudioParticipantComponentMO audioParticipantComponentMO =
                cellMO.getComponent(AudioParticipantComponentMO.class);

        if (audioParticipantComponentMO == null) {
            logger.warning("Cell " + cellMO.getCellID() + " doesn't have an AudioParticipantComponent!");
            return;
        }

        CallSetup setup = new CallSetup();

        CallParticipant cp = new CallParticipant();

        setup.cp = cp;

        String callID = info.getCallID();

        if (callID == null) {
            logger.fine("Can't place call to " + msg.getSipURL() + ".  No cell for " + callID);
            return;
        }

        VoiceManager vm = AppContext.getManager(VoiceManager.class);

  Call call = vm.getCall(callID);

  if (call != null) {
      call.getSetup().ended = true// make it look like it ended already
  }
 
  ScalableHashMap<String, ManagedReference<AudioCallStatusListener>> callIDListenerMap = callIDListenerMapRef.get();

  ManagedReference<AudioCallStatusListener> audioCallStatusListenerRef = callIDListenerMap.remove(callID);

  if (audioCallStatusListenerRef != null) {
      audioCallStatusListenerRef.get().done();
  }

        AudioCallStatusListener audioCallStatusListener = new AudioCallStatusListener(clientID, callID);

  audioCallStatusListenerRef = AppContext.getDataManager().createReference(audioCallStatusListener);

  callIDListenerMap.put(callID, audioCallStatusListenerRef);

        cp.setCallId(callID);
        cp.setName(info.getUserID().getUsername());
        cp.setPhoneNumber(msg.getSipURL());

        setJoinConfirmation(cp);

  cp.setCallEstablishedTreatment(JOIN_SOUND);
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.presencemanager.common.PresenceInfo

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.