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

Add DTMF sending support

This commit is contained in:
David Baker
2021-01-04 19:58:12 +00:00
parent e25ae546fc
commit f8f76f6806

View File

@@ -694,6 +694,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 kind a track to send DTMF on");
}
private updateMuteStatus() {
if (!this.localAVStream) {
return;