WebAPI/WebTelephony
< WebAPI
Jump to navigation
Jump to search
Goals
Our first goal is to create a low-level API for "plain" telephony. I.e. not SIP or other VoIP calls. This is because plain telephony is still the main use case for most users. While we long term will want to have APIs for things like SIP, it's likely that those APIs will look substantially different since the capabilities there are much more advanced.
It's possible that we will want to have a higher level API which abstracts over POTS and VoIP, but that's something we should focus on once we have the lower level pieces in place. See also the discussion here.
Status
There are some rudamentory patches in bug 674726, but they don't implement much of what we need yet.
Proposed API
navigator.telephony would return an object with the following interface
interface Telephony : EventTarget { attribute boolean muted; // Should these live on the call/group? attribute boolean speakerOn; attribute double speakerVolume; attribute any active; // Either a call or a group readonly attribute TelephonyCall[] liveCalls; readonly attribute CallGroup[] liveGroups; void startTone(DOMString tone); void stopTone(); void sendTones(DOMString tones, [optional] unsigned long toneDuration, [optional] unsigned long intervalDuration); attribute Function onincoming; } [Constructor(DOMString)] interface TelephonyCall : EventTarget { readonly attribute DOMString number; readonly attribute DOMString readyState; // "calling", "incomming", "connected", "closed", "busy" // Can we get info on when a call goes from "trying to place call" to "calling"? attribute Function onconnect; attribute Function ondisconnect; attribute Function onbusy; attribute CallGroup? group; void answer(); // Should this make the call the active one? void hangUp(); } [Constructor()] interface CallGroup { TelephonyCall item(unsigned long index); readonly attribute unsigned long length; } interface CallEvent : Event { readonly attribute TelephonyCall call; }