6.7.2 GetList

GetList retrieves an event from the event log as specified by the input filter. It takes a set of input parameters that define Type and Filter for retrieving information.

The following are the examples for using GetList:

Synchronous

logging_info = logging_handle.call('GetList', {'Type': u'Log',})

Asynchronous

logging_handle.call('GetList', {'Type': u'Log',}, callback=logging_callback)

where, logging_callback is the callback function.

The following table summarizes the specification of GetList:

Interface IDataSource
Description Gets the specified event details from event log.
Response Model Synchronous and asynchronous
Pre-condition IDataSource interface is loaded.
Post-condition Nil

Input Parameters

Input parameter specifies the Type and Filter.

Table 6.149: Input parameters for GetList
Name Type Range Description
Type unicode string Log Specifies the Content Type.
[Filter] map
For more information, refer map 6.150
RecentList
EKLogNullRecentList: -1
EKLogRecentIncomingCalls: 1
EKLogRecentOutgoingCalls: 2
EKLogRecentMissedCalls: 3

A value of EKLogNullRecentList indicates to include events from all of the recent event lists.

EventType
EKLogCallEventType: 0
EKLogDataEventType: 1
EKLogFaxEventType: 2
EKLogShortMessageEventType: 3
EKLogPacketDataEventType: 4

Direction
EIncomingEvent: 0
EOutgoingEvent: 1
EIncomingEvent Alternateline: 2
EOutgoingEvent Alternateline: 3
EFetchedEvent: 4
EMissedEvent: 5
EMissedEvent Alternateline: 6

DeliveryStatus
EStatusPending: 0
EStatusSent: 1
EStatusFalied: 2
EStatusNone: 3
EStatusDone: 4
EStatusNotSent: 5
EStatusScheduled: 6

LogFlags
EKLogEventContactSearched: 0
EKLogEventRead: 1

note:
Flag EKLogEventRead is set when you read the event in the log database.
Flag EKLogEventContactSearched is set when you search through contact database for performing any operation, like voice call or sms.

This is an optional parameter. Filter contains the search criteria for specific event search in the log database.

When an empty filter is passed, it gets all the events from the database by default.



Table 6.150: map
Key Value Description
Id unicode string Unique Id for the particular event in the log.

note:
To specify values for other fields in the map are not valid, when the Id field is used for querying.
If specified, then the values are ignored.

RecentList 32 bit int Gets the 20 recent call list. Initialises or refreshes the view for the specified recent event list, conforming to the specified filter. On successful completion, the view is positioned at the first that is, most recent event in the recent event list.

Recent lists also have a mechanism for duplicate event handling, set up via the recent list configuration. for example, two calls to the same number will only take up one entry on the outgoing calls list.

note:
To specify values for other fields in the map are not valid, when the RecentList field is used for querying.
If specified then, the values are ignored.

EventType 32 bit int Unique Id to identify event type.
[PhoneNumber] unicode string The phone number is associated with the event. This is used when the number cannot be stored in any other field. If the length of the specified string is greater than 100 characters, then the number is truncated.
[RemoteParty] unicode string Describes the destination of the out going event or source of incoming event. If the length of the specified string is greater than 64 characters, then the data is truncated.
[Direction] 32 bit int The direction of a call means incoming, outgoing, and so on.
[DeliveryStatus] 32 bit int Delivered, pending, or failed.
[EndTime] datetime Sets the specified EndTime to be used by the filter.
[LogFlags] 32 bit int Sets the specified flags for this event.


Output Parameters

Output contains ReturnValue. It also contains ErrorCode and an ErrorMessage if the operation fails.
ReturnValue contains an iterable wrapper of entries containing all relevant fields of the user specified Item.

Table 6.151: Output parameters for GetList
Name Type Range Description
ReturnValue Iterator (map)
EventType: 32 bit int
RemoteParty: String
Direction: 32 bit int
EventTime: datetime
EventDuration: 32 bit int
DeliveryStatus: 32 bit int
Subject: string
PhoneNumber: string
Description: string
EventData: 8-bit Data
Link: 32 bit int
id: string
LogFlags: 32 bit int
NA The output is an iterable list of entries, which on each invocation returns a map containing all relevant fields of an Item.

note:
Description and EventTime are automatically set by the system for a created event.
For example, The Description for CallEvent is voice call, SMS Event is short message.
EventTime is the time at which the event is created. This should be a datetime object.

ErrorMessage string NA Error Description in Engineering English.
ErrorCode 32 bit int NA Contains the SAPI specific error code when the operation fails.


Errors

The following table lists the error codes and their values:

Table 6.152: Error codes
Error code value Description
0 Success
1002 Bad argument type
1003 Missing argument
1004 Service not supported


Error Messages

The following table lists the error messages and their description:

Table 6.153: Error messages
Error messages Description
Logging:GetList:TypeInvalid Invalid Type is passed to contenttype parameter.
Logging:GetList:TypeMissing Content Type missing in the inputparam list.
Logging:GetList:FilterInvalid Invalid Type is passed to Filter parameter.
Logging:GetList:IdInvalid Invalid Type is passed to Id parameter.
Logging:GetList:RecentListInvalid Invalid Type is passed to RecentList parameter.
Logging:GetList:PhoneNumberInvalid Invalid Type is passed to PhoneNumber parameter.
Logging:GetList:DirectionInvalid Invalid Type is passed to Direction parameter.
Logging:GetList:DeliveryStatusInvalid Invalid Type is passed to DeliveryStatus parameter.
Logging:GetList:LogFlagsInvalid Invalid Type is passed to LogFlags parameter.
Logging:GetList:EndTimeInvalid Invalid Type is passed to EndTime parameter.
Logging:GetList:RemotePartyInvalid Invalid Type is passed to RemoteParty parameter.
Logging:GetList:EventTypeInvalid Invalid Type is passed to EventType parameter.


Example

The following sample code illustrates how to get the logging details on the phone:

import scriptext
# Load the desired SAPI
logging_handle = scriptext.load('Service.Logging', 'IDataSource')
try:
    logging_info = logging_handle.call('GetList', {'Type': u'Log',})
    for item in logging_info:
        print item['EventType']
        print item['RemoteParty']
        print item['Direction']
        print item['EventTime']
        print item['Subject']
        print item['PhoneNumber']
        print item['Description']
        print item['EventData']
except scriptext.ScriptextError, err:
        print "Error getting the list of Installed Application : ", err

See About this document... for information on suggesting changes.