
© 2009-2010 OMTP Ltd. All rights reserved. OMTP and OMTP BONDI are registered trademarks of OMTP Ltd.
The BONDI Telephony API.
CallArray
TelephonyProviderArray
LogEntries
TelephonyProviderSuccessCallback
TelephonyErrorCallback
OnIncommingCallEvent
OnCallStateEvent
LogManagerSuccessCallback
TelephonyError
TelephonyProviderConfigurationOptions
TelephonyManager
TelephonyProvider
Call
TelephonyManagerObject
LogManager
LogEntry
LogFilter
LogManagerObject
| 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 |
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.
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.
All the telephony features
Includes API features:
http://bondi.omtp.org/api/1.1/telephony.log.gethttp://bondi.omtp.org/api/1.1/telephony.log.deleteThis 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
http://bondi.omtp.org/api/telephony.call
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
http://bondi.omtp.org/api/1.1/telephony.log.gethttp://bondi.omtp.org/api/1.1/telephony.log.delete
is successfully requested, the interface
LogManager
is instantiated, and the resulting object appears in the global
namespace as
Bondi.telephonyLog.
Initiating outgoing telephony calls.
Device capabilities:
telephony.createcallsReceiving incomming calls.
Device capabilities:
telephony.receivecallsAccessing available telephony providers.
Device capabilities:
telephony.readSetting the default telephony provider.
Device capabilities:
telephony.writeCall to CallManager.findLogEntries
Device capabilities:
telephony.log.getCall to CallManager.deleteLogEntry and CallManager.clearLog
Device capabilities:
telephony.log.deletetelephony.createcallsInitiating outgoing telephony calls.
telephony.receivecallsReceiving incomming calls.
telephony.readAccessing available telephony providers.
telephony.writeSetting the default telephony provider.
telephony.log.getGet entries from call log
Security parameters:
folders:
Space-separated list of folder identifiers from which the call entries are to be retrieved.
telephony.log.deleteDelete call log entries from a log
Security parameters:
folder:
Folder identifier from which the call log entry/entries is/are to be deleted.
CallArray
Array that contains a set of calls.
typedef sequence<Call> CallArray;
TelephonyProviderArray
Array that contains a set of telephony providers.
typedef sequence<Call> TelephonyProviderArray;
LogEntries
Array of call log entries.
typedef sequence<LogEntry> LogEntries;
TelephonyProviderSuccessCallback
Callback to receive the available telephony providers.
[Callback=FunctionOnly, NoInterfaceObject] interface TelephonyProviderSuccessCallback {
void onSuccess(in TelephonyProviderArray telephonyProviders);
};
onSuccessThe success callback handler for retrieved telephony providers.
void onSuccess(in TelephonyProviderArray telephonyProviders);
TelephonyErrorCallback
Callback to receive Telephony API specific Errors.
[Callback=FunctionOnly, NoInterfaceObject] interface TelephonyErrorCallback {
void onError(in TelephonyError error);
};
onErrorThe error callback handler for telephony errors.
void onError(in TelephonyError error);
OnIncommingCallEvent
Callback to receive incomming call events.
[Callback=FunctionOnly, NoInterfaceObject] interface OnIncommingCallEvent{
void onEvent(in Call incommingCall);
};
onEventThe notification callback handler for managing incomming calls.
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.
OnCallStateEvent
Callback to receive call events.
[Callback=FunctionOnly, NoInterfaceObject] interface OnCallStateEvent{
void onEvent(in Call call, in short event);
};
onEventThe call event handler for call related notivications.
void onEvent(in Call call, in short event);
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.
onSuccessMethod invoked when a list of calls is retrieved successfully
void onSuccess(in LogEntries obj);
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.
unsigned short TELEPHONY_PROVIDER_UNAVAILABLE_ERRORError thrown if the default telephony provider is unavailable.
unsigned short TELEPHONY_NOT_ALLOWED_ERRORError thrown if a call function is not allowed.
unsigned short TELEPHONY_PROVIDER_NOT_INITIALIZEDError thrown if a telephony provider to use is not initialized.
TelephonyProviderConfigurationOptions
Telephony provider configuration options.
interface TelephonyProviderConfigurationOptions {
attribute DOMString userName;
attribute DOMString password;
};
DOMString userNameThe user identifier needed to access a specific telephony provider.
DOMString passwordThe password needed to access a specific telephony provider.
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.
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);
}
getTelephonyProvidersGets a list of availabe telephony providers.
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.
getDefaultProviderGets the default telephony provider.
TelephonyProvider getDefaultProvider();
Get the default telephony provider that is commonly used on the device.
setDefaultProviderSets the default telephony provider.
boolean setDefaultProvider(in TelephonyProvider provider);
if setting a new default telephony provider is not allowed
INVALID_ARGUMENT_ERROR if input parameters are invalid.
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.
short TELEPHONY_PROVIDER_TYPE_CSRepresents 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_PSRepresents 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.
DOMString providerNameThe 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 typeThe 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.
initInitialize the telephony provider.
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.
setIncommingCallEventListenerSets an event listener to get notifications about incomming calls related to the telephony provider.
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.
if receiving calls is not allowed.
INVALID_ARGUMENT_ERROR if input parameters are invalid.
if the telephony provider is not initialized.
getMyAddressGet the own calling address.
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.
if the telephony provider is not initialized.
getOngoingCallsGet all ongoing calls associated to the telephony provider.
CallArray getOngoingCalls();
if the telephony provider is not initialized.
createCallCreates a call to a calling partner.
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.
if creating calls is not allowed
if any of the passed-in parameters is invalid
if the telephony provider is not initialized.
if creating a call was not successfull
migrateCallMigrates a call into another call.
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.
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.
short CALL_STATE_IDLEState that represents the initial idle state.
short CALL_STATE_ESTABLISHINGState that represents that creating a connection is ongoing.
short CALL_STATE_CONNECTEDState that represents an established call.
short CALL_STATE_CLOSEDState 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_HOLDState that represents a holded call.
The call goes into the CALL_STATE_ON_HOLD state if hold was successfully invoked.
short CALL_STATE_RINGINGState that represents an incomming call.
The call goes into the CALL_STATE_CONNECTED state if open was successfully invoked on an incomming call.
short currentStateThe current state of the call.
DOMStringArray partnersThe 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 parentThe telephony provider associated to the call.
A reference to the telephony provider that has created the call.
openEstablishs a connection.
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.
rejectRejects an incomming call.
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.
closeCloses a call.
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.
holdHolds an ongoing call.
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.
resumeResumes an ongoing call that was previously set to hold the connection.
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.
joinAdding a new participant to an ongoing call.
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.
TelephonyManagerObject
Specifies what is instantiated at feature request
interface TelephonyManagerObject {
readonly attribute TelephonyManager telephony;
};
Bondi implements TelephonyManagerObject;
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.
unsigned short MISSED_CALLS_FOLDERFolder of missed calls.
unsigned short RECEIVED_CALLS_FOLDERFolder with received calls.
unsigned short INITIATED_CALLS_FOLDERFolder with initiated calls.
findLogEntriesGet the list of selected call log entries
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:
// 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"});
getNumberOfCallsGet the number of calls in a call folder
unsigned long getNumberOfCalls(in ShortArray callFolders);
Gets the number of calls contained in the folders passed as input argument.
INVALID_ARGUMENT_ERROR if parameters are not valid
var foldersArray = [];
foldersArray.push(bondi.telephonyLog.MISSED_CALLS_FOLDER);
var number = bondi.telephonyLog.getNumberOfCalls(foldersArray);
alert("There are " + number + " missed calls");
deleteLogEntryDeletes all the calls from a call folder
PendingOperation deleteLogEntry(in SuccessCallback successCallback, in ErrorCallback errorCallback, in DOMString callID, in unsigned short folder);
Errors that can be returned in the ErrorCallback:
// 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);
clearLogDeletes all the calls from a call folder
PendingOperation clearLog(in SuccessCallback successCallback, in ErrorCallback errorCallback, in unsigned short callFolder);
Errors that may be returned in the ErrorCallback:
// 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);
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;
};
// 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"});
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.
// 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.
// 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.
// 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 idCall identifier String containing the unique id of the call within the platform.
This attribute is read-only.
// 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 folderfolder 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.
// 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"});
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
// 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"});
LogManagerObject
Specifies what is instantiated at feature request
interface LogManagerObject {
readonly attribute LogManager telephonyLog;
};
Bondi implements LogManagerObject;