Confirmed users
978
edits
(→Proposal: WebTelephony API for Multi-SIM: WebAPI update) |
|||
Line 5: | Line 5: | ||
== Proposal: WebTelephony API for Multi-SIM == | == Proposal: WebTelephony API for Multi-SIM == | ||
Currently B2G supports a single SIM architecture. This proposal wants to extend it for supporting multi-SIMs. | Currently B2G supports a single SIM architecture. This proposal wants to extend it for supporting multi-SIMs and also takes single SIM scenario into account. | ||
The improvement is quite simple that adding an optional paramter in dial() function. | |||
=== Web API === | === Web API === | ||
interface | interface nsIDOMTelephony: nsIDOMEventTarget | ||
{ | { | ||
attribute boolean muted; | attribute boolean muted; | ||
attribute boolean speakerEnabled; | attribute boolean speakerEnabled; | ||
readonly attribute long numServices; | |||
// Calls existing in all the | // Calls existing in all the services. | ||
readonly attribute jsval calls; | readonly attribute jsval calls; | ||
// The call that is "active", i.e. receives microphone input and tones | // The call that is "active", i.e. receives microphone input and tones | ||
// generated via startTone. | // generated via startTone. | ||
readonly attribute jsval active; | readonly attribute jsval active; | ||
nsIDOMTelephonyCall dial(in DOMString number, [optional] in unsigned long serviceId); | |||
naIDOMTelephonyCall dialEmergency(in DOMString number, [optional] in unsigned long serviceId); | |||
void startTone(in DOMString tone, [optional] in unsigned long serviceId); | |||
void stopTone([optional] in unsigned long serviceId); | |||
void startTone(in DOMString tone); | |||
void stopTone(); | |||
attribute nsIDOMEventListener onincoming; | attribute nsIDOMEventListener onincoming; | ||
Line 44: | Line 36: | ||
interface nsIDOMTelephonyCall: nsIDOMEventTarget | interface nsIDOMTelephonyCall: nsIDOMEventTarget | ||
{ | { | ||
// Indicate which service the call comes from. | |||
readonly attribute unsigned long serviceId; /* new attribute */ | |||
readonly attribute DOMString number; | readonly attribute DOMString number; | ||
Line 51: | Line 45: | ||
readonly attribute nsIDOMDOMError error; | readonly attribute nsIDOMDOMError error; | ||
// Functions to mediate a call. | // Functions to mediate a call. | ||
Line 86: | Line 77: | ||
*Multi-SIMs | *Multi-SIMs | ||
navigator. | navigator.mozTelephony.dial(number) // Use default service to make a call | ||
navigator. | navigator.mozTelephony.dial(number, serviceId) | ||
==== Incoming Call ==== | ==== Incoming Call ==== | ||
Line 93: | Line 84: | ||
*Current B2G (Single SIM) | *Current B2G (Single SIM) | ||
tel = navigator.mozTelephony; | |||
*Multi-SIMs | *Multi-SIMs | ||
tel = navigator.mozTelephony; | |||
Once the telephony object is obtained, the following work remains the same. We | Once the telephony object is obtained, the following work remains the same. We get notified when an incoming call occurs in any of services. | ||
tel.addEventListener('incoming'); | |||
tel.onincoming = function onincoming (evt) { | |||
incoming = evt.call; }; | incoming = evt.call; }; | ||
incoming.answer(); | incoming.answer(); | ||
=== Implementation Details === | === Implementation Details === |