Author Message
dkalinasch
Joined: May 16, 2019
Messages: 35
Offline
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
SuzhenLi
Joined: Nov 14, 2019
Messages: 4
Offline
Hi,
can you post the asm and snapin logs?
steps:
1.ce dlogon
2. ce dlogon <snapin>)
3. run your test
4. get asm log and snapin logs

when and how does the snapin invoke stopPlayback(..)?
SuzhenLi
Joined: Nov 14, 2019
Messages: 4
Offline
hi,

look like you have two nodes. sometimes the play on node1, sometimes it on node2

try this:
public void stopPlayback(Call call)
{
if (com.avaya.collaboration.call.CallProperties.isHostedOnLocalNode(call))
{
// do current what you have
}
else {
remote_node_ip=com.avaya.collaboration.call.CallProperties.getNodeThatHostsCall(call)
// send 302 (redirect ) response with remote_node_ip to API
// THUS API need to resend the stop play request to remote_node_ip
}
dkalinasch
Joined: May 16, 2019
Messages: 35
Offline
Hi,

thanks for your reply.

I have changed the stop playback handling like the following


public void stopPlayback(Call call) {
UUID uuid = (UUID) call.getAttribute(UUID_KEY);
logger.info(format("UCID %s - Stopping media with uuid %s", call.getUCID(), uuid));

breezeFactoryWrapper
.getMediaService() // com.avaya.collaboration.call.media.MediaService;
.stop(call, uuid);
}


If i am stopping the playback for a call and not per participant, the error does not occur anymore.

Kind regards,
Domenic
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
Just to be clear, I think you're still having problems with stopping the media on a participant rather than on a call, is that right? To be honest, I'm surprised that you're not still having problems even with media on a call. The problem is that Breeze doesn't support cross-server media invocations. If a call lands on server A in a 2 server cluster, than a HTTP request comes into server B to perform some media action on that same call, the invocation will fail. You need to either redirect the incoming HTTP request to the server A (doing something like Suzhen suggested), or you need to have your snap-in on server B ask its server A instance to perform the action.
dkalinasch
Joined: May 16, 2019
Messages: 35
Offline
Hi Joel,

your assumption was correct. After changing the code we tested the snapin with few calls, they all were successfull. But know there are much more calls on the system and error occurs again.
So i will implement the suggested solution from Suzhen.

Thanks to both of you.

Kind regards,
Domenic
dkalinasch
Joined: May 16, 2019
Messages: 35
Offline
Hi,

after changing the code to check if the current host is responsible, and maybe forward to call to the responsible host i receive the following error:

GS-LRMI Connection-pool-1-thread-3]
remote.CallCommandProcessorImpl
ERROR - processRequest could not process callCommand=GETIPADDRESSFAMILYFROMCALL
exception=java.lang.IllegalArgumentException: Cannot get IPAddressFamilly for IpAddress 127.0.0.2:15060

What is the cause for this error?

I am using the Breeze SDK Version 3.2.0.1

The breeze server is running the version 3.6.0.2.360203

This is code:

public void transferCall(String ucid, String targetNumber) {
Call call = breezeFactoryWrapper.getCall(ucid);

if (callPropertyWrapper.isHostedOnLocalNode(call)) {
executeTransfer(call, targetNumber);
} else {
String nodeName = callPropertyWrapper.getNodeThatHostsCall(call);
restService.forwardTransferRequest(nodeName, ucid, targetNumber);
}
}


Kind regards,
Domenic
Go to:   
Mobile view