Bondi logo

The Bondi commlog Module - Version 1.1

12 May 2009

Authors


Abstract

List message- and call-logs on the device and access their content and meta-information.

Table of Contents


Summary of Methods

InterfaceMethod
CommLogSMSSuccessCallbackvoid onSuccess(SMSArray obj)
CommLogMMSSuccessCallbackvoid onSuccess(MMSArray obj)
CommLogEmailSuccessCallbackvoid onSuccess(EmailArray obj)
CommLogCallSuccessCallbackvoid onSuccess(CallArray obj)
CommLogManagerPendingOperation getSMSLog(CommLogSMSSuccessCallback successCallback, ErrorCallback errorCallback, ShortArray messageFolders, SMSFilter filter)
PendingOperation getMMSLog(CommLogMMSSuccessCallback successCallback, ErrorCallback errorCallback, ShortArray messageFolders, MMSFilter filter)
PendingOperation getEmailLog(CommLogEmailSuccessCallback successCallback, ErrorCallback errorCallback, ShortArray messageFolders, EmailFilter filter)
PendingOperation getCallLog(CommLogCallSuccessCallback successCallback, ErrorCallback errorCallback, ShortArray callFolder, CallFilter filter)
StringArray getSMSSupportedPropertyKeys()
StringArray getMMSSupportedPropertyKeys()
StringArray getEmailSupportedPropertyKeys()
StringArray getCallSupportedPropertyKeys()
unsigned long getNumberOfMessages(unsigned short messageType, ShortArray messageFolders, boolean unread)
unsigned long getNumberOfCalls(ShortArray callFolders)
PendingOperation clearMessageLog(SuccessCallback successCallback, ErrorCallback errorCallback, unsigned short messageType, unsigned short messageFolder)
PendingOperation clearCallLog(SuccessCallback successCallback, ErrorCallback errorCallback, unsigned short callFolder)
Call
SMSFilter
MMSFilter
EmailFilter
CallFilter
CommLogManagerObject

1. Introduction

This API provides access to information on recent calls (missed, received, and initiated) and messages (sent, received, drafts, and outbox). The information contain all meta-information related to the according message and call, respectively. These meta-information may include the title and recipients of a message or the telephone number and date of a call.

This API does not provide event notifications for incoming messages or incoming calls. Thus, the application is not able to subscribe for a callback in the event of an incoming message or call, but rather has the possibility to request the current list of calls and messages. In order to react on incoming messages, the application may request the commlog on a short periodical basis.

However, the listing of messages/calls can be filtered in order to reduce the effort for the using application and to fasten the identification of relevant entries (i.e. messages and calls).

As this API is a read-only API with no possibility to send messages or to establish a call, the BONDI messaging API (and later telephony API, respectively) should be used to create new messages (and calls, respectively) and send them to single or multiple receivers.

1.1. Feature set

This is the URI used to declare this API's feature set, for use in bondi.requestFeature. For the URL, the list of features included by the feature set is provided.

http://bondi.omtp.org/api/commlog

All the CommLog features

Includes API features:

  • http://bondi.omtp.org/api/commlog.sms.get
  • http://bondi.omtp.org/api/commlog.mms.get
  • http://bondi.omtp.org/api/commlog.email.get
  • http://bondi.omtp.org/api/commlog.call.get
  • http://bondi.omtp.org/api/commlog.clear

1.2. Features

This is the list of URIs used to declare this API's features, for use in bondi.requestFeature. For each URL, the list of functions covered is provided.

When any of the features

is successfully requested, the interface CommLogManager is instantiated, and the resulting object appears in the global namespace as Bondi.commlogManager.

http://bondi.omtp.org/api/commlog.sms.get

Call to CommLogManager.getSMSLog

Device capabilities:

  • commlog.sms.get
http://bondi.omtp.org/api/commlog.mms.get

Call to CommLogManager.getMMSLog

Device capabilities:

  • commlog.mms.get
http://bondi.omtp.org/api/commlog.email.get

Call to CommLogManager.getEmailLog

Device capabilities:

  • commlog.email.get
http://bondi.omtp.org/api/commlog.call.get

Call to CommLogManager.getCallLog

Device capabilities:

  • commlog.call.get
http://bondi.omtp.org/api/commlog.clear

Call to CommLogManager.clearCallLog or CommLogManager.clearMessageLog

Device capabilities:

  • commlog.clear

1.3. Device capabilities

commlog.sms.get

Get entries from SMS log

commlog.mms.get

Get entries from MMS log

commlog.email.get

Get entries from email log

commlog.call.get

