The insertDTMF() method on the RTCDTMFSender interface starts sending DTMF tones to the remote peer over the RTCPeerConnection. Sending of the tones is performed asynchronously, with tonechange events sent to the RTCDTMFSender every time a tone starts or ends.
As long as the connection is active, you can send tones at any time. Calling insertDTMF() will append the specified tones to the end of the current tone buffer, so that those tones play after the previously-enqueued tones.
RTCDTMFSender.insertDTMF(tones[, duration[, interToneGap]]);
tonesDOMString containing the DTMF codes to be transmitted to the recipient. Specifying an empty string as the tones parameter clears the tone buffer, aborting any currently queued tones. A "," character inserts a two second delay.duration Optional
interToneGap Optional
InvalidStateErrorInvalidCharacterErrortones is not valid DTMF.tbd
| Specification | Status | Comment |
|---|---|---|
| WebRTC 1.0: Real-time Communication Between Browsers The definition of 'RTCDTMFSender.insertDTMF()' in that specification. | Candidate Recommendation |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | Yes | ? | 52 | No | Yes | ? |
| 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 |
© 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/insertDTMF