Bondi logo

The Bondi telephony Module - Version 1.5

February 2010

Authors


Abstract

The BONDI Telephony API.

Table of Contents


Summary of Methods

Interface Method
TelephonyProviderSuccessCallback void onSuccess(TelephonyProviderArray telephonyProviders)
TelephonyErrorCallback void onError(TelephonyError error)
OnIncommingCallEvent void onEvent(Call incommingCall)
OnCallStateEvent void onEvent(Call call, short event)
LogManagerSuccessCallback void onSuccess(LogEntries obj)
TelephonyError
TelephonyProviderConfigurationOptions
TelephonyManager PendingOperation getTelephonyProviders(TelephonyProviderSuccessCallback successCallback, TelephonyErrorCallback errorCallback)
TelephonyProvider getDefaultProvider()
boolean setDefaultProvider(TelephonyProvider provider)
TelephonyProvider PendingOperation init(SuccessCallback successCallback, ErrorCallback errorCallback, TelephonyProviderConfigurationOptions options)
void setIncommingCallEventListener(OnIncommingCallEvent incommingCallEventListener)
DOMString getMyAddress()
CallArray getOngoingCalls()
Call createCall(DOMString callingPartner)
PendingOperation migrateCall(OnIncommingCallEvent successCallback, ErrorCallback errorCallback, Call call)
Call PendingOperation open(SuccessCallback successCallback, ErrorCallback errorCallback)
PendingOperation reject(SuccessCallback successCallback, ErrorCallback errorCallback)
PendingOperation close(SuccessCallback successCallback, ErrorCallback errorCallback)
PendingOperation hold(SuccessCallback successCallback, ErrorCallback errorCallback)
PendingOperation resume(SuccessCallback successCallback, ErrorCallback errorCallback)
PendingOperation join(SuccessCallback successCallback, ErrorCallback errorCallback, Call call)
TelephonyManagerObject
LogManager PendingOperation findLogEntries(LogManagerSuccessCallback successCallback, ErrorCallback errorCallback, ShortArray callFolder, LogFilter filter)
unsigned long getNumberOfCalls(ShortArray callFolders)
PendingOperation deleteLogEntry(SuccessCallback successCallback, ErrorCallback errorCallback, DOMString callID, unsigned short folder)
PendingOperation clearLog(SuccessCallback successCallback, ErrorCallback errorCallback, unsigned short callFolder)
LogEntry
LogFilter
LogManagerObject

1. Introduction

The BONDI telephony API provides access to call management functionalities with the possibility to use multiple telephony providers if available. Different available operators can be modelled as telephony provider while a default provider can be set.

The TAPI allows to subscribe for notifications about incoming calls and therewith the TAPI allows for accepting and rejecting incoming calls.

Managing ongoing calls, resp. calls that were not initiated through the TAPI itself, is also possible as well as to manage multiple calls at the same time. Therefore joining multiple calls to one call and migrating a call from one to another telephony provider is supported.

The Telephony API also provides access to information on recent calls (missed, received, and initiated). The information contain all meta-information related to the according call. These meta-information may include the telephone number and date of a call.

The listing of calls can be filtered in order to reduce the effort for the using application and to fasten the identification of relevant entries.

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/1.1/telephony

All the telephony features

Includes API features:

  • http://bondi.omtp.org/api/1.1/telephony.log.get
  • http://bondi.omtp.org/api/1.1/telephony.log.delete

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 the feature

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

When any of the features

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

http://bondi.omtp.org/api/telephony.createcalls

Initiating outgoing telephony calls.

Device capabilities:

  • telephony.createcalls
http://bondi.omtp.org/api/telephony.receivecalls

Receiving incomming calls.

Device capabilities:

  • telephony.receivecalls
http://bondi.omtp.org/api/telephony.read

Accessing available telephony providers.

Device capabilities:

  • telephony.read
http://bondi.omtp.org/api/telephony.write

Setting the default telephony provider.

Device capabilities:

  • telephony.write
http://bondi.omtp.org/api/1.1/telephony.log.get

Call to CallManager.findLogEntries

Device capabilities:

  • telephony.log.get
http://bondi.omtp.org/api/1.1/telephony.log.delete

Call to CallManager.deleteLogEntry and CallManager.clearLog

