WebAPI/WebTelephony: Difference between revisions

Proposal (v2): telephony call states to support call holding
(Proposal: telephony call states to support call holding)
(Proposal (v2): telephony call states to support call holding)
Line 56: Line 56:
=== Proposal: Enhance WebTelephony API to hold a call  ===
=== Proposal: Enhance WebTelephony API to hold a call  ===


   interface nsIDOMTelephony : nsIDOMEventTarget
   interface nsIDOMTelephony : nsIDOMEventTarget
  {
{
    nsIDOMTelephonyCall dial(in DOMString number);
  nsIDOMTelephonyCall dial(in DOMString number);
 
  attribute boolean muted;
  attribute boolean speakerEnabled;
 
  // The call that is "active", i.e. receives microphone input and tones
  // generated via startTone.
  readonly attribute jsval active;
 
  // Array of all calls that are currently connected.
  readonly attribute jsval calls;
 
  void startTone(in DOMString tone);
  void stopTone();
 
  attribute nsIDOMEventListener onincoming;
  attribute nsIDOMEventListener oncallschanged;
};
 
interface nsIDOMTelephonyCall : nsIDOMEventTarget
{
  readonly attribute DOMString number;
    
    
    attribute boolean muted;
  // "dialing", "ringing", "busy", "connecting", "connected", "disconnecting", "disconnected", "incoming"
    attribute boolean speakerEnabled;
  // Add new states: "holding", "held", "resuming"
  readonly attribute DOMString state;
  void answer();
  void hangUp();
    
    
    // The call that is "active", i.e. receives microphone input and tones
   //make a "connected" call into "held"
    // generated via startTone.
   void holdCall();  
    readonly attribute jsval active;
  //make a "held" call back to "connected"
    
  void resumeCall();  
    // Array of all calls that are currently connected.
 
    readonly attribute jsval calls;
   attribute nsIDOMEventListener onstatechange;
 
 
    void startTone(in DOMString tone);
   attribute nsIDOMEventListener ondialing;
    void stopTone();
  attribute nsIDOMEventListener onringing;
 
  attribute nsIDOMEventListener onbusy;
    attribute nsIDOMEventListener onincoming;
  attribute nsIDOMEventListener onconnecting;
    attribute nsIDOMEventListener onwaiting; //new
  attribute nsIDOMEventListener onconnected;
    attribute nsIDOMEventListener oncallschanged;
  attribute nsIDOMEventListener ondisconnecting;
  };
  attribute nsIDOMEventListener ondisconnected;
 
 
  interface nsIDOMTelephonyCall : nsIDOMEventTarget
   // attribute nsIDOMEventListener onincoming;
  {
  /* new events */
    readonly attribute DOMString number;
  attribute nsIDOMEventListener onholding;  
    readonly attribute DOMString state;
  attribute nsIDOMEventListener onheld;  
    // "dialing", "ringing", "busy", "connecting", "connected", "disconnecting", "disconnected", "incoming",
  attribute nsIDOMEventListener onresuming;  
    // Add new states: "waiting", "holding", "held", "resuming"
};
    
    void answer(); //make an incoming call or a waiting call into
    //"connected"
    void hangUp();
    void holdCal(); //change a connected call into "held"
    void resumeCall(); //change a "held" call into connected
    
    attribute nsIDOMEventListener onstatechange;
    
    attribute nsIDOMEventListener ondialing;
    attribute nsIDOMEventListener onringing;
    attribute nsIDOMEventListener onbusy;
    attribute nsIDOMEventListener onconnecting;
    attribute nsIDOMEventListener onconnected;
    attribute nsIDOMEventListener ondisconnecting;
    attribute nsIDOMEventListener ondisconnected;
    
    // attribute nsIDOMEventListener onincoming;
    attribute nsIDOMEventListener onholding; //new
    attribute nsIDOMEventListener onheld; //new
    attribute nsIDOMEventListener onresuming; //new
  };
Confirmed users
978

edits