WebAPI/WebTelephony: Difference between revisions
< WebAPI
Jump to navigation
Jump to search
(mention that data calls also need to be included as well as voice calls) |
Bent.mozilla (talk | contribs) |
||
Line 9: | Line 9: | ||
attribute boolean muted; // Should these live on the call/group? | attribute boolean muted; // Should these live on the call/group? | ||
attribute boolean speakerOn; | attribute boolean speakerOn; | ||
attribute any active; // | attribute any active; // Active call, for now. Could be a group in the future. | ||
readonly attribute TelephonyCall[] | readonly attribute TelephonyCall[] calls; | ||
void startTone(DOMString tone); | void startTone(DOMString tone); | ||
Line 30: | Line 26: | ||
readonly attribute DOMString number; | readonly attribute DOMString number; | ||
readonly attribute DOMString | readonly attribute DOMString state; | ||
// "dialing", "ringing", "busy", "connecting", "connected", "disconnecting", "disconnected", "incoming" | // "dialing", "ringing", "busy", "connecting", "connected", "disconnecting", "disconnected", "incoming" | ||
attribute Function | attribute Function onstatechange; | ||
attribute Function onringing; | attribute Function onringing; | ||
attribute Function onbusy; | attribute Function onbusy; | ||
Line 43: | Line 39: | ||
void answer(); // Should this make the call the active one? | void answer(); // Should this make the call the active one? | ||
void disconnect(); | void disconnect(); | ||
} | } | ||
Revision as of 23:23, 10 January 2012
Proposed API
(lkcl29dec11: remember also to include data calls as well as voice calls, so that internet access can be initiated)
navigator.telephony would return an object with the following interface
interface Telephony : EventTarget { TelephonyCall dial(DOMString number); // Returns a object in "dialing" state attribute boolean muted; // Should these live on the call/group? attribute boolean speakerOn; attribute any active; // Active call, for now. Could be a group in the future. readonly attribute TelephonyCall[] calls; void startTone(DOMString tone); void stopTone(); void sendTones(DOMString tones, [optional] unsigned long toneDuration, [optional] unsigned long intervalDuration); attribute Function onincoming; } interface TelephonyCall : EventTarget { readonly attribute DOMString number; readonly attribute DOMString state; // "dialing", "ringing", "busy", "connecting", "connected", "disconnecting", "disconnected", "incoming" attribute Function onstatechange; attribute Function onringing; attribute Function onbusy; attribute Function onconnecting; attribute Function onconnected; attribute Function ondisconnecting; attribute Function ondisconnected; void answer(); // Should this make the call the active one? void disconnect(); } interface CallEvent : Event { readonly attribute TelephonyCall call; }