From eb18baa08992156307fdefb18c07ee0e26bc80a5 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Sun, 10 May 2026 15:40:02 +0300 Subject: [PATCH] Added fun hasTelecomCall() to Call --- app/src/main/kotlin/com/tutpro/baresip/Call.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/kotlin/com/tutpro/baresip/Call.kt b/app/src/main/kotlin/com/tutpro/baresip/Call.kt index 5a9f4638..637de941 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/Call.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/Call.kt @@ -247,6 +247,12 @@ open class Call(val callp: Long, val ua: UserAgent, val peerUri: String, val dir return BaresipService.calls.isNotEmpty() } + fun hasTelecomCall(): Boolean { + return BaresipService.calls.any { + it is ExternalCall || ConnectionService.connections.containsKey(it.callp) + } || ConnectionService.pendingOutgoingConnection != null + } + fun isAnyCallActive(ctx: Context): Boolean { // Check if there exist SIP calls that are not onhold or held if (BaresipService.calls.any { !it.onhold && !it.held }) return true