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

Examples of org.jdesktop.wonderland.modules.phone.common.messages.CallEndedResponseMessage


  });
    }

    public void processMessage(final PhoneResponseMessage message) {
  if (message instanceof CallEndedResponseMessage) {
      final CallEndedResponseMessage msg = (CallEndedResponseMessage) message;

            if (msg.wasSuccessful() == false) {   
                LOGGER.warning("Failed:  " + msg.getReasonCallEnded());
      }

            CallListing listing = msg.getCallListing();
       
            if (mostRecentCallListing == null ||
        listing.equals(mostRecentCallListing) == false) {

    return;
      }

            if (mostRecentCallListing.isPrivate()) {
    //This was a private call...
                //ChannelController.getController().getLocalUser().getAvatarCell().setUserWhispering(false);
            }

            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
        if (phoneForm != null) {
                        phoneForm.setCallEnded(msg.getReasonCallEnded());
        }
                }
            });

      return;
  }

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

      if (phoneForm != null) {
          phoneForm.changeLocked(msg.getLocked(), msg.wasSuccessful());
      }
      return;
  }

  if (message instanceof PhoneResponseMessage == false) {
      LOGGER.warning("Invalid message:  " + message);
      return;
  }

  PhoneResponseMessage msg = (PhoneResponseMessage) message;

        CallListing listing = msg.getCallListing();

  if (msg instanceof PlaceCallResponseMessage) {
      LOGGER.fine("Got place call response...");

            if (msg.wasSuccessful() == false) {
                LOGGER.warning("Failed PLACE_CALL!");
    return;
      }

            if (mostRecentCallListing == null ||
        listing.equals(mostRecentCallListing) == false) {

    LOGGER.warning("Didn't find listing...");
    return;
      }

      /*
       * Make sure the most recent listing has the right private
       * client name.
       */
      mostRecentCallListing.setPrivateClientName(listing.getPrivateClientName());

      /*
       * Set the call ID used by the server.
       */
      LOGGER.fine("Updating listing with " + listing.getExternalCallID());

      mostRecentCallListing.setExternalCallID(listing.getExternalCallID());

            /*
       * This is a confirmation msg for OUR call.
       * Update the form's selection.                       
       */
            if (listing.isPrivate()) {
                //ChannelController.getController().getLocalUser().getAvatarCell().setUserWhispering(true);
            }
      return;
  }

  if (msg instanceof JoinCallResponseMessage)  {
            //Hearing back from the server means this call has joined the world.
            if (msg.wasSuccessful() == false) {
                LOGGER.warning("Failed JOIN_CALL");
    return;
      }

      if (mostRecentCallListing == null ||
View Full Code Here


                  vm.removeAudioGroup(audioGroup);
        }
    }
            }
               
            sender.send(clientID, new CallEndedResponseMessage(cellID,
    listing, true, status.getOption("Reason")));
            break;
        }
    }
View Full Code Here

      try {
    softphoneCall.playTreatment(m.getTreatment());
      } catch (IOException e) {
    logger.warning("Unable to play treatment to " + softphoneCall + ":  "
        + e.getMessage());
    sender.send(clientID, new CallEndedResponseMessage(
                    phoneCellMO.getCellID(), listing, true, "Softphone is not connected!"));
                return;
      }

      return;
  }

  if (msg instanceof PlaceCallMessage) {
            //Our phone cell is asking us to begin a new call.

      if (listing.simulateCalls() == false) {
    relock(sender);
      }

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

      PlayerSetup playerSetup = new PlayerSetup();
      //playerSetup.x =  translation.x;
      //playerSetup.y =  translation.y;
      //playerSetup.z =  translation.z;
      playerSetup.isOutworlder = true;
      playerSetup.isLivePlayer = true;

            if (listing.simulateCalls() == false) {
          PhoneStatusListener phoneStatusListener =
        new PhoneStatusListener(phoneCellMO, listing, clientID);

          if (softphoneCall == null || softphonePlayer == null) {
        logger.warning("Softphone player is not connected!");
                  sender.send(clientID, new CallEndedResponseMessage(
      phoneCellMO.getCellID(), listing, false,
      "Softphone is not connected!"));
        return;
          }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.phone.common.messages.CallEndedResponseMessage

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.