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

Correction in sending DTMF via SIP INFO #871

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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: 1 addition & 8 deletions lib/RTCSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -1055,14 +1055,7 @@ module.exports = class RTCSession extends EventEmitter
return;
}

if (this._tones)
{
// Tones are already queued, just add to the queue.
this._tones += tones;

return;
}

Copy link
Member

Choose a reason for hiding this comment

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

This must remain as it it, because there may already be tones being sent by other previous calls to this method.

What we want to do is:

  • remove the variable position. It's local to this function and breaks things when there are already tones being sent.
  • substitute code above
  const tone = this._tones[position];
  position += 1;

by

// Retrieve the next tone.
const tone = this._tones[0];
 
// Remove the tone from this._tones.
this._tones.substring(1);

position = 0;
this._tones = tones;

// Send the first tone.
Expand Down