Get entries from call log

commlog.clear

Clear entries from a log

2. Type Definitions

2.1. SMSArray

Array of SMS.

        typedef sequence<SMS> SMSArray;

2.2. MMSArray

Array of MMS.

        typedef sequence<MMS> MMSArray;

2.3. EmailArray

Array of Email.

        typedef sequence<Email> EmailArray;

2.4. CallArray

Array of Call.

        typedef sequence<Call> CallArray;

3. Interfaces

3.1. CommLogSMSSuccessCallback

Success callback for retrieving a list of SMS.

        [Callback=FunctionOnly, NoInterfaceObject] interface CommLogSMSSuccessCallback {
                void onSuccess(in SMSArray obj);
        };

Success callback that takes an array of SMSs as input argument. It is used in the asynchronous operation to get the SMS Log.

Methods

onSuccess

Method invoked when a list of SMSs is retrieved succesfully

Signature
void onSuccess(in SMSArray obj);
Parameters
  • obj: The list of SMSs

3.2. CommLogMMSSuccessCallback

Success callback for retrieving a list of MMS.

        [Callback=FunctionOnly, NoInterfaceObject] interface CommLogMMSSuccessCallback {
                void onSuccess(in MMSArray obj);
        };

Success callback that takes an array of MMSs as input argument. It is used in the asynchronous operation to get the MMS Log.

Methods

onSuccess

Method invoked when a list of MMSs is retrieved succesfully

Signature
void onSuccess(in MMSArray obj);
Parameters
  • obj: The list of MMSs

3.3. CommLogEmailSuccessCallback

Success callback for retrieving a list of E-mails.

        [Callback=FunctionOnly, NoInterfaceObject] interface CommLogEmailSuccessCallback {
                void onSuccess(in EmailArray obj);
        };

Success callback that takes an array of E-mails as its input argument. It is used in the asynchronous operation to get the E-Mail log.

Methods

onSuccess

Method invoked when a list of e-mails is retrieved succesfully

Signature
void onSuccess(in EmailArray obj);
Parameters
  • obj: The list of e-mails

3.4. CommLogCallSuccessCallback

Success callback for retrieving a list of Calls.

        [Callback=FunctionOnly, NoInterfaceObject] interface CommLogCallSuccessCallback {
                void onSuccess(in CallArray obj);
        };

Success callback that takes an array of Calls as input argument. It is used in the asynchronous operation to get the list of Calls.

Methods

onSuccess

Method invoked when a list of calls is retrieved succesfully

Signature
void onSuccess(in CallArray obj);
Parameters
  • obj: The list of calls

3.5. CommLogManager

Communication Log API.

        interface CommLogManager {

                const unsigned short INBOX_FOLDER = 0;

                const unsigned short OUTBOX_FOLDER = 1;

                const unsigned short SENT_FOLDER  = 2;

                const unsigned short DRAFT_FOLDER = 3;

                const unsigned short MISSED_CALLS_FOLDER = 0;

                const unsigned short RECEIVED_CALLS_FOLDER = 1;

                const unsigned short INITIATED_CALLS_FOLDER = 2;

                const unsigned short MESSAGE_TYPE_SMS = 0;

                const unsigned short MESSAGE_TYPE_MMS = 1;

                const unsigned short MESSAGE_TYPE_EMAIL = 2;
                
                PendingOperation getSMSLog(in CommLogSMSSuccessCallback successCallback,
                                           in ErrorCallback errorCallback,
                                           in ShortArray messageFolders,
                                           [Optional]in SMSFilter filter)
                        raises(SecurityError, DeviceAPIError);


                PendingOperation getMMSLog(in CommLogMMSSuccessCallback successCallback,
                                           in ErrorCallback errorCallback,
                                           in ShortArray messageFolders,
                                           [Optional]in MMSFilter filter)
                        raises(SecurityError, DeviceAPIError);


                PendingOperation getEmailLog(in CommLogEmailSuccessCallback successCallback,
                                             in ErrorCallback errorCallback,
                                             in ShortArray messageFolders,
                                             [Optional]in EmailFilter filter)
                        raises(SecurityError, DeviceAPIError);


                PendingOperation getCallLog(in CommLogCallSuccessCallback successCallback,
                                            in ErrorCallback errorCallback,
                                            in ShortArray callFolder,
                                            [Optional]in CallFilter filter)
                        raises(SecurityError, DeviceAPIError);

                StringArray getSMSSupportedPropertyKeys();

                StringArray getMMSSupportedPropertyKeys();

                StringArray getEmailSupportedPropertyKeys();

                StringArray getCallSupportedPropertyKeys();
                
            unsigned long getNumberOfMessages(in unsigned short messageType, 
                                               in ShortArray messageFolders,
                                               [Optional] in boolean unread)                                    
                        raises(DeviceAPIError);                                        
        
            unsigned long getNumberOfCalls(in ShortArray callFolders)
                        raises(DeviceAPIError);      
                        
                PendingOperation clearMessageLog(in SuccessCallback successCallback, 
                                                 in ErrorCallback errorCallback,
                                                 in unsigned short messageType, 
                                                 in unsigned short messageFolder)
                        raises(SecurityError, DeviceAPIError);      
                
                PendingOperation clearCallLog(in SuccessCallback successCallback, 
                                              in ErrorCallback errorCallback,
                                              in unsigned short callFolder)
                        raises(SecurityError, DeviceAPIError);              
        };

