1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * The possible values of TTY mode.
10 * "off" - indicating TTY mode is disabled.
11 * "full" - indicating both hearing carryover and voice carryover are enabled.
12 * "hco" - indicating hearing carryover is enabled.
13 * "vco" - indicating voice carryover is enabled.
15 enum TtyMode { "off", "full", "hco", "vco" };
17 [Pref="dom.telephony.enabled"]
18 interface Telephony : EventTarget {
20 * There are multiple telephony services in multi-sim architecture. We use
21 * |serviceId| to indicate the target telephony service. If not specified,
22 * the implementation MUST use the default service.
24 * Possible values of |serviceId| are 0 ~ (number of services - 1), which is
25 * simply the index of a service. Get number of services by acquiring
26 * |navigator.mozMobileConnections.length|.
30 * Make a phone call or send the mmi code depending on the number provided.
32 * TelephonyCall - for call setup
33 * MMICall - for MMI code
36 Promise<(TelephonyCall or MMICall)> dial(DOMString number, optional unsigned long serviceId);
39 Promise<TelephonyCall> dialEmergency(DOMString number, optional unsigned long serviceId);
42 * Send a series of DTMF tones.
46 * @param pauseDuraton (ms) [optional]
47 * Time to wait before sending tones. Default value is 3000 ms.
48 * @param toneDuration (ms) [optional]
49 * Duration of each tone. Default value is 70 ms.
50 * @param serviceId [optional]
51 * Default value is as user setting dom.telephony.defaultServiceId.
54 Promise<void> sendTones(DOMString tones, optional unsigned long pauseDuration = 3000, optional unsigned long toneDuration = 70, optional unsigned long serviceId);
57 void startTone(DOMString tone, optional unsigned long serviceId);
60 void stopTone(optional unsigned long serviceId);
63 attribute boolean muted;
66 attribute boolean speakerEnabled;
69 attribute TtyMode ttyMode;
71 readonly attribute (TelephonyCall or TelephonyCallGroup)? active;
73 // A call is contained either in Telephony or in TelephonyCallGroup.
74 readonly attribute CallsList calls;
75 readonly attribute TelephonyCallGroup conferenceGroup;
77 // Async notification that object initialization is done.
79 readonly attribute Promise<void> ready;
81 attribute EventHandler onincoming;
82 attribute EventHandler oncallschanged;
83 attribute EventHandler onremoteheld;
84 attribute EventHandler onremoteresumed;