Improved handling of hangup button

This commit is contained in:
Juha Heinanen
2026-01-16 07:42:49 +02:00
parent b599dbca21
commit 458b8a4459
2 changed files with 6 additions and 7 deletions

View File

@ -11,7 +11,7 @@ class Call(val callp: Long, val ua: UserAgent, val peerUri: String, val dir: Str
var onhold = false var onhold = false
var held = false var held = false
var terminated = false val terminated = mutableStateOf(false)
var conferenceCall = false var conferenceCall = false
var onHoldCall: Call? = null var onHoldCall: Call? = null
var newCall: Call? = null var newCall: Call? = null

View File

@ -1478,13 +1478,12 @@ private fun CallRow(
IconButton( IconButton(
modifier = Modifier.size(48.dp), modifier = Modifier.size(48.dp),
enabled = !call.terminated.value,
onClick = { onClick = {
if (!call.terminated) { call.terminated.value = true
call.terminated = true abandonAudioFocus(ctx)
abandonAudioFocus(ctx) Log.d(TAG, "AoR ${call.ua.account.aor} hanging up call ${call.callp} with ${call.callUri.value}")
Log.d(TAG, "AoR ${call.ua.account.aor} hanging up call ${call.callp} with ${call.callUri.value}") Api.ua_hangup(call.ua.uap, call.callp, 487, "Request Terminated")
Api.ua_hangup(call.ua.uap, call.callp, 487, "Request Terminated")
}
} }
) { ) {
Icon( Icon(