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

Handle DTMF support

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-07-27 17:51:13 +02:00
parent a69d9a9f20
commit 959e3f68a4
2 changed files with 13 additions and 10 deletions

View File

@@ -394,6 +394,10 @@ export class MatrixCall extends EventEmitter {
return Boolean(this.opponentCaps && this.opponentCaps["m.call.transferee"]); return Boolean(this.opponentCaps && this.opponentCaps["m.call.transferee"]);
} }
public opponentSupportsDTMF(): boolean {
return Boolean(this.opponentCaps && this.opponentCaps["m.call.dtmf"]);
}
public getRemoteAssertedIdentity(): AssertedIdentity { public getRemoteAssertedIdentity(): AssertedIdentity {
return this.remoteAssertedIdentity; return this.remoteAssertedIdentity;
} }
@@ -1032,11 +1036,10 @@ export class MatrixCall extends EventEmitter {
[SDPStreamMetadataKey]: this.getLocalSDPStreamMetadata(), [SDPStreamMetadataKey]: this.getLocalSDPStreamMetadata(),
} as MCallAnswer; } as MCallAnswer;
if (this.client.supportsCallTransfer) {
answerContent.capabilities = { answerContent.capabilities = {
'm.call.transferee': true, 'm.call.transferee': true,
'm.call.dtmf': false,
}; };
}
// We have just taken the local description from the peerconnection which will // We have just taken the local description from the peerconnection which will
// contain all the local candidates added so far, so we can discard any candidates // contain all the local candidates added so far, so we can discard any candidates
@@ -1374,11 +1377,10 @@ export class MatrixCall extends EventEmitter {
content.description = this.peerConn.localDescription; content.description = this.peerConn.localDescription;
} }
if (this.client.supportsCallTransfer) {
content.capabilities = { content.capabilities = {
'm.call.transferee': true, 'm.call.transferee': true,
'm.call.dtmf': false,
}; };
}
content[SDPStreamMetadataKey] = this.getLocalSDPStreamMetadata(); content[SDPStreamMetadataKey] = this.getLocalSDPStreamMetadata();

View File

@@ -24,6 +24,7 @@ interface CallOfferAnswer {
export interface CallCapabilities { export interface CallCapabilities {
'm.call.transferee': boolean; 'm.call.transferee': boolean;
'm.call.dtmf': boolean;
} }
export interface MCallAnswer { export interface MCallAnswer {