sysapps / telephony

API to manage telephony calls
15 stars 12 forks source link

consider using telephony service objects #205

Open zolkis opened 11 years ago

zolkis commented 11 years ago

Consider using explicit telephony service objects, exposing functionality specific to a service (SIM). Connected to #203, #125, #128. For the proposal, see: https://etherpad.mozilla.org/O0KQaiKEhN

hsinyi commented 11 years ago

Hi there,

Discussion mozilla had before:

[1] is the very original proposal from my side that looks similar to Zoltan's proposal for using telephony service objects [2] and [3] are Jonas' reply to [1] and the reasons that we chose dial() with serviceId

[1] https://groups.google.com/forum/#!searchin/mozilla.dev.webapi/multi-sim/mozilla.dev.webapi/ZmFvU47eSvA/qbhQVF18mNwJ [2] https://groups.google.com/d/msg/mozilla.dev.webapi/1tPzEIftZ24/dbx68uGpkkkJ [3] irc discussion: Search "hsinyi" and you will find the records. http://logbot.glob.com.au/?c=mozilla%23b2g&s=16+Mar+2013&e=23+Mar+2013

Thanks!

hsinyi commented 11 years ago

Mozilla's IccManager API: http://mxr.mozilla.org/mozilla-central/source/dom/icc/interfaces/

zolkis commented 11 years ago

On one hand, there is the wish to have a simple API that can handle most of the developer use cases, on the other hand the API should be correctly aligned with how telephony works.

The developer use case is mainly writing a dialer. So the target developers are not in the range of millions, but rather in tens or hundreds, most likely familiar with telephony. It is a good goal to lower the threshold for writing a dialer, but the app developer still needs to understand basic concepts of telephony.

There are multiple domains of abstractions in Telephony:

Arguably the best abstraction of the telephony domain for GSM and CDMA is provided by the oFono project: http://git.kernel.org/cgit/network/ofono/ofono.git/tree/doc In particular, watch how developers are supposed to track:

This proposal takes the modem abstraction and generalizes it into a TelephonyService object. A given device can make phone calls in the following ways:

Some of the problems a generic telephony API faces:

The approach taken by Mozilla seems to be the following:

However, having a simple API is a good goal. On the F2F there was agreement that

A TelephonyService object defines the minimal number of properties needed:

In order to maintain a simple interface for developers who don't care about different telephony services (e.g. multiple SIM support), the API could be kept simple by defining the navigator.telephony object as the default TelephonyService object, and having a separate TelephonyManager interface for exposing the more complex functionality. See these changes on: https://etherpad.mozilla.org/O0KQaiKEhN

However, since this API is meant for dialer developers, I argue that the target audience of this API should definitely be interested in the full functionality of this API. Differences may be in what telephony services are going to be supported by the various apps, but not much differences elsewhere. If this is true, the previous revision of the API may also be good enough: https://etherpad.mozilla.org/ep/pad/view/O0KQaiKEhN/Zf2VbFCaQM


[1] Related issues: #204 #137 #53 #124 #21, #83 Notes on CDMA 3-way calling: https://github.com/zolkis/telephony/commit/cdc3590ba9fde8cb6de9c9299ed110a10faec7a1

zolkis commented 11 years ago

See also https://groups.google.com/d/msg/mozilla.dev.webapi/1tPzEIftZ24/ZLdOQfpDLBIJ

zolkis commented 10 years ago

See also #208 . During prototyping for that use case it turned out that using serviceId's made it easier to handle/implement /arbitrary call merges using the ConferenceCall object, and therefore it is the better choice for dial() type of methods. However, TelephonyService objects are needed for handling other cellular interfaces than call management, and for supporting various modem types. These concepts are implemented in https://rawgithub.com/sysapps/telephony/gh-pages/index2.html .