Skip to content

Commit

Permalink
Merge pull request #1573 from matrix-org/dbkr/dtmf
Browse files Browse the repository at this point in the history
Add DTMF sending support
  • Loading branch information
dbkr authored Jan 13, 2021
2 parents 65d4015 + 5b1fdb7 commit f6d3b50
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/webrtc/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,21 @@ export class MatrixCall extends EventEmitter {
return callOnHold;
}

/**
* Sends a DTMF digit to the other party
* @param digit The digit (nb. string - '#' and '*' are dtmf too)
*/
sendDtmfDigit(digit: string) {
for (const sender of this.peerConn.getSenders()) {
if (sender.track.kind === 'audio' && sender.dtmf) {
sender.dtmf.insertDTMF(digit);
return;
}
}

throw new Error("Unable to find a track to send DTMF on");
}

private updateMuteStatus() {
if (!this.localAVStream) {
return;
Expand Down

0 comments on commit f6d3b50

Please sign in to comment.