Skip to content

Commit

Permalink
Merge pull request #1820 from SimonBrandner/fix/hangup-reason/18219
Browse files Browse the repository at this point in the history
Send `user_hangup` reason if the opponent supports it
  • Loading branch information
dbkr authored Aug 5, 2021
2 parents 69358f8 + b15ba8c commit 4ed6fbe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/webrtc/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,10 @@ export class MatrixCall extends EventEmitter {
// We don't want to send hangup here if we didn't even get to sending an invite
if (this.state === CallState.WaitLocalMedia) return;
const content = {};
// Continue to send no reason for user hangups temporarily, until
// clients understand the user_hangup reason (voip v1)
if (reason !== CallErrorCode.UserHangup) content['reason'] = reason;
// Don't send UserHangup reason to older clients
if ((this.opponentVersion && this.opponentVersion >= 1) || reason !== CallErrorCode.UserHangup) {
content["reason"] = reason;
}
this.sendVoipEvent(EventType.CallHangup, content);
}

Expand Down

0 comments on commit 4ed6fbe

Please sign in to comment.