Table of Contents

Class RTCDTMFSender

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The RTCDTMFSender interface provides a mechanism for transmitting DTMF codes on a WebRTC RTCPeerConnection. You gain access to the connection's RTCDTMFSender through the Dtmf property on the audio track you wish to send DTMF with.

[Value("RTCDTMFSender")]
public class RTCDTMFSender : EventTarget
Inheritance
RTCDTMFSender
Inherited Members

Remarks

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.

-WebRTC API
-Using DTMF with WebRTC
-Dtmf
-RTCPeerConnection
-RTCRtpSender

See also on MDN

Constructors

RTCDTMFSender()

public RTCDTMFSender()

Properties

CanInsertDTMF

The canInsertDTMF read-only property of the RTCDTMFSender interface returns a boolean value which indicates whether the RTCDTMFSender is capable of sending DTMF tones over the RTCPeerConnection.

[Value("canInsertDTMF")]
public bool CanInsertDTMF { get; }

Property Value

bool

A boolean value which is true if the RTCDTMFSender is capable of sending DTMF tones, or false if it is not.

Remarks

Ontonechange

[Value("ontonechange")]
public EventHandlerNonNull Ontonechange { get; set; }

Property Value

EventHandlerNonNull

ToneBuffer

The RTCDTMFSender interface's toneBuffer property returns a string
containing a list of the DTMF tones currently queued for sending to the
remote peer over the RTCPeerConnection. To place tones into the buffer,
call InsertDTMF(string, ulong, ulong).

[Value("toneBuffer")]
public string ToneBuffer { get; }

Property Value

string

A string listing the tones to be played. If the string is empty,
there are no tones pending.

Remarks

Tones are removed from the string as they're played, so only upcoming tones are listed.

-WebRTC API
-Using DTMF with WebRTC
-InsertDTMF(string, ulong, ulong)
-RTCPeerConnection
-RTCDTMFSender
-RTCRtpSender

See also on MDN

Methods

InsertDTMF(string, ulong, ulong)

The insertDTMF() method of the RTCDTMFSender interface sends {{Glossary("DTMF")}} tones to the remote peer over the RTCPeerConnection.

[Value("insertDTMF")]
public GlobalObject.Undefined InsertDTMF(string tones, ulong duration = 0, ulong interToneGap = 0)

Parameters

tones string
duration ulong
interToneGap ulong

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

Tones are sent asynchronously. Every time a tone starts or ends, a tonechange event is sent to the RTCDTMFSender.

You can call insertDTMF() at any time while the connection is active. Each call to insertDTMF() replaces any pending tones in the toneBuffer.
You can abort sending queued tones by specifying an empty string ("") as the set of tones to play.
Since insertDTMF() replaces the tone buffer, in order to add to the DTMF tones being played, it is necessary to call insertDTMF() with a string containing both the remaining tones (stored in the toneBuffer) and the new tones appended together.

-WebRTC API
-Using DTMF with WebRTC
-RTCPeerConnection
-RTCDTMFSender
-RTCRtpSender

See also on MDN