Avaya Client SDK

< Back to Package Overview

Using the Call Log Service

The call log service API provides history entries for calls that have been made or received on the client. Both Local Call logs and PPM Call logs are supported. Local call logs do not record events when a user is logged off, and no call logs will be captured. PPM call logs will record network calls when the user is logged in or logged out. Each call record is represented by the CallLogItem object. This object provides several attributes such as call start time, remote address, call duration, etc.

Initializing and Configuring the CallLogService

The Client SDK provides call log services through the CallLogService interface. This interface is implemented by the CallLogServiceImpl object and is exposed to the binding layer.

First, set full path to the call log file via the SetLocalCallLogFilePath() method of your UserConfiguration object. If an invalid path is provided, the call log items will not persist. They will be updated in the cache during runtime only. The path should be unique for each user logging in on the client.

string LocalCallLogFilePath = callLogRecordFilePath + userConfig.username;

userConfig.SetLocalCallLogFilePath(StringToSTLString(LocalCallLogFilePath));

The UserConfiguration object is used to define the services that are available to the end users of your application. Each service is configured individually.

Note: See more information on service configuration in the article Configuring the SDK.

The CallLogService object is obtained from the Client SDK User object. Start by obtaining the instance of the Client SDK CallLogService. To monitor call log events, you need to add event handlers.

public void AddCallLogServiceEvents(CallLogService callLogservice)
{
    callLogservice.CallLogsAdded += CallLogsAdded;
    callLogservice.CallLogsLoaded += CallLogsLoaded;
    callLogservice.CallLogsRemoved += CallLogsRemoved;
    callLogservice.CallLogsUpdated += CallLogsUpdated;
}

public void RemoveCallLogServiceEvents(CallLogService callLogservice)
{
    callLogservice.CallLogsAdded -= CallLogsAdded;
    callLogservice.CallLogsLoaded -= CallLogsLoaded;
    callLogservice.CallLogsRemoved -= CallLogsRemoved;
    callLogservice.CallLogsUpdated -= CallLogsUpdated;
}

//Event handlers related to Call Log Service 

public void CallLogsLoaded(object sender, CallLogServiceEventArgs e)
{
    CallLogManager calllogmgr = CallLogManager.GetInstance();
    calllogmgr.GetCallLog();
}

...

/// Retrieves the local call logs and resynchronize callLog items
public void GetCallLog()
{
    CallLogService.CallLogActionCompletionHandler callLogCompletionHandler 
        = CallLogDelegate;
    CallLogServiceInstance.ResynchronizeCallLogItems(callLogCompletionHandler);
    CallLogItem = CallLogServiceInstance.CallLogs.Reverse();    
}

Configuring the CallLogService to use PPM Call Logs

The Client SDK provide configuration through the PpmConfiguration object to enable and disable PPM Call Logs. PPM Call Logs require PPM Call Journaling to be enabled on the Aura network, and if not enabled on Aura network then local call logs will be provided by the Client SDK.

Adding new call log items

If any new call log items have been added, your application will be notified via CallLogsAdded event.

public void CallLogsAdded(object sender, CallLogServiceEventArgs e)
{
    CallLogManager calllogmgr = CallLogManager.GetInstance();
    calllogmgr.GetCallLog();
}

Removing call log items

The CallLogsRemoved event is used to report removal of call log items. This event indicates that one or more call log items have been successfully removed.

public void CallLogsRemoved(object sender, CallLogServiceEventArgs e)
{
    CallLogManager calllogmgr = CallLogManager.GetInstance();
    calllogmgr.GetCallLog();
}

Updating call log items

The CallLogsUpdated event is used to indicate which call log items have been updated. This event can be used to indicate the update of one or more call log items.

public void CallLogsUpdated(object sender, CallLogServiceEventArgs e)
{
    CallLogManager calllogmgr = CallLogManager.GetInstance();
    calllogmgr.GetCallLog();
}

Creating call logs from specified parameters

Instead of creating a new call log due to call ending, you can create call logs immediately at any moment using specified parameters. Then you can add new items using the AddCallLogItems() method.

CallLogItem callLogItemToAdd = new CallLogItem(remoteNumber
    , localUserName
    , sessionSubject
    , startDateTime
    , endDateTime
    , durationInSeconds
    , (CallLogItemSourceType)sourceType
    , (CallLogItemActionType)actionType
    , false
    , false
    , false
    , remoteParticipants
    , callEvents
    , properties);

List callLogItemsToAdd = new List();

callLogItemsToAdd.Add(callLogItemToAdd);
callLogService.AddCallLogItems(new CallLogOperationData(callLogItemsToAdd), 
    callLog_CallLogAddingCompleted);

Call records and call events

A CallRecord instance is associated with the API level CallLogItem instance. The CallRecord object is a data-only object with no actionable methods on it. CallLogItem contains a CallRecord and uses it internally. But it also exposes its own methods to access to the data stored in the corresponding CCallRecord instance. In addition, CallLogItem provides supplementary details such as associated contact info, that are not available to CallRecord.

Call log data is only useful to the client if it is capable of providing a full historical view of the call. To achieve this goal, a call log object must be able to convey all transactions associated with the call from the point it is dialed out to the point it is ended. For example, a call that is created as a point-to-point call, does not necessarily end as a point-to-point call. Such call may be escalated to a CM conference as the 3rd endpoint joined the call. Then it may be de-escalated back to a point-to-point call when one of three people on the CM conference left the call. To facilitate complex transitions of a call, the Call object keeps track of events that mark call transition points.

In the Client SDK, these events are captured in the call event list as independent call event items. When a call is ended, CallLogService takes this call event list and processes it onto the CallLogItem type objects. The very first call event received from the Call object is captured as the top level call log dataset. Subsequent call events are captured in the call events list contained in CallLogItem.

To obtain a full historical view of the call, you can use the GetCallEvents() method of the CallLogItem object.