2013-07-15 12:27:19 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
2013-09-14 23:46:35 +04:00
|
|
|
[Pref="dom.telephony.enabled"]
|
2013-07-15 12:27:19 +04:00
|
|
|
interface Telephony : EventTarget {
|
2013-10-31 16:05:50 +04:00
|
|
|
/**
|
|
|
|
* There are multiple telephony services in multi-sim architecture. We use
|
|
|
|
* |serviceId| to indicate the target telephony service. If not specified,
|
|
|
|
* the implementation MUST use the default service.
|
|
|
|
*
|
|
|
|
* Possible values of |serviceId| are 0 ~ (number of services - 1), which is
|
|
|
|
* simply the index of a service. Get number of services by acquiring
|
|
|
|
* |navigator.mozMobileConnections.length|.
|
|
|
|
*/
|
|
|
|
|
2014-09-22 09:33:00 +04:00
|
|
|
/**
|
|
|
|
* Make a phone call or send the mmi code depending on the number provided.
|
|
|
|
*
|
|
|
|
* TelephonyCall - for call setup
|
2014-11-11 12:15:31 +03:00
|
|
|
* MMICall - for MMI code
|
2014-09-22 09:33:00 +04:00
|
|
|
*/
|
2014-07-19 05:31:11 +04:00
|
|
|
[Throws]
|
2014-11-11 12:15:31 +03:00
|
|
|
Promise<(TelephonyCall or MMICall)> dial(DOMString number, optional unsigned long serviceId);
|
2013-10-31 16:05:50 +04:00
|
|
|
|
2014-07-19 05:31:11 +04:00
|
|
|
[Throws]
|
2014-08-01 07:50:30 +04:00
|
|
|
Promise<TelephonyCall> dialEmergency(DOMString number, optional unsigned long serviceId);
|
2013-10-30 23:06:38 +04:00
|
|
|
|
2015-01-07 09:37:03 +03:00
|
|
|
/**
|
|
|
|
* Send a series of DTMF tones.
|
|
|
|
*
|
|
|
|
* @param tones
|
|
|
|
* DTMF chars.
|
|
|
|
* @param pauseDuraton (ms) [optional]
|
|
|
|
* Time to wait before sending tones. Default value is 3000 ms.
|
|
|
|
* @param toneDuration (ms) [optional]
|
|
|
|
* Duration of each tone. Default value is 70 ms.
|
|
|
|
* @param serviceId [optional]
|
|
|
|
* Default value is as user setting dom.telephony.defaultServiceId.
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
Promise<void> sendTones(DOMString tones, optional unsigned long pauseDuration = 3000, optional unsigned long toneDuration = 70, optional unsigned long serviceId);
|
|
|
|
|
2013-10-31 16:05:50 +04:00
|
|
|
[Throws]
|
2013-10-31 16:05:50 +04:00
|
|
|
void startTone(DOMString tone, optional unsigned long serviceId);
|
2013-10-31 16:05:50 +04:00
|
|
|
|
|
|
|
[Throws]
|
2013-10-31 16:05:50 +04:00
|
|
|
void stopTone(optional unsigned long serviceId);
|
2013-10-31 16:05:50 +04:00
|
|
|
|
2013-07-15 12:27:19 +04:00
|
|
|
[Throws]
|
|
|
|
attribute boolean muted;
|
2013-10-31 16:05:50 +04:00
|
|
|
|
2013-07-15 12:27:19 +04:00
|
|
|
[Throws]
|
|
|
|
attribute boolean speakerEnabled;
|
|
|
|
|
2013-07-20 10:46:35 +04:00
|
|
|
readonly attribute (TelephonyCall or TelephonyCallGroup)? active;
|
2013-07-15 12:27:19 +04:00
|
|
|
|
2013-07-20 10:46:35 +04:00
|
|
|
// A call is contained either in Telephony or in TelephonyCallGroup.
|
2013-07-15 12:27:19 +04:00
|
|
|
readonly attribute CallsList calls;
|
2013-07-20 10:46:35 +04:00
|
|
|
readonly attribute TelephonyCallGroup conferenceGroup;
|
2013-07-15 12:27:19 +04:00
|
|
|
|
2014-12-17 01:57:23 +03:00
|
|
|
// Async notification that object initialization is done.
|
|
|
|
[Throws]
|
|
|
|
readonly attribute Promise<void> ready;
|
2014-07-21 21:17:00 +04:00
|
|
|
|
2013-07-15 12:27:19 +04:00
|
|
|
attribute EventHandler onincoming;
|
|
|
|
attribute EventHandler oncallschanged;
|
|
|
|
attribute EventHandler onremoteheld;
|
|
|
|
attribute EventHandler onremoteresumed;
|
|
|
|
};
|