This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2020.
* Some parts of this feature may have varying levels of support.
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.
RTCDTMFSender.canInsertDTMF Read only
A boolean value which is true if the RTCDTMFSender is capable of sending DTMF tones, or false if it is not.
RTCDTMFSender.toneBuffer Read only
A string 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.
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.
Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface.
tonechangeThe tonechange event is sent to the RTCDTMFSender instance's event handler to indicate that a tone has either started or stopped playing.
See the article Using DTMF with WebRTC for a full example.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
RTCDTMFSender |
27 | 79 | 52 | 15 | 13.1 | 27 | 52 | 15 | 13.4 | 1.5 | 4.4 | 13.4 |
canInsertDTMF |
27 | 79 | 129 | 15 | 13.1 | 27 | 129 | 15 | 13.4 | 1.5 | 4.4 | 13.4 |
insertDTMF |
27 | 79 | 52 | 15 | 13.1 | 27 | 52 | 15 | 13.4 | 1.5 | 4.4 | 13.4 |
toneBuffer |
27 | 79 | 52 | 15 | 13.1 | 27 | 52 | 15 | 13.4 | 1.5 | 4.4 | 13.4 |
tonechange_event |
27 | 79 | 52 | 15 | 13.1 | 27 | 52 | 15 | 13.4 | 1.5 | 4.4 | 13.4 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCDTMFSender