files/en-us/web/api/rtcdtmfsender/index.md
{{APIRef("WebRTC")}}
The RTCDTMFSender interface provides a mechanism for transmitting {{Glossary("DTMF")}} codes on a WebRTC {{domxref("RTCPeerConnection")}}. You gain access to the connection's RTCDTMFSender through the {{domxref("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.
{{InheritanceDiagram}}
{{domxref("RTCDTMFSender.canInsertDTMF")}} {{ReadOnlyInline}}
true if the RTCDTMFSender is capable of sending DTMF tones, or false if it is not.{{domxref("RTCDTMFSender.toneBuffer")}} {{ReadOnlyInline}}
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 {{domxref("EventTarget.addEventListener", "addEventListener()")}} or by assigning an event listener to the oneventname property of this interface.
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.
{{Specifications}}
{{Compat}}