WebAPI/WebTelephony: Difference between revisions
< WebAPI
Jump to navigation
Jump to search
No edit summary |
|||
| Line 1: | Line 1: | ||
== Proposed API == | == Proposed API == | ||
| Line 17: | Line 7: | ||
attribute boolean speakerOn; | attribute boolean speakerOn; | ||
attribute double speakerVolume; | attribute double speakerVolume; | ||
attribute boolean doNotDisturb; // Automatically drops calls. Not sure if needed. Only seems needed | |||
// if supported as a network feature. | |||
attribute any active; // Either a call or a group | attribute any active; // Either a call or a group | ||
| Line 45: | Line 37: | ||
void answer(); // Should this make the call the active one? | void answer(); // Should this make the call the active one? | ||
void | void disconnect(); | ||
// void hold(); Not sure if needed for now. We might need to remake group APi to make it async | |||
// void resume(); | |||
} | |||
[Constructor()] | [Constructor()] | ||
Revision as of 22:35, 2 November 2011
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 boolean doNotDisturb; // Automatically drops calls. Not sure if needed. Only seems needed
// if supported as a network feature.
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 disconnect();
// void hold(); Not sure if needed for now. We might need to remake group APi to make it async
// void resume();
}
[Constructor()]
interface CallGroup {
TelephonyCall item(unsigned long index);
readonly attribute unsigned long length;
}
interface CallEvent : Event {
readonly attribute TelephonyCall call;
}