Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification: insertDTMF replaces the current tone buffer #1338

Merged
merged 3 commits into from
Jun 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -9325,7 +9325,7 @@ <h2>Attributes</h2>
<dd>
<p>The <dfn>dtmf</dfn> attribute returns a RTCDTMFSender which
can be used to send DTMF. A null value indicates that this
RTCRtpSender cannot send DTMF.</p>
<code><a>RTCRtpSender</a></code> cannot send DTMF.</p>
</dd>
</dl>
</section>
Expand Down Expand Up @@ -9453,7 +9453,12 @@ <h2>Methods</h2>
</ol>
</li>
</ol>
<p>Calling <code><a data-for=
<p>Since <code>insertDTMF</code> replaces the tone
buffer, in order to add to the DTMF tones being played,
it is necessary to call <code>insertDTMF</code> with a
string containing both the remaining tones (stored in
<code>toneBuffer</code>) and the new tones appended
together. Calling <code><a data-for=
Copy link
Contributor

@taylor-b taylor-b Jun 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually safe? A tone could be sent in between toneBuffer being read and insertDTMF being called with the additional tones, resulting in one being sent twice.

Is it too late to change this behavior? I wonder how many applications are actually reliant on it, or what the intention was.

EDIT: Nevermind. toneBuffer is only drained from a queued "playout task" so this is safe.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have playout tasks and is on main loop this should be safe.

"RTCDTMFSender">insertDTMF</a></code> with an empty tones
parameter can be used to cancel all tones queued to play after
the currently playing tone.</p>
Expand Down