
<event event-direction="Receive">
<event-name>CallDisconnected</event-name>
<event-type-ref>
<event-type-name> javax.csapi.cc.jcc.JccConnectionEvent.CONNECTION_DISCONNECTED
</event-type-name>
<event-type-vendor>javax.csapi.cc.jcc</event-type-vendor>
<event-type-version>1.1</event-type-version>
</event-type-ref>
</event>
<event event-direction="Receive">
<event-name>CallFailed</event-name>
<event-type-ref>
<event-type-name> javax.csapi.cc.jcc.JccConnectionEvent.CONNECTION_FAILED
</event-type-name>
<event-type-vendor>javax.csapi.cc.jcc</event-type-vendor>
<event-type-version>1.1</event-type-version>
</event-type-ref>
</event>
When the SBB receives any of them it calls to a private method called
calculateCallDuration
to handle the events and
detach from activity.
private void calculateCallDuration(String cause, JccConnectionEvent event, ActivityContextInterface aci) {
JccConnection connection = event.getConnection();
trace(Level.INFO, "Received " + cause + " event on call from " + connection.getAddress().getName());
long startTime = getStartTime();
long endTime = System.currentTimeMillis();
long duration = endTime - startTime;
int seconds = (int) (duration / 1000);
int millis = (int) (duration % 1000);
String smillis = "00" + String.valueOf(millis);
smillis = smillis.substring(smillis.length() - 3);
trace(Level.INFO, "call duration=" + seconds + "." + smillis + "s");
// detach from activity
aci.detach(context.getSbbLocalObject());
}
This method calculates the call duration subtracting the start call time to the current time, that is stored in a CMP field. The
SBB writes a trace with the call duration.
Open Cloud Rhino 1.4.3 Administration Manual v1.1 167
Comentarios a estos manuales