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.toneBuffer
Read only
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.RTCDTMFSender.ontonechange
EventHandler
to handle the tonechange
event, which is sent each time an outbound tone starts or finishes playing.RTCDTMFSender.insertDTMF()
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.tbd
Specification | Status | Comment |
---|---|---|
WebRTC 1.0: Real-time Communication Between Browsers The definition of 'RTCDTMFSender' in that specification. | Candidate Recommendation |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | Yes | ? | 52 | No | Yes | ? |
toneBuffer |
Yes | ? | 52 | No | Yes | ? |
ontonechange |
Yes | ? | 52 | No | Yes | ? |
insertDTMF |
Yes | ? | 52 | No | Yes | ? |
canInsertDTMF |
? | ? | ? | ? | ? | ? |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | Yes | ? | 52 | Yes | ? | Yes |
toneBuffer |
Yes | Yes | ? | 52 | Yes | ? | Yes |
ontonechange |
Yes | Yes | ? | 52 | Yes | ? | Yes |
insertDTMF |
Yes | Yes | ? | 52 | Yes | ? | Yes |
canInsertDTMF |
? | ? | ? | ? | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCDTMFSender