W3cubDocs

/DOM

WebRTC API: Using DTMF

Draft
This page is not complete.

In order to more fully support audio/video conferencing, WebRTC supports sending DTMF to the remote peer on an RTCPeerConnection. This article offers a brief high-level overview of how DTMF works over WebRTC, then provides a guide for everyday developers about how to send DTMF over an RTCPeerConnection. The DTMF system is often referred to as "touch tone," after an old trade name for the system.

Web RTC doesn't send DTMF codes as audio data. Instead, they're sent out-of-band, as RTP payloads. While it's possible to send DTMF using WebRTC, there is currently no way to detect incoming DTMF. WebRTC currently ignores these payloads. DTMF support is primarily intended for use with legacy telephone services that rely on DTMF tones, such as:

  • Teleconferencing systems
  • Menu systems
  • Voicemail systems
  • Entry of credit card or other payment information
  • Passcode entry

While the DTMF is not sent to the remote peer as audio, browsers may choose to play the corresponding tone to the local user as part of their user experience, since users are typically used to hearing their phone play the tones audibly.

If you're curious how this works, you can learn more in RFC 3550: RTP: A Transport Protocol for Real-Time Applications and RFC 4733: RTP Payload for DTMF Digits, Telephony Tones, and Telephony Signals. The details of how DTMF payloads are handled on RTP are beyond the scope of this article.

© 2005–2017 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/WebRTC_API/Using_DTMF