The communication logs manager interface offers methods to retrieve information from the Inbox, Outbox and call registry.

Code example
        // Define the getSMSLog success callback.
        function smsSuccessCallback(response) {
                var messages = response;
                // Get first message in the list of results
                var sms = messages[0];
        }

        // Define the requestFeature success callback.
        function successCallback(response) {
                bondi.commlog.getSMSLog(smsSuccessCallback, errorCallback,
                        { bondi.commlog.INBOX_FOLDER, bondi.commlog.OUTBOX_FOLDER},
                        { Recipient:"+34666666666", Body:"Huesca"});
        }

        // Define an error callback.
        function errorCallback(response) {
                alert( "The following error code is: " +  response.code);
        }

        // Request the commlog feature.
        bondi.requestFeature(successCallback, errorCallback, "commlog");
 

Constants

unsigned short INBOX_FOLDER

Folder message constants definition

unsigned short OUTBOX_FOLDER

Folder containing messages to be sent.

unsigned short SENT_FOLDER

Folder containing sent messages.

unsigned short DRAFT_FOLDER

Folder containing drafts.

unsigned short MISSED_CALLS_FOLDER

Folder of missed calls.

unsigned short RECEIVED_CALLS_FOLDER

Folder with received calls.

unsigned short INITIATED_CALLS_FOLDER

Folder with initiated calls.

unsigned short MESSAGE_TYPE_SMS

SMS message constant definition

unsigned short MESSAGE_TYPE_MMS

MMS message constant definition

unsigned short MESSAGE_TYPE_EMAIL

E-mail message constant definition

Methods

getSMSLog

Get the list of selected SMSs

Signature
PendingOperation getSMSLog(in CommLogSMSSuccessCallback successCallback, in ErrorCallback errorCallback, in ShortArray messageFolders, in SMSFilter filter);

Gets an array of SMSMessages objects for sms messages stored within the selected folders and matching the selected filter.

This is an asynchronous method.

In a search using this method, if more than one value is used, then the AND operator will be used betwwen all values to perform the search.

In a search using strings, the search conductes is case sensitive. If the string is found anywhere inside the key object value, the entire object will be returned.

Parameters
  • successCallback: function called when the invocation ends successfully, the response object is used to retrieve the array of SMS objects.
  • errorCallback: function called when an error occurs, the input parameter is an Error object with a code giving information about the type of error that occurred.
  • messageFolders: Array of ints stating in which message folders the web app has to look for messages. It can't be null. Array values must be 0 (INBOX_FOLDER),1 (SENT_FOLDER),2 (OUTBOX_FOLDER) or 3 (DRAFT_FOLDER).
  • filter: Specifies the conditions to be met by the messages
Return value
PendingOperation in order to cancel the async call.
Exceptions
  • SecurityError:

    PERMISSION_DENIED_ERROR when access is denied by the security policy.

  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if parameters are not valid If parameters are not valid If folder isn't one of the following: INBOX_FOLDER,SENT_FOLDER, OUTBOX_FOLDER or DRAFT_FOLDER If some of the filter parameters are not supported

API features
http://bondi.omtp.org/api/commlog.sms.get
Code example
        // Define the success callback.
        function successCallback(response) {
                var messages = response;
                // Get first message in the list of results
                var sms = messages[0];
        }

        // Define the error callback.
        function errorCallback(response) {
                alert( "The following error code is: " +  response.code);
        }

        // Get the SMS log for the specified filter.
        bondi.commlog.getSMSLog(successCallback, errorCallback,
                { bondi.commlog.INBOX_FOLDER, bondi.commlog.OUTBOX_FOLDER},
                { recipient:"+34666666666", body:"Huesca"});
 
