Fixed possible crash related to attended transfer

Show original call as being on hold when waiting for blind transfer
This commit is contained in:
Juha Heinanen
2025-11-05 12:59:06 +02:00
parent 80ded60b4a
commit b5a7457ef9
2 changed files with 4 additions and 3 deletions

View File

@ -39,14 +39,15 @@ class Call(val callp: Long, val ua: UserAgent, val peerUri: String, val dir: Str
val err = Api.call_hold(callp, true)
if (err != 0)
return false
onhold = true
referTo = uri
return Api.call_transfer(callp, uri) == 0
}
fun executeTransfer(): Boolean {
return if (this.onHoldCall != null) {
return if (onHoldCall != null) {
if (Api.call_hold(callp, true) == 0)
Api.call_replace_transfer(this.onHoldCall!!.callp, callp)
Api.call_replace_transfer(onHoldCall!!.callp, callp)
else
false
} else

View File

@ -1385,7 +1385,7 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) {
abandonAudioFocus(ctx)
val uaCalls = ua.calls()
if (uaCalls.isNotEmpty()) {
val call = uaCalls.last()
val call = uaCalls.first()
val callp = call.callp
Log.d(TAG, "AoR ${ua.account.aor} hanging up call $callp with ${callUri.value}")
Api.ua_hangup(ua.uap, callp, 0, "")