Merge branch 'td/missedCallreject' into 'main'

fix: only send call reject event when needed

See merge request famedly/company/frontend/famedlysdk!1224
This commit is contained in:
td 2023-01-27 12:56:45 +00:00
commit 8a1ca08d7c
3 changed files with 8 additions and 4 deletions

View File

@ -133,6 +133,8 @@ newCall.answer();
newCall.reject();
```
To reject a call locally but not send a event, use `newCall.reject(shouldEmit: false)`
### 5.Render media stream
The basic process of rendering a video stream is as follow code.

View File

@ -1022,9 +1022,11 @@ class CallSession {
}
Logs().d('[VOIP] Rejecting call: $callId');
await terminate(CallParty.kLocal, CallErrorCode.UserHangup, shouldEmit);
if (shouldEmit) {
await sendCallReject(
room, callId, Timeouts.lifetimeMs, localPartyId, reason);
}
}
Future<void> hangup([String? reason, bool suppressEvent = false]) async {
// stop play ringtone

View File

@ -224,8 +224,8 @@ class VoIP {
if (!delegate.canHandleNewCall &&
(confId == null || confId != currentGroupCID)) {
Logs().v(
'[glare] [VOIP] onCallInvite: Unable to handle new calls, maybe user is busy.');
await newCall.reject(reason: 'busy', shouldEmit: false);
'[VOIP] onCallInvite: Unable to handle new calls, maybe user is busy.');
await newCall.reject(reason: CallErrorCode.UserBusy, shouldEmit: false);
delegate.handleMissedCall(newCall);
return;
}