AudioGroupSetup audioGroupSetup = new AudioGroupSetup();
audioGroupSetup.spatializer = new FullVolumeSpatializer();
audioGroup = vm.createAudioGroup(audioGroupId, audioGroupSetup);
audioGroup.addPlayer(externalPlayer,
new AudioGroupPlayerInfo(true,
AudioGroupPlayerInfo.ChatType.EXCLUSIVE));
audioGroup.addPlayer(softphonePlayer,
new AudioGroupPlayerInfo(true,
AudioGroupPlayerInfo.ChatType.EXCLUSIVE));
} else {
AudioGroup defaultLivePlayerAudioGroup =
parameters.livePlayerAudioGroup;
defaultLivePlayerAudioGroup.addPlayer(externalPlayer,
new AudioGroupPlayerInfo(true,
AudioGroupPlayerInfo.ChatType.PUBLIC));
AudioGroup defaultStationaryPlayerAudioGroup =
parameters.stationaryPlayerAudioGroup;
defaultStationaryPlayerAudioGroup.addPlayer(externalPlayer,
new AudioGroupPlayerInfo(false,
AudioGroupPlayerInfo.ChatType.PUBLIC));
}
logger.fine("done with audio groups");
}
if (externalCall != null) {
externalCallID = externalCall.getId();
}
logger.fine("Setting actual call id to " + externalCallID);
listing.setExternalCallID(externalCallID); // set actual call Id
//Check implicit privacy settings
if (listing.isPrivate()) {
/** HARRISNOTE: We need our client name later in order to
* setup private spatializers. But because we didn't know
* our proper client name in the PhoneCell, we update the
* callListing now that we do.
**/
listing.setPrivateClientName(externalCallID);
/*
* Set the call audio to whisper mode until the caller
* chooses to join the call.
*/
if (listing.simulateCalls() == false) {
//Mute the two participants to the outside world
logger.fine("attenuate other groups");
softphonePlayer.attenuateOtherGroups(audioGroup, 0, 0);
logger.fine("back from attenuate other groups");
}
} else {
Vector3f center = new Vector3f();
phoneCellMO.getWorldBounds().getCenter(center);
center.setY((float).5);
new Orb(listing.getContactName(), listing.getContactName(),
externalCallID, center, .1, listing.simulateCalls());
}
if (listing.simulateCalls() == false) {
//Place the calls audio at the phones position
Vector3f location = new Vector3f();
location = phoneCellMO.getWorldTransform(null).getTranslation(location);
externalPlayer.moved(location.x, location.y, location.z, 0);
}
/*
* Send PLACE_CALL_RESPONSE message back to all the clients
* to signal success.
*/
sender.send(clientID, new PlaceCallResponseMessage(
phoneCellMO.getCellID(), listing, true));
logger.fine("back from notifying user");
return;
}
if (msg instanceof JoinCallMessage) {
//Our phone cell wants us to join the call into the world.
if (listing.simulateCalls() == false) {
//Stop any current ringing.
try {
softphoneCall.stopTreatment("ring_tone.au");
} catch (IOException e) {
logger.fine("Unable to stop treatment to " + softphoneCall + ": "
+ e.getMessage());
}
AudioGroup defaultLivePlayerAudioGroup = parameters.livePlayerAudioGroup;
defaultLivePlayerAudioGroup.addPlayer(externalPlayer,
new AudioGroupPlayerInfo(true,
AudioGroupPlayerInfo.ChatType.PUBLIC));
AudioGroup defaultStationaryPlayerAudioGroup = parameters.stationaryPlayerAudioGroup;
defaultStationaryPlayerAudioGroup.addPlayer(externalPlayer,
new AudioGroupPlayerInfo(false,
AudioGroupPlayerInfo.ChatType.PUBLIC));
softphonePlayer.attenuateOtherGroups(audioGroup,
AudioGroup.DEFAULT_SPEAKING_ATTENUATION,
AudioGroup.DEFAULT_LISTEN_ATTENUATION);