WebAPI/WebTelephony: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
== Proposed API ==
<h2> Proposed API </h2>
 
<p>(lkcl29dec11: remember also to include data calls as well as voice calls, so that internet access can be initiated)
(lkcl29dec11: remember also to include data calls as well as voice calls, so that internet access can be initiated)
</p><p>navigator.telephony would return an object with the following interface
 
</p>
navigator.telephony would return an object with the following interface
<pre class="_fck_mw_lspace"> interface Telephony&#160;: EventTarget {
 
  TelephonyCall dial(DOMString number); // Returns a object in &quot;dialing&quot; state
  interface Telephony : EventTarget {
  attribute boolean muted;          // Should these live on the call/group?
    TelephonyCall dial(DOMString number); // Returns a object in "dialing" state
  attribute boolean speakerEnabled;
    attribute boolean muted;          // Should these live on the call/group?
    attribute boolean speakerEnabled;
  attribute any active; // Active call, for now. Could be a group in the future.
 
    attribute any active; // Active call, for now. Could be a group in the future.
  readonly attribute TelephonyCall[] calls;
 
    readonly attribute TelephonyCall[] calls;
  void startTone(DOMString tone);
 
  void stopTone();
    void startTone(DOMString tone);
    void stopTone();
  attribute Function onincoming;
 
  attribute Function oncallschanged;
    attribute Function onincoming;
}
    attribute Function oncallschanged;
  }
interface TelephonyCall&#160;: EventTarget {
 
  readonly attribute DOMString number;
  interface TelephonyCall : EventTarget {
    readonly attribute DOMString number;
  readonly attribute DOMString state;
 
  // &quot;dialing&quot;, &quot;ringing&quot;, &quot;busy&quot;, &quot;connecting&quot;, &quot;connected&quot;, &quot;disconnecting&quot;, &quot;disconnected&quot;, &quot;incoming&quot;
    readonly attribute DOMString state;
    // "dialing", "ringing", "busy", "connecting", "connected", "disconnecting", "disconnected", "incoming"
  attribute Function onstatechange;
 
  attribute Function onringing;
    attribute Function onstatechange;
  attribute Function onbusy;
    attribute Function onringing;
  attribute Function onconnecting;
    attribute Function onbusy;
  attribute Function onconnected;
    attribute Function onconnecting;
  attribute Function ondisconnecting;
    attribute Function onconnected;
  attribute Function ondisconnected;
    attribute Function ondisconnecting;
 
    attribute Function ondisconnected;
  void answer(); // Should this make the call the active one?
   
  void hangUp();
    void answer(); // Should this make the call the active one?
}
    void hangUp();
  }
interface CallEvent&#160;: Event {
 
  readonly attribute TelephonyCall call;
  interface CallEvent : Event {
}
    readonly attribute TelephonyCall call;
</pre>
  }

Revision as of 06:41, 20 March 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 speakerEnabled;
 
   attribute any active; // Active call, for now. Could be a group in the future.
 
   readonly attribute TelephonyCall[] calls;
 
   void startTone(DOMString tone);
   void stopTone();
 
   attribute Function onincoming;
   attribute Function oncallschanged;
 }
 
 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 hangUp();
 }
 
 interface CallEvent : Event {
   readonly attribute TelephonyCall call;
 }