We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

B2G OS

Telephony.sendTones()

This API is available on Firefox OS for internal applications only.

The sendTones() method of the Telephony Interface generates multiple DTMF tones, with a specified duration for each tone, and an optional delay before generation starts. The tones are sent to the currently active call.

Syntax

The new syntax is promise-based:

myTelephony.sendTones(dtmfChars,pauseDuration,toneDuration,serviceId).then(function() {
  // do something in response
});

In addition to the newly added syntax, the existing syntaxs are just regular non-promise methods without the capability of controlling the duration.

myTelephony.startTone(dtmfChar, serviceId); 
myTelephony.stopTone(serviceId);

Parameters

dtmfChars
A DOMString containing the DTMF characters to generate; these must be characters from 0-9, "*", or "+".
pauseDuration
The time to wait before sending the tones. The default value if none is specified is 3000ms. Optional
toneDuration
The length each tone should be. The default value if none is specified is 70ms. Optional
serviceId
The service ID, as specified in the dom.telephony.defaultServiceId setting. Optional

Examples

// Telephony object
var tel = navigator.mozTelephony;

tel.sendTones("123456789").then(function(call) {
  // 
});

Specifications

Specification Status Comment
Web Telephony Draft Draft

Browser compatibility

For obvious reasons, support is primarily expected on mobile browsers.

Supported in Firefox OS 1.0.1.

Promise version support in Firefox OS 1.4.

See also

Document Tags and Contributors

Contributors to this page: fscholz, chrisdavidmills, hsinyi, teoli
Last updated by: fscholz,