RTCDTMFSender.toneBuffer - Web APIs 编辑

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().

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

Syntax

var toneBuffer = RTCDTMFSender.toneBuffer;

Value

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

Tone buffer format

The tone buffer is a string which can contain any combination of the characters that are permitted by the DTMF standard.

DTMF tone characters

The digits 0-9
These characters represent the digit keys on a telephone keypad.
The letters A-D
These characters represent the "A" through "D" keys which are part of the DTMF standard but not included on most telephones. These are not interpreted as digits. Lower-case "a"-"d" automatically gets converted to upper-case.
The pound/hash sign ("#") and the asterisk ("*")
These correspond to the similarly-labeled keys which are typically on the bottom row of the telephone keypad.
The comma (",")
This character instructs the dialing process to pause for two seconds before sending the next character in the buffer.

All other characters are unrecognized and will cause insertDTMF() to throw an InvalidCharacterError exception.

Using tone buffer strings

For example, if you're writing code to control a voicemail system by sending DTMF codes, you might use a string such as "*,1,5555". In this example, we would send "*" to request access to the VM system, then, after a pause, send a "1" to start playback of voicemail messages, then after a pause, dial "5555" as a PIN number to open the messages.

Settting the tone buffer to an empty string ("") cancels any pending DTMF codes.

Example

tbd

Specifications

SpecificationStatusComment
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCDTMFSender.toneBuffer' in that specification.
Candidate Recommendation

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:84 次

字数:4441

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文