Package com.sun.mpk20.voicelib.app

Examples of com.sun.mpk20.voicelib.app.Call


            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);
View Full Code Here


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

        Player p = vm.getPlayer(callID);

        Call call;

        call = vm.createCall(callID, setup);

        callID = call.getId();

        PlayerSetup ps = new PlayerSetup();

        if (p == null) {
            ps.x = x;
            ps.y = y;
            ps.z = z;
        } else {
            ps.x = p.getSetup().x;
            ps.y = p.getSetup().y;
            ps.z = p.getSetup().z;
        }

        ps.orientation = direction;
        ps.isLivePlayer = true;

        Player player = null;
        if(p==null) {
            player = vm.createPlayer(callID, ps);
        } else {
            player = p;
        }

        call.setPlayer(player);
        player.setCall(call);

        vm.getVoiceManagerParameters().livePlayerAudioGroup.addPlayer(player,
                new AudioGroupPlayerInfo(true, AudioGroupPlayerInfo.ChatType.PUBLIC));
View Full Code Here

        sessionCallIDMapRef.get().remove(sessionID);

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

        Call call = vm.getCall(callID);

        if (call == null) {
            logger.fine("Can't find call for " + callID);

            Player player = vm.getPlayer(callID);
View Full Code Here

  vm.dump("all");
    }

    private void endTreatment(Treatment treatment) {
  Call call = treatment.getCall();
 
  if (call == null) {
      logger.warning("No call for treatment " + treatment);
      return;
  }

  //System.out.println("Ending call for treatment " + treatment);

  try {
      call.end(false);
  } catch (IOException e) {
      logger.warning("Unable to end call " + call + ":  " + e.getMessage());
  }
    }
View Full Code Here

      if (id == null) {
    logger.warning("No WonderlandClientID for " + info);
    continue;
      }

      Call call = player.getCall();

      if (call != null) {
    try {
        call.playTreatment("audioGroupInvite.au");
    } catch (IOException e) {
        logger.warning("Unable to play audioGroupInvite.au:  "
      + e.getMessage());
    }
      }
View Full Code Here

  }
    }

    private void stopRinging(VoiceManager vm) {
        //Stop the ringing
  Call softphoneCall = vm.getCall(presenceInfo.getCallID());

  if (softphoneCall != null) {
      try {
                softphoneCall.stopTreatment("ring_tone.au");
      } catch (IOException e) {
    logger.warning("Unable to stop treatment " + softphoneCall + ":  "
        + e.getMessage());
      }
  }
View Full Code Here

        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);
View Full Code Here

      phoneCellMO.getCellID(), listing, false,
      "Softphone is not connected!"));
        return;
          }

    CallSetup setup = new CallSetup();
 
    CallParticipant cp = new CallParticipant();

    setup.cp = cp;
View Full Code Here

  /*
   * New incoming call
   */
  VoiceManager vm = AppContext.getManager(VoiceManager.class);
 
  CallSetup setup = new CallSetup();
  setup.incomingCall = true;

  setup.cp = new CallParticipant()
  setup.cp.setCallId(callId);
  setup.cp.setConferenceId(vm.getVoiceManagerParameters().conferenceId);
View Full Code Here

        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;
View Full Code Here

TOP

Related Classes of com.sun.mpk20.voicelib.app.Call

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.