}
public void messageReceived(final WonderlandClientSender sender,
final WonderlandClientID clientID, final CellMessage message) {
PhoneControlMessage msg = (PhoneControlMessage) message;
logger.fine("got message " + msg);
PhoneCellMO phoneCellMO = (PhoneCellMO) getCell();
if (message instanceof LockUnlockMessage) {
LockUnlockMessage m = (LockUnlockMessage) message;
boolean successful = true;
PhoneInfo phoneInfo = phoneCellMO.getPhoneInfo();
if (m.getPassword() != null) {
String password = System.getProperty("wonderland.phone.password");
if (password == null || password.length() == 0) {
password = phoneInfo.password;
}
successful = m.getPassword().equals(password);
}
if (successful) {
phoneInfo.locked = !phoneInfo.locked;
phoneInfo.keepUnlocked = m.keepUnlocked();
}
logger.fine("locked " + phoneInfo.locked + " successful "
+ successful + " pw " + m.getPassword());
LockUnlockResponseMessage response =
new LockUnlockResponseMessage(phoneCellMO.getCellID(), phoneInfo.locked, successful);
sender.send(response);
return;
}
VoiceManager vm = AppContext.getManager(VoiceManager.class);
CallListing listing = msg.getCallListing();
String externalCallID = getExternalCallID(listing);
Call externalCall = vm.getCall(externalCallID);