getMMSLog

Get the list of selected MMSs

Signature
PendingOperation getMMSLog(in CommLogMMSSuccessCallback successCallback, in ErrorCallback errorCallback, in ShortArray messageFolders, in MMSFilter filter);

Gets an array of MMSMessage objects for MMS messages stored within the selected folders matching the selected filter.

In a search using this method, if more than one value is used, then the AND operator will be used betwwen all values to perform the search.

In a search using strings, the search conductes is case sensitive. If the string is found anywhere inside the key object value, the entire object will be returned.

This is an asynchronous method.

Parameters
  • successCallback: function called when the invocation ends successfully, use response object to retrieve the array of MMS objects.
  • errorCallback: function called when an error occurs, the input parameter is an Error object with a code giving information about the type of error that occurred.
  • messageFolders: Array of ints stating in which message folders the web app has to look for messages. It can't be null. Array values must be 0 (INBOX_FOLDER),1 (SENT_FOLDER),2 (OUTBOX_FOLDER) or 3 (DRAFT_FOLDER).
  • filter: Specifies the conditions to be met by the messages
Return value
PendingOperation in order to cancel the async call.
Exceptions
  • SecurityError:

    PERMISSION_DENIED_ERROR when access is denied by the security policy.

  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR If parameters are not valid If folder isn't one of the following: INBOX_FOLDER,SENT_FOLDER, OUTBOX_FOLDER or DRAFT_FOLDER If some of the filter parameters are not supported.

API features
http://bondi.omtp.org/api/commlog.mms.get
Code example
        // Define the success callback.
        function successCallback(response) {
                var messages = response;
                // Get first MMS in the list of results
                var mms = messages[0];
        }

        // Define the error callback.
        function errorCallback(response) {
                alert( "The following error code is: " +  response.code);
        }

        // Get the MMS log for the specified filter.
        bondi.commlog.getMMSLog(successCallback, errorCallback,
                { bondi.commlog.INBOX_FOLDER, bondi.commlog.OUTBOX_FOLDER},
                {recipient:"+34666666666", body:"Huesca"});
 
getEmailLog

Get the list of selected Emails

Signature
PendingOperation getEmailLog(in CommLogEmailSuccessCallback successCallback, in ErrorCallback errorCallback, in ShortArray messageFolders, in EmailFilter filter);

In a search using this method, if more than one value is used, then the AND operator will be used betwwen all values to perform the search.

In a search using strings, the search conductes is case sensitive. If the string is found anywhere inside the key object value, the entire object will be returned.

Parameters
  • successCallback: function called when the invocation ends successfully, the response object is used to retrieve the array of Strings containing message IDs.
  • errorCallback: function called when an error occurs, the input parameter is an Error object with a code giving information about the type of error that occurred.
  • messageFolders: Array of Ints stating in which message folders the web app should look for messages.It can't be null. Array values must be 0 (INBOX_FOLDER),1 (SENT_FOLDER),2 (OUTBOX_FOLDER) or 3 (DRAFT_FOLDER).
  • filter: Specifies the conditions to be met by the messages
Return value
PendingOperation in order to cancel the async call.
Exceptions
  • SecurityError:

    PERMISSION_DENIED_ERROR when access is denied by the security policy.

  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR If parameters are not valid. If folder isn't one of the following: INBOX_FOLDER,SENT_FOLDER, OUTBOX_FOLDER or DRAFT_FOLDER. If some of the filter parameters are not supported.

API features
http://bondi.omtp.org/api/commlog.email.get
Code example
        // Define the success callback.
        function successCallback(response) {
                var messages = response;
                // Get first email in the list of results
                var email = messages[0];
        }

        // Define the error callback.
        function errorCallback(response) {
                alert( "The following error code is: " +  response);
        }

        // Get the Email log for the specified filter.
        bondi.commlog.getEmailLog(successCallback, errorCallback,
                { bondi.commlog.INBOX_FOLDER, bondi.commlog.OUTBOX_FOLDER},
                { Recipient:"+34666666666", Body:"Huesca"});
 
getCallLog

Get the list of selected Calls

Signature
PendingOperation getCallLog(in CommLogCallSuccessCallback successCallback, in ErrorCallback errorCallback, in ShortArray callFolder, in CallFilter filter);

Gets an array of Call objects for calls stored within the selected folders and matching the selected filter.

In a search using this method, if more than one value is used, then the AND operator will be used betwwen all values to perform the search.

In a search using strings, the search conductes is case sensitive. If the string is found anywhere inside the key object value, the entire object will be returned.

This is an asynchronous method.

