Changes

Jump to: navigation, search

WebAPI/WebTelephony

912 bytes added, 07:11, 6 June 2012
consolidate: WebTelephony: Implementation Specifics
attribute nsIDOMEventListener onheld;
attribute nsIDOMEventListener onresuming;
};
 
=== Example ===
 
Here are few examples about how to use WebTelephony API.
 
==== Place a call ====
// First, obtain a telephony object.
var telephony = navigator.mozTelephony;
// Check if the speaker is enabled.
concole.log(telephony.speakerEnabled);
 
// Then, we dial out.
var outgoing = telephony.dial(phoneNumber);
 
// Event handlers for the call.
outgoing.onconnected = function onconnected(event) {
/* Do something when the callee picks up the call. */
};
outgoing.ondisconnected = function ondisconnected(event) {
/* Do something when the call finishes. */
};
// Hang up the call.
outgoing.hangUp();
==== Receive a call ====
 
// First, obtain a telephony object.
var telephony = navigator.mozTelephony;
 
// Receive an incoming call.
telephony.onincoming = function onincoming(event) {
var incoming = event.call;
// Answer the call.
incoming.answer();
};
Confirm
978
edits

Navigation menu