Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8178.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +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
Expand Up @@ -34,6 +34,8 @@ import im.vector.app.features.call.vectorCallService
import im.vector.app.features.session.coroutineScope
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.asCoroutineDispatcher
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.extensions.tryOrNull
import org.matrix.android.sdk.api.logger.LoggerTag
Expand Down Expand Up @@ -386,6 +388,14 @@ class WebRtcCallManager @Inject constructor(
// Maybe increase sync freq? but how to set back to default values?
}
}

// ensure the incoming call will not ring forever
sessionScope?.launch {
delay(2 * 60 * 1000 /* 2 minutes */)
if (mxCall.state is CallState.LocalRinging) {
onCallEnded(mxCall.callId, EndCallReason.INVITE_TIMEOUT, rejected = false)
}
}
}

override fun onCallAnswerReceived(callAnswerContent: CallAnswerContent) {
Expand Down