Parameters
  • successCallback: function called when the invocation ends successfully, the response object is used to retrieve the array of Strings containing call IDs.
  • errorCallback: function called when an error occurs, the input parameter is an Error object with a code giving information about the type of error that occurred.
  • callFolder: Array of Ints stating in which message folders the web app should loook for calls. It can't be null. Array values must be 0 (MISSED_CALLS_FOLDER),1(RECEIVED_CALLS_FOLDER) or 2(INITIATED_CALLS_FOLDER).
  • filter: Specifies the conditions to be met by the calls
Return value
PendingOperation in order to cancel the async call.
Exceptions
  • SecurityError:

    PERMISSION_DENIED_ERROR when access is denied by the security policy.

  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR If parameters are not valid. If folder isn't one of the following: MISSED_CALLS_FOLDER, RECEIVED_CALLS_FOLDER or INITIATED_CALLS_FOLDER. If some of the filter parameters are not supported.

API features
http://bondi.omtp.org/api/commlog.call.get
Code example
        // Define the success callback.
        function successCallback(response)
        {
                // Get first call in the list of results
                var myCall = response[0];
        }

        // Define the error callback.
        function errorCallback(response)
        {
                alert( "The following error code is: " +  response.code);
        }

        // Get the call log for the specified filter.
        var callsArray = new Array();
        callsArray.push(bondi.commlog.MISSED_CALLS_FOLDER);
        callsArray.push(bondi.commlog.RECEIVED_CALLS_FOLDER);
        bondi.commlog.getCallsLog(successCallback,errorCallback,callsArray, {phoneNumber:"+34666666666"});
 
getSMSSupportedPropertyKeys

Get the property keys of SMSs

Signature
StringArray getSMSSupportedPropertyKeys();

This method returns a list of the public SMS property keys. That is to say it returns all the parameters we can use to create an SMS (body, recipients, store...) and supported by the getSMSLog filter parameter.

Return value
Array of Strings containing the names of the message object public properties.
Code example
        var myBody = "New body for a draft message";
        var attributes = bondi.commlog.getSMSSupportedPropertyKeys();
        if (attributes[1] == "body") {
                var sms = bondi.messaging.createSMS();
                sms.setProperty(attributes[1],myBody);
        }
 
getMMSSupportedPropertyKeys

Get the property keys of MMSs

Signature
StringArray getMMSSupportedPropertyKeys();

This method returns a list of the public MMS property keys. That is to say it returns all the parameters we can use to create an MMS (body, recipients, store, attachments...) and supported by the getMMSLog filter parameter.

Return value
Array of Strings containing the names of the message object public properties.
Code example
        var myBody = "New body for a draft message";
        var attributes = bondi.commlog.getMMSSupportedPropertyKeys();
        if (attributes[1] == "body") {
                var mms = bondi.messaging.createMMS();
                mms.setProperty(attributes[1], myBody);
        }
 
getEmailSupportedPropertyKeys

Get the property keys of Emails

Signature
StringArray getEmailSupportedPropertyKeys();

This method returns a list of the public Email property keys. That is to say it returns all the parameters we can use to create an Email (body, subject, store, attachments...) and supported by the getEmaillLog filter parameter.

Return value
Array of Strings containing the names of the message object public properties.
Code example
        var myBody = "New body for a draft message";
        var attributes = bondi.commlog.getEmailSupportedPropertyKeys();
        if (attributes[1] == "body") {
                var email = bondi.messaging.createEmail();
                email.setProperty(attributes[1], myBody);
        }
 
getCallSupportedPropertyKeys

Gets the call attributes supported by the getCallLog filter parameter.

Signature
StringArray getCallSupportedPropertyKeys();
Return value
Array of Strings containing the names of the call object public properties.
Code example
        var attributes = bondi.commlog.getCallSupportedPropertyKeys();
        if (attributes[1] == "phoneNumber") {
                var phoneNumber = call.getProperty(attributes[1]);
        }
 
getNumberOfMessages

Get the number of messages in a messaging folder

Signature
unsigned long getNumberOfMessages(in unsigned short messageType, in ShortArray messageFolders, in boolean unread);

Gets the number of messages of a particular message type that are stored in the folder passed as input argument. If the unread input parameter is set to true, it will only return the number of unread messages of that type stored in the folder, otherwise it will return the total number (read and unread).

