Control telephone calls from the browser!

Control telephone calls from the browser, yes browser! But Mozilla Mobile Browser as of now.

The phone functionality can be used with the help of  navigator.mozTelephony, which is part of the WebTelephony API.

P.S : This is a nonstandard API and is subjected to change and works only with Firefox Mobile (Gecko) 12.

Here is a simple code example of playing with the mozTelephony API :

// Telephony object
var tel = navigator.mozTelephony;
// Check if the phone is muted (read/write property)
// Check if the speaker is enabled (read/write property)
// Place a call
var call = tel.dial("123456789");
// Events for that call
call.onstatechange = function (event) {
        Possible values for state:
        "dialing", "ringing", "busy", "connecting", "connected", 
        "disconnecting", "disconnected", "incoming"
// Above options as direct events
call.onconnected = function () {
    // Call was connected
call.ondisconnected = function () {
    // Call was disconnected
// Receiving a call
tel.onincoming = function (event) {
    var incomingCall =;
    // Get the number of the incoming call
    // Answer the call
// Disconnect a call
// Iterating over calls, and taking action depending on their changed status
tel.oncallschanged = function (event) {
    tel.calls.forEach(function (call) {
        // Log the state of each call

Hope this becomes a standard in all Mobile Browser one fine day! Anyway cheers to Mozilla team from making this API!

Share this