Device capabilities:

  • telephony.log.delete

1.3. Device capabilities

telephony.createcalls

Initiating outgoing telephony calls.

telephony.receivecalls

Receiving incomming calls.

telephony.read

Accessing available telephony providers.

telephony.write

Setting the default telephony provider.

telephony.log.get

Get entries from call log

Security parameters:

  • folders: Space-separated list of folder identifiers from which the call entries are to be retrieved.
telephony.log.delete

Delete call log entries from a log

Security parameters:

  • folder: Folder identifier from which the call log entry/entries is/are to be deleted.

2. Type Definitions

2.1. CallArray

Array that contains a set of calls.

        typedef sequence<Call> CallArray;

2.2. TelephonyProviderArray

Array that contains a set of telephony providers.

        typedef sequence<Call> TelephonyProviderArray;

2.3. LogEntries

Array of call log entries.

        typedef sequence<LogEntry> LogEntries;

3. Interfaces

3.1. TelephonyProviderSuccessCallback

Callback to receive the available telephony providers.

        [Callback=FunctionOnly, NoInterfaceObject] interface TelephonyProviderSuccessCallback {
                void onSuccess(in TelephonyProviderArray telephonyProviders);
        };

Methods

onSuccess

The success callback handler for retrieved telephony providers.

Signature
void onSuccess(in TelephonyProviderArray telephonyProviders);
Parameters
  • telephonyProviders:

3.2. TelephonyErrorCallback

Callback to receive Telephony API specific Errors.

        [Callback=FunctionOnly, NoInterfaceObject] interface TelephonyErrorCallback {
                void onError(in TelephonyError error);
        };

Methods

onError

The error callback handler for telephony errors.

Signature
void onError(in TelephonyError error);
Parameters
  • error:

3.3. OnIncommingCallEvent

Callback to receive incomming call events.

        [Callback=FunctionOnly, NoInterfaceObject] interface OnIncommingCallEvent{
                void onEvent(in Call incommingCall);
        };

Methods

onEvent

The notification callback handler for managing incomming calls.

Signature
void onEvent(in Call incommingCall);

The notification callback handler for managing incomming calls is also used for a successfull migration of a call from one telephony provider to another one.

Parameters
  • incommingCall:

3.4. OnCallStateEvent

Callback to receive call events.

        [Callback=FunctionOnly, NoInterfaceObject] interface OnCallStateEvent{
                void onEvent(in Call call, in short event);
        };

Methods

onEvent

The call event handler for call related notivications.

Signature
void onEvent(in Call call, in short event);
Parameters
  • call:
  • event:

3.5. LogManagerSuccessCallback

