Hello!
I have written a JTAPI application that interfaces a CRM system and allows outbound dialing using a fastConnect method call. Up until now, I have basically used the connectionEstablished and connectionDisconnection events to store CALL START and CALL END time. A recent request was made to make the my application's call logging equal to the CDR/Call Accounting Package records (using Microcall) which always seems 2-3 seconds after connectionEstablished START TIME.
In trying to isolate the events needed to capture with JTAPIEX, it appeared that the connectionAlering could be a better place to put my CALL START TIME. The problem is that I don't always see this event come through. (See code snippet, "Alerting event fired.") It just seems to sporadically run the code, and when it does, my records match the calling accounting records. (For both answered and unanswered calls, which is vital to this project.)
Any thoughts on what I might be missing? Any other recommendations on how I can best emulate the call records being sent out to the call accounting software?
Thank you!
Larry
Snippet:
----------------------------------------------------------------------------
private class CCCLAdapter extends CallControlConnectionListenerAdapter {
@Override
public void connectionAlerting(CallControlConnectionEvent arg0) {
final CallControlConnectionEvent event = arg0;
String AvayaDeviceID;
String callingAddress;
String calledAddress;
// 03-30-17
System.out.println("Alerting event fired.");
LucentV5CallInfo lv5CallInfo = (LucentV5CallInfo) event.getCall();
String callUCID = "";
try {
callUCID = lv5CallInfo.getUCID();
try {
PBXCall avayaCall = currentAvayaCalls.get(callUCID);
avayaCall.CallStart = GetPBXTime();
avayaCall.LocalCallStart = GetLocalTime();
currentAvayaCalls.put(callUCID, avayaCall);
// Moved 03-30-17
System.out.println("Max Rings = " + avayaCall.MaxRings);
if (avayaCall.MaxRings > 0) {
AutoHangupThread autoHangupThread = new AutoHangupThread(avayaCall.ExtensionNumber, callUCID, avayaCall.MaxRings);
Thread AutoHangupThread = new Thread(autoHangupThread);
AutoHangupThread.start();
System.out.println("AutoHangupThread launched.");
}
} catch (Exception ex) { }
} catch (Exception e) { }
eventLogWindow.appendCommand("[" + extensionNumber + "] of call from [" + phoneNumber + "]\n",
CommandType.ALERTING, AvayaDeviceID);
}