1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Merge pull request #1573 from matrix-org/dbkr/dtmf

Add DTMF sending support
This commit is contained in:
David Baker
2021-01-13 13:07:18 +00:00
committed by GitHub

View File

@@ -709,6 +709,21 @@ export class MatrixCall extends EventEmitter {
return callOnHold; 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() { private updateMuteStatus() {
if (!this.localAVStream) { if (!this.localAVStream) {
return; return;