Parameters
  • messageType: Describes the type of messages that should be counted. Possible values are 0 (MESSAGE_TYPE_SMS), 1 (MESSAGE_TYPE_MMS) and 2 (MESSAGE_TYPE_EMAIL).
  • messageFolders: Array of ints describing in which message folders the messages should be counted. The Possible values of the array elements are 0 (INBOX_FOLDER), 1 (SENT_FOLDER), 2 (OUTBOX_FOLDER) and 3 (DRAFT_FOLDER).
  • unread: Specifies whether the returned number of messages should just consider the unread messages (true) or the total number of messages (false). By default it is set to false.
Return value
The number of messages matching the criteria
Exceptions
  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if parameters are not valid

Code example
        var foldersArray = new Array();
        foldersArray.push(bondi.commlog.INBOX_FOLDER);
        foldersArray.push(bondi.commlog.OUTBOX_FOLDER);
  var number = bondi.commlog.getNumberOfMessages(MESSAGE_TYPE_SMS, foldersArray, true);
  alert("There are " + number + " unread SMSs");
 
getNumberOfCalls

Get the number of calls in a call folder

Signature
unsigned long getNumberOfCalls(in ShortArray callFolders);

Gets the number of calls contained in the folders passed as input argument.

Parameters
  • callFolders: Array of ints describing in which call folders the calls should be counted. The Possible values of the array elements are 0 (MISSED_CALLS_FOLDER), 1 (RECEIVED_CALLS_FOLDER) or 2 (INITIATED_CALLS_FOLDER).
Return value
The number of calls matching the criteria
Exceptions
  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if parameters are not valid

Code example
        var foldersArray = new Array();
        foldersArray.push(bondi.commlog.MISSED_CALLS_FOLDER);
  var number = bondi.commlog.getNumberOfMessages(foldersArray);
  alert("There are " + number + " missed calls");
 
clearMessageLog

Deletes all the info from a message folder

Signature
PendingOperation clearMessageLog(in SuccessCallback successCallback, in ErrorCallback errorCallback, in unsigned short messageType, in unsigned short messageFolder);

Removes all the messages of a given type (specified by the messageType) in the folders passed as parameters in messageFolders.

Parameters
  • successCallback: function called when the invocation completes successfully.
  • errorCallback: function called when an error occurs, the callback provides an input parameter that is an Error object that gives information about the type of error that occurred.
  • messageType: Describes the type of messages that should be removed. Possible values are 0 (MESSAGE_TYPE_SMS), 1 (MESSAGE_TYPE_MMS) and 2 (MESSAGE_TYPE_EMAIL).
  • messageFolder: Message folder from which the messages should be removed. The Possible values are 0 (INBOX_FOLDER), 1 (SENT_FOLDER), 2 (OUTBOX_FOLDER) and 3 (DRAFT_FOLDER).
Return value
PendingOperation in order to allow cancelling the async call.
Exceptions
  • SecurityError:

    PERMISSION_DENIED_ERROR when access is denied by the security policy.

  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if parameters are not valid

