Hello,
i created a callable snapin, that is playing an audio file to the calling party.
private void play(Call call, MediaListener mediaListener, PlayItem playItem) {
UUID uuid = breezeFactoryWrapper.getMediaService()
.play(call.getCallingParty(), playItem, mediaListener);
logger.info(format("Playing %s announcement for call with ucid %s ", uuid.toString(), call.getUCID()));
call.setAttribute(UUID_KEY, uuid);
}
The playback works fine.
If i try to stop the playback i sometimes (50% fails, 50% works) receive the following error message
java.lang.IllegalArgumentException: Invalid Call type received ProxyCall
at com.avaya.collaboration.call.media.MediaServiceImpl.getCallData(MediaServiceImpl.java:385)
at com.avaya.collaboration.call.media.MediaServiceImpl.stop(MediaServiceImpl.java:329)
at mypackage.BreezeFactoryWrapper.stopPlay(BreezeFactoryWrapper.java:35)
Thjs is the code to stop the playback:
public void stopPlayback(Call call) {
UUID uuid = (UUID) call.getAttribute(UUID_KEY);
logger.info(format("UCID %s - UUID %s to stop", call.getUCID(), uuid));
List<Participant> activeParties = call.getActiveParties();
for (Participant participant : activeParties) {
logger.fine(format("UCID %s - Stopping media for %s", call.getUCID(), participant.getHandle()));
breezeFactoryWrapper.stopPlay(participant, uuid);
}
}
Any idea why stopping the playback fails sometimes?
Kind regards,
Domenic