File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
vector/src/main/java/im/vector/app/features/call/webrtc Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change
1
+ Ensure the incoming call will not ring forever, in case the call is not ended by another way.
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ import im.vector.app.features.call.vectorCallService
34
34
import im.vector.app.features.session.coroutineScope
35
35
import kotlinx.coroutines.CoroutineScope
36
36
import kotlinx.coroutines.asCoroutineDispatcher
37
+ import kotlinx.coroutines.delay
38
+ import kotlinx.coroutines.launch
37
39
import org.matrix.android.sdk.api.extensions.orFalse
38
40
import org.matrix.android.sdk.api.extensions.tryOrNull
39
41
import org.matrix.android.sdk.api.logger.LoggerTag
@@ -386,6 +388,14 @@ class WebRtcCallManager @Inject constructor(
386
388
// Maybe increase sync freq? but how to set back to default values?
387
389
}
388
390
}
391
+
392
+ // ensure the incoming call will not ring forever
393
+ sessionScope?.launch {
394
+ delay(2 * 60 * 1000 /* 2 minutes */ )
395
+ if (mxCall.state is CallState .LocalRinging ) {
396
+ onCallEnded(mxCall.callId, EndCallReason .INVITE_TIMEOUT , rejected = false )
397
+ }
398
+ }
389
399
}
390
400
391
401
override fun onCallAnswerReceived (callAnswerContent : CallAnswerContent ) {
You can’t perform that action at this time.
0 commit comments