API features
http://bondi.omtp.org/api/commlog.sms.delete
Code example
        // Define the success callback.
        function successCallback(response)
        {
                alert("Message folder is now empty);
        }

        // Define the error callback.
        function errorCallback(response)
        {
                alert( "The following error code occured: " +  response.code);
        }

        // Get the call log for the specified filter.
        var foldersArray = new Array();
        foldersArray.push(bondi.commlog.INBOX_FOLDER);
        foldersArray.push(bondi.commlog.OUTBOX_FOLDER);
        bondi.commlog.clearMessageLog(successCallback, errorCallback, bondi.commlog.MESSAGE_TYP_SMS, foldersArray);
 
clearCallLog

Deletes all the calls from a call folder

Signature
PendingOperation clearCallLog(in SuccessCallback successCallback, in ErrorCallback errorCallback, in unsigned short callFolder);
Parameters
  • successCallback: function called when the invocation completes successfully.
  • errorCallback: function called when an error occurs, the callback provides an input parameter that is an Error object that gives information about the type of error that occurred.
  • callFolder: Call folder from which the messages should be removed. The Possible values are 0 (MISSED_CALLS_FOLDER), 1 (RECEIVED_CALLS_FOLDER) or 2 (INITIATED_CALLS_FOLDER).
Return value
PendingOperation in order to allow cancelling the async call.
Exceptions
  • SecurityError:

    PERMISSION_DENIED_ERROR when access is denied by the security policy.

  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if parameters are not valid

API features
http://bondi.omtp.org/api/commlog.call.delete
Code example
        // Define the success callback.
        function successCallback(response)
        {
                alert("Call log is now empty);
        }

        // Define the error callback.
        function errorCallback(response)
        {
                alert( "The following error code occured: " +  response.code);
        }

        // Get the call log for the specified filter.
        var callsArray = new Array();
        callsArray.push(bondi.commlog.MISSED_CALLS_FOLDER);
        callsArray.push(bondi.commlog.RECEIVED_CALLS_FOLDER);
        bondi.commlog.clearCallLog(successCallback,errorCallback, callsArray);
 

3.6. Call

Encapsulation of a call on the device.

        [Callback] interface Call {
                readonly attribute DOMString phoneNumber;

                readonly attribute Date startTime;

                readonly attribute unsigned long duration;

                readonly attribute DOMString id;

                readonly attribute unsigned short folder;
        };
Code example
        // Define the success callback.
        function successCallback(response) {
                var calls = response;
                // Get first phone number in the list of results
                alert(call[0].phoneNumber);
        }

        // Define the error callback.
        function errorCallback(response) {
                alert( "The following error code is: " +  response.code);
        }

        // Get the missed calls log.
        bondi.commlog.getCallLog(successCallback, errorCallback,
                { bondi.commlog.MISSED_CALLS_FOLDER},
                { phoneNumber:"+34666666666"});
 

Attributes

readonly DOMString phoneNumber

Phone number of the call object
String that contains the phone number that called or that was called (depending on the folder property).

This attribute is read-only.

Code example
        // Define the success callback.
        function successCallback(response) {
                var calls = response;
                // Get the phonenumber of the first call in the list of results
                alert(call[0].phoneNumber);
        }

        // Define the error callback.
        function errorCallback(response) {
                alert( "The following error code is: " +  response.code);
        }

        // Get the missed calls log.
        bondi.commlog.getCallLog(successCallback, errorCallback,
                { bondi.commlog.MISSED_CALLS_FOLDER},
                { phoneNumber:"+34666666666"});
 
readonly Date startTime

Date when the call started
Object containing date and time when the call took place.

This attribute is read-only.

Code example
        // Define a success callback.
        function successCallback(response) {
                alert(response[0].startTime);
        }

        // Define an error callback.
        function errorCallback(response) {
                alert( "The following error code is: " +  response.code);
        }

        // Get the missed calls log.
        bondi.commlog.getCallLog(successCallback, errorCallback,
                { bondi.commlog.MISSED_CALLS_FOLDER},
                { phoneNumber:"+34666666666"});
 
readonly unsigned long duration

Duration of the call
Integer which contains the duration of the call in seconds.

This attribute is read-only.

Code example
        // Define a success callback.
        function successCallback(response) {
                alert("The call lasted for " + response[0].duration + " seconds.");
        }

        // Define an error callback.
        function errorCallback(response) {
                alert( "The following error code is: " +  response.code);
        }

        // Get the missed calls log.
        bondi.commlog.getCallLog(successCallback, errorCallback,
                { bondi.commlog.MISSED_CALLS_FOLDER},
                { phoneNumber:"+34666666666"});
 
readonly DOMString id

Call identifier String containing the unique id of the call within the platform.

This attribute is read-only.

Code example
        // Define a success callback.
        function successCallback(response) {
                alert("This is the id for the first call in the log: " + response[0].id);
        }

        // Define an error callback.
        function errorCallback(response) {
                alert( "The following error code is: " +  response.code);
        }

 // Get the missed calls log.
        bondi.commlog.getCallLog(successCallback, errorCallback,
                { bondi.commlog.MISSED_CALLS_FOLDER},
                { phoneNumber:"+34666666666"});
 
readonly unsigned short folder

folder where the call was stored This property has access to the information about in which folder is the call stored. MISSED_CALLS_FOLDER=0, RECEIVED_CALLS_FOLDER=1 or INITIATED_CALLS_FOLDER=2

This attribute is read-only.

Code example
        // Define a success callback.
        function successCallback(response) {
                var calls = response;
                var call = calls[0];
                if (call.folder == bondi.commlog.MISSED_CALLS_FOLDER) alert("Missed call!");
        }

        // Define an error callback.
        function errorCallback(response) {
                alert( "The following error code occurred: " +  response.code);
        }

 // Get the missed calls log.
        bondi.commlog.getCallLog(successCallback, errorCallback,
                { bondi.commlog.MISSED_CALLS_FOLDER},
                { phoneNumber:"+34666666666"});
 

3.7. SMSFilter

Used for perform search operations in the SMS Log

        [NoInterfaceObject, Callback] interface SMSFilter {
                attribute DOMString body;
                
                attribute DOMString recipient;
                
                attribute Date initialDate;

                attribute Date finalDate;
    };

This interface is intended to be used for input parameters for SMS searching (getSMSLog). All the attributes are optional and by default are undefined

Code example
        // Define the success callback.
        function successCallback(response) {
                var messages = response;
                // Get first message in the list of results
                var sms = messages[0];
        }

        // Define the error callback.
        function errorCallback(response) {
                alert( "The following error code is: " +  response.code);
        }

        // Get the SMS log for the specified filter.
        bondi.commlog.getSMSLog(successCallback, errorCallback,
                { bondi.commlog.INBOX_FOLDER, bondi.commlog.OUTBOX_FOLDER},
                { recipient:"+34666666666", body:"Huesca"});
 

Attributes

DOMString body

SMS body

DOMString recipient

SMS recipient

Date initialDate

SMS minimum date, initial date for searching SMSs

Date finalDate

SMS minimum date, final date for searching SMSs

3.8. MMSFilter

Used for perform search operations in the MMS Log

        [NoInterfaceObject, Callback] interface MMSFilter {
                attribute DOMString body;
                
                attribute DOMString recipient;
                
                attribute Date initialDate;

                attribute Date finalDate;
        };

This interface is intended to be used for input parameters for MMS searching (getMMSLog). All the attributes are optional and by default are undefined

Code example
        // Define the success callback.
        function successCallback(response) {
                var messages = response;
                // Get first message in the list of results
                var mms = messages[0];
        }

        // Define the error callback.
        function errorCallback(response) {
                alert( "The following error code is: " +  response.code);
        }

        // Get the SMS log for the specified filter.
        bondi.commlog.getMMSLog(successCallback, errorCallback,
                { bondi.commlog.INBOX_FOLDER, bondi.commlog.OUTBOX_FOLDER},
                { recipient:"+34666666666", body:"Huesca"});
 

Attributes

DOMString body

MMS body

DOMString recipient

MMS recipient

Date initialDate

MMS minimum date, initial date for searching MMSs

Date finalDate

MMS minimum date, final date for searching MMSs

3.9. EmailFilter

Used for perform search operations in the Email Log

        [NoInterfaceObject, Callback] interface EmailFilter {
                attribute DOMString from;
                
                attribute DOMString to;
                
                attribute DOMString cc;
                
          attribute DOMString bcc;
                
                attribute DOMString subject;
                
                attribute DOMString body;
                
                attribute Date initialDate;

                attribute Date finalDate;
        };

This interface is intended to be used for input parameters for Email searching (getEmailLog). All the attributes are optional and by default are undefined

Code example
        // Define the success callback.
        function successCallback(response) {
                var messages = response;
                // Get first message in the list of results
                var email = messages[0];
        }

        // Define the error callback.
        function errorCallback(response) {
                alert( "The following error code is: " +  response.code);
        }

        // Get the E-mail log for the specified filter.
        bondi.commlog.getEmailLog(successCallback, errorCallback,
                { bondi.commlog.INBOX_FOLDER, bondi.commlog.OUTBOX_FOLDER},
                { from:"+34666666666", body:"Huesca"});
 

Attributes

DOMString from

From field of the e-mail

DOMString to

To field of the e-mail

DOMString cc

CC field of the e-mail

DOMString bcc

BCC field of the e-mail

DOMString subject

E-mail's subject

DOMString body

E-mail's body

Date initialDate

Email minimum date, initial date for searching Emails

Date finalDate

Email minimum date, final date for searching Emails

3.10. CallFilter

Used for perform search operations in the Call Log

        [NoInterfaceObject, Callback] interface CallFilter {
                attribute DOMString phoneNumber;
                
                attribute unsigned long minDuration;
        };

This interface is intended to be used for input parameters for call searching (getCallLog). All the attributes are optional and by default are undefined

Code example
        // Define the success callback.
        function successCallback(response) {
                var calls = response;
                // Get first message in the list of results
                var call = calls[0];
        }

        // Define the error callback.
        function errorCallback(response) {
                alert( "The following error code is: " +  response.code);
        }

        // Get the SMS log for the specified filter.
        bondi.commlog.getCallLog(successCallback, errorCallback,
                { bondi.commlog.RECEIVED_CALLS_FOLDER},
                { phoneNumber:"+34666666666"});
 

Attributes

DOMString phoneNumber

phone Number

unsigned long minDuration

minimal duration (in seconds) of the calls to be returned

3.11. CommLogManagerObject

Specifies what is instantiated at feature request

        interface CommLogManagerObject {
                readonly attribute CommLogManager commlogManager; 
        };
        Bondi implements CommLogManagerObject;