Success callback for retrieving a list of Calls.

        [Callback=FunctionOnly, NoInterfaceObject] interface LogManagerSuccessCallback {
                void onSuccess(in LogEntries 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 successfully

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

3.6. TelephonyError

The Telephony API specific error interface.

        interface TelephonyError : GenericError {
                const unsigned short TELEPHONY_PROVIDER_UNAVAILABLE_ERROR = 0;
                
                const unsigned short TELEPHONY_NOT_ALLOWED_ERROR = 1;
                
                const unsigned short TELEPHONY_PROVIDER_NOT_INITIALIZED = 2;
        };

The telephony error interface defines error codes that are unique to the Telephony API.

Constants

unsigned short TELEPHONY_PROVIDER_UNAVAILABLE_ERROR

Error thrown if the default telephony provider is unavailable.

unsigned short TELEPHONY_NOT_ALLOWED_ERROR

Error thrown if a call function is not allowed.

unsigned short TELEPHONY_PROVIDER_NOT_INITIALIZED

Error thrown if a telephony provider to use is not initialized.

3.7. TelephonyProviderConfigurationOptions

Telephony provider configuration options.

        interface TelephonyProviderConfigurationOptions {
        
                attribute DOMString userName;
                
                attribute DOMString password;

        };

Attributes

DOMString userName

The user identifier needed to access a specific telephony provider.

DOMString password

The password needed to access a specific telephony provider.

3.8. TelephonyManager

Telephony manager that provides access to available telephony providers.

        interface TelephonyManager {

                PendingOperation getTelephonyProviders(
                                in TelephonyProviderSuccessCallback successCallback,
                                in TelephonyErrorCallback errorCallback);
                
                TelephonyProvider getDefaultProvider();
                
                boolean setDefaultProvider(in TelephonyProvider provider)
                  raises(SecurityError, DeviceAPIError);
                  
        };

The telephony manager provides access to a list of available telephony providers. The number and type of available telephony providers depends on the device.

Code example
 
        var telephonyprovider;
  bondi.telephony.getTelephonyProviders(onProviders, onError);

 function onProviders(TelephonyProviderArray providers){
        for (var i = 0; i < providers.length; i++){
                //select a telephony provider by checking the provider properties 
                telephonyprovider = providers[i];
        }
 }
 
 function onError(error) {
        alert(error.code);
 }
 

Methods

getTelephonyProviders

Gets a list of availabe telephony providers.

Signature
PendingOperation getTelephonyProviders(in TelephonyProviderSuccessCallback successCallback, in TelephonyErrorCallback errorCallback);

The number of telephony providers that are accessible through the telephony API depends on the number of available CS and PS providers installed on the device. To distinguish between multiple telephony providers the provider description and properties can be used to select the telephony provider to use.

If the method is executed succcessfuly, telephony providers can be provided, the successcallback is raised. If access is denied by the Security Policy, the errorCallback is invoked with an SecurityError PERMISSION_DENIED_ERROR. If an invalid parameter is passed in the ErrorCallback is invoked with an DeviceAPIError INVALID_ARGUMENT_ERROR.

Parameters
  • successCallback: The callback handler that is fired when all available telephony providers were identified and a list of them can be provided.
  • errorCallback: The callback handler that is fired if any error occurs.
Return value
PendingOperation in order to cancel the async call.
API features
http://bondi.omtp.org/api/telephony.read
getDefaultProvider

Gets the default telephony provider.

Signature
TelephonyProvider getDefaultProvider();

Get the default telephony provider that is commonly used on the device.

Return value
TelephonyProvider The default telephony provider.
setDefaultProvider

Sets the default telephony provider.

Signature
boolean setDefaultProvider(in TelephonyProvider provider);
Parameters
  • provider: The default telephony provider to set.
Exceptions
  • SecurityError:

    if setting a new default telephony provider is not allowed

  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if input parameters are invalid.

API features
http://bondi.omtp.org/api/telephony.write

3.9. TelephonyProvider

The TelephonyProvider interface.

        interface TelephonyProvider {
                
                const short TELEPHONY_PROVIDER_TYPE_CS = 0;
                
                const short TELEPHONY_PROVIDER_TYPE_PS = 1;
                
                attribute DOMString providerName;
                
                readonly attribute short type;
                
                PendingOperation init(in SuccessCallback successCallback, in ErrorCallback errorCallback, [Optional] in TelephonyProviderConfigurationOptions options);
                
                void setIncommingCallEventListener(in OnIncommingCallEvent incommingCallEventListener)
                        raises(SecurityError, DeviceAPIError,TelephonyError);

                DOMString getMyAddress()
                        raises(TelephonyError);
                
                CallArray getOngoingCalls()
                        raises(TelephonyError);
                
                Call createCall(in DOMString callingPartner)
                        raises(SecurityError, DeviceAPIError, TelephonyError);
                
                PendingOperation migrateCall(in OnIncommingCallEvent successCallback, in ErrorCallback errorCallback, in Call call);
        };

The TelephonyProvider interface is used to abstract a concrete telephony provider that can be used to manage calls.

Constants

short TELEPHONY_PROVIDER_TYPE_CS

Represents a circuit switched telephony provider type.

The circuit switched telephony provider type should use network connections that are based on telephony tariffs. Commonly this are GSM or UMTS telephony connections.

short TELEPHONY_PROVIDER_TYPE_PS

Represents a packet switched telephony provider type.

The packet switched telephony provider type should use network connections that are based on data tariffs. Commonly this are telephony connections based on Voice over IP protocols or other IP based voice protocols.

Attributes

DOMString providerName

The telephony provider name.

The telephony provider name that has to provide sufficient information to distinguish between the providers. For example the company name that realizes the connections of the telephony provider.

readonly short type

The type of the telephony provider.

The telephony provider type that is either TELEPHONY_PROVIDER_TYPE_PS or TELEPHONY_PROVIDER_TYPE_CS to distinguish between packet and circuit switched telephony providers.

Methods

init

Initialize the telephony provider.

Signature
PendingOperation init(in SuccessCallback successCallback, in ErrorCallback errorCallback, in TelephonyProviderConfigurationOptions options);

Initializes the telephony provider which usually means that needed connections to the related telephony provider's network are established and the user is allowed to make calls (from the backend point of view).

If using init without any parameters was not successful the user could be ask to enter a user name and password for accessing the telephony provider.

Telephony tariff based telephony providers usually don't need any additional user credentials.

The ErrorCallback receives a DeviceAPIError with code INVALID_ARGUMENT_ERROR if any of the passed in parameters is invalid. The ErrorCallback receives a TelephonyError with code TELEPHONY_PROVIDER_NOT_INITIALIZED if initializing the provider was not successful for any other reason.

Parameters
  • successCallback: The function that is called after successfull initialisation.
  • errorCallback: The function that is called in case of errors.
  • options: Options that may be needed to initialize the telephony provider. Usually these are the user credentials.
Return value
PendingOperation in order to cancel the async call.
API features
http://bondi.omtp.org/api/telephony.init
setIncommingCallEventListener

Sets an event listener to get notifications about incomming calls related to the telephony provider.

Signature
void setIncommingCallEventListener(in OnIncommingCallEvent incommingCallEventListener);

Sets the event listener that receives incomming calls to this telephony provider. If setIncommingCallEventListener is called and a listener was registered before only the newer one will receive incomming calls.

Parameters
  • incommingCallEventListener: The listener that receives incomming calls. Insert NULL to stop notivifications to a previously set listener.
Return value
void
Exceptions
  • SecurityError:

    if receiving calls is not allowed.

  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if input parameters are invalid.

  • TelephonyError:

    if the telephony provider is not initialized.

API features
http://bondi.omtp.org/api/telephony.receivecalls
getMyAddress

Get the own calling address.

Signature
DOMString getMyAddress();

The address is either a valid phone number that follows the e.164 phone number scheme if the associated telephony provider is a circuit switched telephony provider or it should be a valid SIP URI if the associated telephony provider is a packet switched telephony provider.

Return value
DOMString the address under which this provider is callable
Exceptions
  • TelephonyError:

    if the telephony provider is not initialized.

getOngoingCalls

Get all ongoing calls associated to the telephony provider.

Signature
CallArray getOngoingCalls();
Return value
CallArray
Exceptions
  • TelephonyError:

    if the telephony provider is not initialized.

createCall

Creates a call to a calling partner.

Signature
Call createCall(in DOMString callingPartner);

Creating a call object the can be used to manage a call with the passed in calling partner. Creating a call does not mean that the call is established. To establish a call use Call.open().

The passed in calling partner address must be either a valid phone number for Core telephony providers that follows the e.164 phone number scheme or should be valid SIP URI for Data telephony providers.

Parameters
  • callingPartner: The identifier of the calling partner
Return value
Call call object that can be used to manage the call
Exceptions
  • SecurityError:

    if creating calls is not allowed

  • DeviceAPIError:

    if any of the passed-in parameters is invalid

  • TelephonyError:

    if the telephony provider is not initialized.

    if creating a call was not successfull

API features
http://bondi.omtp.org/api/telephony.createcalls
migrateCall

Migrates a call into another call.

Signature
PendingOperation migrateCall(in OnIncommingCallEvent successCallback, in ErrorCallback errorCallback, in Call call);

Migrating a call allows to switch an ongoing call from one telephony provider to another. The returned Call will be in state CALL_STATE_CONNECTED if migrating a call was successful. The passed in call will be terminated if migrating the call was successfull.

The error callback receives a SecurityError if creating a call with this telephony provider is not allowed. It receives a DeviceAPIError with code Unknown_Error if migrating was not succesfull or is not possible. It receives a TelephonyError with code TELEPHONY_PROVIDER_NOT_INITIALIZED if the telephony provider is not initialized befor calling migrateCall. It receives a DeviceAPIError with code INVALID_ARGUMENT_ERROR if any input parameter is invalid.

Parameters
  • successCallback: the callback that receives the migrated call
  • errorCallback: the callback that receives any errors
  • call: The call that will be migrated to another provider
Return value
PendingOperation in order to cancel the asny call
API features
http://bondi.omtp.org/api/telephony.createcalls

3.10. Call

The Call interface to manage a call.

        interface Call {
                
                const short CALL_STATE_IDLE = 0;
                
                const short CALL_STATE_ESTABLISHING = 1;
                
                const short CALL_STATE_CONNECTED = 2;
                
                const short CALL_STATE_CLOSED = 3;
                
                const short CALL_STATE_ON_HOLD = 4;
                
                const short CALL_STATE_RINGING = 5;
                
                attribute short currentState;
                
                attribute DOMStringArray partners;
                
                readonly attribute TelephonyProvider parent;
                
                PendingOperation open(in SuccessCallback successCallback, in ErrorCallback errorCallback);
                
                 PendingOperation reject(SuccessCallback successCallback, ErrorCallback errorCallback);
                
                 PendingOperation close(in SuccessCallback successCallback, in ErrorCallback errorCallback);
                                
                 PendingOperation hold(in SuccessCallback successCallback, in ErrorCallback errorCallback);
                
                 PendingOperation resume(in SuccessCallback successCallback, in ErrorCallback errorCallback);
                
                 PendingOperation join(in SuccessCallback successCallback, in ErrorCallback errorCallback, in Call call);
        };

The call interface represents a telephony call and can be used to manage a call by establishing, closing, holding, and resuming connections with the associated calling partner or calling partners.

Constants

short CALL_STATE_IDLE

State that represents the initial idle state.

short CALL_STATE_ESTABLISHING

State that represents that creating a connection is ongoing.

short CALL_STATE_CONNECTED

State that represents an established call.

short CALL_STATE_CLOSED

State that represents a closed call.

A call can be closed either by calling close on an ongoing call or it can be closed by the calling party. A closed call cannot be established again. Use createCall instead to create a new call.

short CALL_STATE_ON_HOLD

State that represents a holded call.

The call goes into the CALL_STATE_ON_HOLD state if hold was successfully invoked.

short CALL_STATE_RINGING

State that represents an incomming call.

The call goes into the CALL_STATE_CONNECTED state if open was successfully invoked on an incomming call.

Attributes

short currentState

The current state of the call.

DOMStringArray partners

The calling partners associated to the call.

The attribute contains all known calling partners of a call. For example, if joining two calls is successful the list of partners is increased by one new partner.

The calling partner addresses are either a valid phone number that follows the e.164 phone number scheme if the associated telephony provider is a Core telephony provider or it should be valid SIP URIs if the associated telephony provider is a Data telephony provider.

readonly TelephonyProvider parent

The telephony provider associated to the call.

A reference to the telephony provider that has created the call.

Methods

open

Establishs a connection.

Signature
PendingOperation open(in SuccessCallback successCallback, in ErrorCallback errorCallback);

Establisgin a connection either through connecting a calling partner for a created call or through accepting a call for incomming calls. The CALL_STATE_ESTABLISHING event is published to signal that establishing a call is ongoing. If the connection was successfully established the CALL_STATE_CONNECTED is published.

The errorCallback receives a TelephonyError with code TELEPHONY_NOT_ALLOWED_ERROR if opening the call is not allowed which is the case if the call is not in state CALL_STATE_IDLE. It receives a DeviceAPIError with code UNKNOWN_ERROR if the call could not be opened for any reason.

Parameters
  • successCallback: the callback invoked after successful method execution
  • errorCallback: the callback invoked in any error cases
Return value
PendingOperation in order to cancel the async call.
reject

Rejects an incomming call.

Signature
PendingOperation reject(SuccessCallback successCallback, ErrorCallback errorCallback);

A call that was recieved through an OnIncommingCallEvent event can be rejected in order to drop the incomming call and send an on-hook signal. A rejected call moves into the CALL_STATE_CLOSED state.

The errorCallback receives a TelephonyError with code TELEPHONY_NOT_ALLOWED_ERROR if rejecting the call is not allowed which is the case if the call is not in state CALL_STATE_RINGING.

Parameters
  • successCallback: the callback invoked after successful method execution
  • errorCallback: the callback invoked in any error cases
Return value
PendingOperation in order to cancel the async call.
close

Closes a call.

Signature
PendingOperation close(in SuccessCallback successCallback, in ErrorCallback errorCallback);

Closes a call and disconnects from all calling partners. The call moves into the CALL_STATE_CLOSED state.

The errorCallback receives a TelephonyError with code TELEPHONY_NOT_ALLOWED_ERROR if closing the call is not allowed which is the case if the call is not in state CALL_STATE_ON_HOLD or CALL_STATE_CONNECTED.

Parameters
  • successCallback: the callback invoked after successful method execution
  • errorCallback: the callback invoked in any error cases
Return value
PendingOperation in order to cancel the async call.
hold

Holds an ongoing call.

Signature
PendingOperation hold(in SuccessCallback successCallback, in ErrorCallback errorCallback);

A call can be set on hold to create another seperated call or to accept another incomming call without closing an ongoing call. Thus, it is possible to switch between multiple calls.

If an ongoing call can be holded the call moves to the CALL_STATE_ON_HOLD state and publishes an event accordingly.

The errorCallback receives a TelephonyError with code TELEPHONY_NOT_ALLOWED_ERROR if holding the call is not allowed which is the case if the call is not in state CALL_STATE_CONNECTED. It receives a DeviceAPIError with code UNKNOWN_ERROR for any other errors.

Parameters
  • successCallback: the callback invoked after successful method execution
  • errorCallback: the callback invoked in any error cases
Return value
PendingOperation in order to cancel the async call.
resume

Resumes an ongoing call that was previously set to hold the connection.

Signature
PendingOperation resume(in SuccessCallback successCallback, in ErrorCallback errorCallback);

If the call state is CALL_STATE_ON_HOLD it can be resumed. If resuming is successfull the call goes back into the CALL_STATE_CONNECTED state.

The errorCallback receives a TelephonyError with code TELEPHONY_NOT_ALLOWED_ERROR if resuming the call is not allowed which is the case if the call is not in state CALL_STATE_ON_HOLD. It receives a DeviceAPIError with code UNKNOWN_ERROR for any other errors.

Parameters
  • successCallback: the callback invoked after successful method execution
  • errorCallback: the callback invoked in any error cases
Return value
PendingOperation in order to cancel the async call.
join

Adding a new participant to an ongoing call.

Signature
PendingOperation join(in SuccessCallback successCallback, in ErrorCallback errorCallback, in Call call);

Joins two calls into one to create a connection with more than two calling partners. If joining was successfull the joined participant will be added to the list of partners. The passed in call goes into the CALL_STATE_CLOSED event.

The errorCallback receives a TelephonyError with code TELEPHONY_NOT_ALLOWED_ERROR if joining a call is not allowed which is the case if this call is not in state CALL_STATE_CONNECTED or CALL_STATE_ON_HOLD. It receives a DeviceAPIError with code UNKNOWN_ERROR for any other errors.

Parameters
  • successCallback: the callback invoked after successful method execution
  • errorCallback: the callback invoked in any error cases
  • call:
Return value
PendingOperation in order to cancel the async call.

3.11. TelephonyManagerObject

Specifies what is instantiated at feature request

                interface TelephonyManagerObject {
                        readonly attribute TelephonyManager telephony; 
                };
                Bondi implements TelephonyManagerObject;

3.12. LogManager

Call Log Manager API.

                interface LogManager {

                        const unsigned short MISSED_CALLS_FOLDER = 0;

                        const unsigned short RECEIVED_CALLS_FOLDER = 1;

                        const unsigned short INITIATED_CALLS_FOLDER = 2;


                        PendingOperation findLogEntries(in LogManagerSuccessCallback successCallback,
                                        in ErrorCallback errorCallback,
                                        in ShortArray callFolder,
                                        [Optional] in LogFilter filter);

                        unsigned long getNumberOfCalls(in ShortArray callFolders)
                                raises(DeviceAPIError);


                        PendingOperation deleteLogEntry(in SuccessCallback successCallback,
                                        in ErrorCallback errorCallback,
                                        in DOMString callID, in unsigned short folder);

                PendingOperation clearLog(in SuccessCallback successCallback,
                                                                                in ErrorCallback errorCallback,
                                                                                in unsigned short callFolder);
                };

The LogManager interface offers methods to retrieve information from the call registry.

Constants

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.

Methods

findLogEntries

Get the list of selected call log entries

Signature
PendingOperation findLogEntries(in LogManagerSuccessCallback successCallback, in ErrorCallback errorCallback, in ShortArray callFolder, in LogFilter filter);

Gets an array of LogEntry objects for call log entries s stored within the selected folders and matching the selected filter.

The filtering is implemented according to the design patterns (chapter 2.4). If no filter is passed all the calls will be returned.

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.

Errors that can be returned in the ErrorCallback:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function 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
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 look 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.
API features
http://bondi.omtp.org/api/1.1/telephony.log.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 = [];
        callsArray.push(bondi.telephonyLog.MISSED_CALLS_FOLDER);
        callsArray.push(bondi.telephonyLog.RECEIVED_CALLS_FOLDER);
        bondi.telephonyLog.findLogEntries(successCallback,errorCallback,callsArray, {phoneNumber:"+34666666666"});
 
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 = [];
        foldersArray.push(bondi.telephonyLog.MISSED_CALLS_FOLDER);
  var number = bondi.telephonyLog.getNumberOfCalls(foldersArray);
  alert("There are " + number + " missed calls");
 
deleteLogEntry

Deletes all the calls from a call folder

Signature
PendingOperation deleteLogEntry(in SuccessCallback successCallback, in ErrorCallback errorCallback, in DOMString callID, in unsigned short folder);

Errors that can be returned in the ErrorCallback:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function, e.g.if folder isn't one of the following: MISSED_CALLS_FOLDER, RECEIVED_CALLS_FOLDER or INITIATED_CALLS_FOLDER.
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.
  • callID: Call identifier
  • folder: 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.
API features
http://bondi.omtp.org/api/1.1/telephony.log.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 for the specified callid
        bondi.telephonyLog.deleteLogEntry(successCallback,errorCallback, callid, bondi.telephonyLog.MISSED_CALLS_FOLDER);
 
clearLog

Deletes all the calls from a call folder

Signature
PendingOperation clearLog(in SuccessCallback successCallback, in ErrorCallback errorCallback, in unsigned short callFolder);

Errors that may be returned in the ErrorCallback:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if a malformed argument has been supplied or a required argument has been omitted.
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 entries 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.
API features
http://bondi.omtp.org/api/1.1/telephony.log.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 = [];
                callsArray.push(bondi.telephonyLog.MISSED_CALLS_FOLDER);
                callsArray.push(bondi.telephonyLog.RECEIVED_CALLS_FOLDER);
                bondi.telephonyLog.clearLog(successCallback,errorCallback, callsArray);
 

3.13. LogEntry

Encapsulation of a call log entry on the device.

                [NoInterfaceObject] interface LogEntry {
                        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.telephonyLog.findLogEntries(successCallback, errorCallback,
                [ bondi.telephonyLog.MISSED_CALLS_FOLDER ],
                { phoneNumber:"+34666666666"});
 

Attributes

readonly DOMString phoneNumber

Phone number
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.telephonyLog.findLogEntries(successCallback, errorCallback,
                [ bondi.telephonyLog.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.telephonyLog.findLogEntries(successCallback, errorCallback,
                [ bondi.telephonyLog.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.telephonyLog.findLogEntries(successCallback, errorCallback,
                [ bondi.telephonyLog.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.telephonyLog.findLogEntries(successCallback, errorCallback,
                [ bondi.telephonyLog.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.telephonyLog.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.telephonyLog.findLogEntries(successCallback, errorCallback,
                [ bondi.telephonyLog.MISSED_CALLS_FOLDER ],
                { phoneNumber:"+34666666666"});
 

3.14. LogFilter

Used for perform search operations in the Call Log

                [NoInterfaceObject, Callback] interface LogFilter : GenericFilter {
                        
                };

This interface is intended to be used for input parameters for call searching (findLogEntries). Interface used for creation of the Filter objects depending on the CallProperties interface 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.telephonyLog.findLogEntries(successCallback, errorCallback,
                [ bondi.telephonyLog.RECEIVED_CALLS_FOLDER ],
                { phoneNumber:"+34666666666"});
 

3.15. LogManagerObject

Specifies what is instantiated at feature request

                interface LogManagerObject {
                        readonly attribute LogManager telephonyLog;
                };
                Bondi implements LogManagerObject;