Author Message
SteVio
Joined: Dec 4, 2013
Messages: 22
Offline
Hello,

I have a new problem with the DMCC - Java API 7.0.0.0.0.288.

The following Senario:

A calls B
B parks A
Our controller sets a monitor for this parked call.

Features.getMonitoringServices().AddCallControlListener(callId, this);

CallId = ConnectionID for the parked call from A

Then

C calls B
B parks C
Our controller sets a monitor for this parked call.

Features.getMonitoringServices().AddCallControlListener(callId, this);

CallId = ConnectionID for the parked call from C

C finish the call while parked
CallCleared is called.
The controller removes the monitor for this call.
Features.getMonitoringServices().RemoveCallControlListener(event.getClearedCall(), this);


A finish the call while parked
CallCleared is not called

In debug I see that the class com.avaya.mvap.svcproxy.MonitoringServicesProxy handles this call.

In the called function, the ConnectionId is required but only checked to null and then not considered further.

It only calls the removeEventListener function.

protected void removeEventListener(EventListener listener, Map<EventListener, List><String>> listenerMap) throws CstaException {

if (listener == null) {
throw new IllegalArgumentException("The listener cannot be null");
} else {
List<String> list = (List)listenerMap.get(listener);
if (list != null && list.size() != 0) {
if (list.size() == 1) {
listenerMap.remove(listener);
}

String monitor = (String)list.remove(0); //This does not remove the correct element.
EventListener listener2 = (EventListener)this.monitorMap.remove(monitor);
if (!listener.equals(listener2)) {
log.warning("Expected " + listener + " found " + listener2);
}

MonitorStop request = MonitorFilters.getMonitorStop(monitor);
this.marshallRequest(request);
if (log.isLoggable(Level.FINE)) {
log.fine("Removed " + listener + ", monitor=" + monitor);
}

} else {
if (log.isLoggable(Level.FINE)) {
log.fine("Can't find listener " + listener + " to remove");
}

}
}
}


There is only one instance of the controller that monitors the parked calls. Therefore a list with several monitors is found in the listenerMap.

List<String> list = (List)listenerMap.get(listener);


Listener here is our controller instance

However, it is not checked which call should not be monitored anymore. It allways removes the first entry of the given monitor instance, not the monitor for the requested call.

String monitor = (String)list.remove(0);


The removed element is here the monitor for the call from A instead of C.

If A finish the call before C it works.

Is this a bug in the API or do I use it wrong?


Greetings

Stefan
MartinFlynn
Joined: Nov 30, 2009
Messages: 1921
Offline
Hi Stefan,

It would seem that an application must instantiate and use a new Listener object for each call (presumably the same applies to Device monitors).

I do not think this is well documented.

Martin

[Edit: original post ended prematurely due to fat fingers]
SteVio
Joined: Dec 4, 2013
Messages: 22
Offline
Hi Martin,

I can not imagine that.

1. Each monitor is stored in a Map<EventListener, List ><String>.
Why is a list of strings behind each EventListener instance? The strings store the CrossRefIds. If only one monitor per instance is allowed, then a map <EventListener, String> would be enough.

2. Why does call the addCallControlListener function not override the existing monitor?
If I call this function two times from the same listener instances there are also 2 CrossRefIds in the list. One for each call.

3. If I remove the monitor points in the same sequence as I've added it works.

4. Why I have to parse the connectionId into the removeCallControlListener when the parameter is not used?


public void removeCallControlListener(ConnectionID connectionId, CallControlListener listener) throws CstaException {
if (connectionId == null) {
throw new CstaException("ConnectionID argument is null, listener not removed");
} else if (listener == null) {
throw new CstaException("CallControlListener argument is null, listener not removed");
} else {
this.removeEventListener(listener, this.callControlListenerMap);
}
}


I will customize the way to use the listener to make it Work with this.

Is the forum read by someone who is also involved in the implementation of the Java DMCC API?

Regards

Stefan
MartinFlynn
Joined: Nov 30, 2009
Messages: 1921
Offline
I do not have access to DMCC client source code and I do not think that anybody else who views this forum does either.

The code that you posted seems to assume that there is only one MonitorID associated with a listener object. I do not know where you got the source code but, assuming it is from the DMCC SDK, I can say that you should use a different listener object for each monitor that you start.

Martin
SteVio
Joined: Dec 4, 2013
Messages: 22
Offline
I change my code to use one listener for each monitor.


The code that you posted seems to assume that there is only one MonitorID associated with a listener object.


As I have already written, behind each listener is a list of Strings which can theoretically have several monitorID's.

I do not know where you got the source code


I get the source code via debugging with IntelliJ to see what happends with my listeners.

assuming it is from the DMCC SDK

It is from the package com.avaya.mvap.svcproxy.MonitoringServicesProxy in proxy.jar Version 7.0.0.0.0.288


However I could find a solution to work around the problem. Maybe this helps other to make not the same mistake.


Thanks for support.

Stefan
Go to:   
Mobile view