Package org.jdesktop.wonderland.modules.audiomanager.common.messages

Examples of org.jdesktop.wonderland.modules.audiomanager.common.messages.TransferCallRequestMessage


            return;
        }

        if (message instanceof TransferCallRequestMessage) {
            TransferCallRequestMessage msg = (TransferCallRequestMessage) message;

            String callID = msg.getPresenceInfo().getCallID();

            Call call = vm.getCall(callID);

            if (call == null) {
                if (msg.getCancel() == true) {
                    return;
                }

                double x = 0;
                double y = 0;
                double z = 0;
                double orientation = 0;

                Player player = vm.getPlayer(callID);

                if (player != null) {
                    x = -player.getX();
                    y = player.getY();
                    z = player.getZ();
                    orientation = player.getOrientation();
                }

                placeCall(clientID, new PlaceCallRequestMessage(msg.getPresenceInfo(),
        msg.getPhoneNumber(), x, y, z, orientation, true));
                return;
            }

            CallParticipant cp = call.getSetup().cp;

            if (msg.getCancel() == true) {
                try {
                    call.transfer(cp, true);
                } catch (IOException e) {
                    logger.warning("Unable to cancel call transfer:  " + e.getMessage());
                }
                return;
            }

            if (msg.getPhoneNumber().equals(cp.getPhoneNumber())) {
    sender.send(clientID, new CallMigrateMessage(msg.getPresenceInfo().getCallID(), true));
                return;
            }

            cp.setPhoneNumber(msg.getPhoneNumber());

            setJoinConfirmation(cp);

            try {
                call.transfer(cp, false);
            } catch (IOException e) {
                logger.warning("Unable to transfer call:  " + e.getMessage());
            }
            return;
        }

  if (message instanceof AudioVolumeMessage) {
      handleAudioVolume(sender, clientID, (AudioVolumeMessage) message);
      return;
  }

  if (message instanceof ChangeUsernameAliasMessage) {
      sender.send(message);
      return;
  }

        if (message instanceof VoiceChatMessage) {
            VoiceChatHandler.getInstance().processVoiceChatMessage(sender, clientID,
                    (VoiceChatMessage) message);
            return;
        }

        if (message instanceof PlayTreatmentRequestMessage) {
            PlayTreatmentRequestMessage msg = (PlayTreatmentRequestMessage) message;

            Call call = vm.getCall(msg.getCallID());

            if (call == null) {
                logger.warning("No call for " + msg.getCallID());
                return;
            }

            try {
                call.playTreatment(msg.getTreatment());
            } catch (IOException e) {
                logger.warning("Unable to play treatment " + msg.getTreatment()
        + " to call " + call + ": " + e.getMessage());
            }
            return;
        }
View Full Code Here


             
        vuMeterComponent.setVisible(true);
    }

    public void transferCall(String phoneNumber) {
        sendMessage(new TransferCallRequestMessage(presenceInfo, phoneNumber, false));
    }
View Full Code Here

    public void transferCall(String phoneNumber) {
        sendMessage(new TransferCallRequestMessage(presenceInfo, phoneNumber, false));
    }

    public void cancelCallTransfer() {
        sendMessage(new TransferCallRequestMessage(presenceInfo, "", true));
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.audiomanager.common.messages.TransferCallRequestMessage

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.