Web/API/RTCDTMFSender

From Get docs


The RTCDTMFSender interface provides a mechanism for transmitting DTMF codes on a WebRTC RTCPeerConnection. You gain access to the connection's RTCDTMFSender through the RTCRtpSender.dtmf property on the audio track you wish to send DTMF with.

The primary purpose for WebRTC's DTMF support is to allow WebRTC-based communication clients to be connected to a public-switched telephone network (PSTN) or other legacy telephone service, including extant voice over IP (VoIP) services. For that reason, DTMF can't be used between two WebRTC-based devices, because there is no mechanism provided by WebRTC for receiving DTMF codes.

Properties

RTCDTMFSender.toneBuffer Read only
A DOMString which contains the list of DTMF tones currently in the queue to be transmitted (tones which have already been played are no longer included in the string). See toneBuffer for details on the format of the tone buffer.

Methods

RTCDTMFSender.insertDTMF()
Given a string describing a set of DTMF codes and, optionally, the duration of and inter-tone gap between the tones, insertDTMF() starts sending the specified tones. Calling insertDTMF() replaces any already-pending tones from the toneBuffer. You can abort sending queued tones by specifying an empty string ("") as the set of tones to play.

Events

Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface.

tonechange
The tonechange event is sent to the RTCDTMFSender instance's event handler to indicate that a tone has either started or stopped playing. Also available using the ontonechange event handler property.

Example

See the article Using DTMF with WebRTC for a full example.

Specifications

Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDTMFSender' in that specification. Candidate Recommendation  

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
RTCDTMFSender Chrome

Full support 27

Edge

Full support ≤79

Firefox

Full support 52

IE

No support No

Opera

Full support Yes

Safari

?

WebView Android

Full support 4.4

Chrome Android

Full support 27

Firefox Android

Full support 52

Opera Android

Full support Yes

Safari iOS

?

Samsung Internet Android

Full support 1.5

canInsertDTMF Chrome

Full support 27

Edge

Full support ≤79

Firefox

?

IE

No support No

Opera

Full support Yes

Safari

?

WebView Android

Full support Yes

Chrome Android

Full support 27

Firefox Android

?

Opera Android

Full support Yes

Safari iOS

?

Samsung Internet Android

Full support 1.5

insertDTMF Chrome

Full support 27

Edge

Full support ≤79

Firefox

Full support 52

IE

No support No

Opera

Full support Yes

Safari

?

WebView Android

Full support 4.4

Chrome Android

Full support 27

Firefox Android

Full support 52

Opera Android

Full support Yes

Safari iOS

?

Samsung Internet Android

Full support 1.5

ontonechange Chrome

Full support 27

Edge

Full support ≤79

Firefox

Full support 52

IE

No support No

Opera

Full support Yes

Safari

?

WebView Android

Full support Yes

Chrome Android

Full support 27

Firefox Android

Full support 52

Opera Android

Full support Yes

Safari iOS

?

Samsung Internet Android

Full support 1.5

toneBuffer Chrome

Full support 27

Edge

Full support ≤79

Firefox

Full support 52

IE

No support No

Opera

Full support Yes

Safari

?

WebView Android

Full support 4.4

Chrome Android

Full support 27

Firefox Android

Full support 52

Opera Android

Full support Yes

Safari iOS

?

Samsung Internet Android

Full support 1.5

tonechange event Chrome

Full support 27

Edge

Full support ≤79

Firefox

Full support 52

IE

No support No

Opera

Full support Yes

Safari

?

WebView Android

Full support Yes

Chrome Android

Full support 27

Firefox Android

Full support 52

Opera Android

Full support Yes

Safari iOS

?

Samsung Internet Android

Full support 1.5

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown


See also