Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

RTCDTMFSender

BaselineWidely available *

TheRTCDTMFSender interface provides a mechanism for transmittingDTMF codes on aWebRTCRTCPeerConnection. You gain access to the connection'sRTCDTMFSender through theRTCRtpSender.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 apublic-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.

EventTarget RTCDTMFSender

Instance properties

RTCDTMFSender.canInsertDTMFRead only

A boolean value which istrue if theRTCDTMFSender is capable of sending DTMF tones, orfalse if it is not.

RTCDTMFSender.toneBufferRead 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). SeetoneBuffer for details on the format of the tone buffer.

Instance methods

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. CallinginsertDTMF() replaces any already-pending tones from thetoneBuffer. You can abort sending queued tones by specifying an empty string ("") as the set of tones to play.

Events

Listen to these events usingaddEventListener() or by assigning an event listener to theoneventname property of this interface.

tonechange

Thetonechange event is sent to theRTCDTMFSender instance's event handler to indicate that a tone has either started or stopped playing.

Example

See the articleUsing DTMF with WebRTC for a full example.

Specifications

Specification
WebRTC: Real-Time Communication in Browsers
# rtcdtmfsender

Browser compatibility

See also

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp