Added auto-answer support to mobile account

This commit is contained in:
Juha Heinanen
2026-05-14 09:16:19 +03:00
parent 28a18b4c62
commit 697ee7d17e
3 changed files with 8 additions and 4 deletions

View File

@ -1288,8 +1288,8 @@ private fun AccountContent(
Rel100()
Dtmf()
Redirect()
Answer()
}
Answer()
Voicemail()
CountryCode()
if (!ua.account.isMobile)

View File

@ -1828,14 +1828,19 @@ class BaresipService: Service() {
setCallVolume()
ensureCommunicationMode()
if (isIncoming)
if (isIncoming) {
handleIncomingCall(call)
else
if (ua.account.answerMode == Api.ANSWERMODE_AUTO) {
Log.d(TAG, "Auto-answering external call ${call.callp}")
call.answer()
}
} else {
postServiceEvent(ServiceEvent(
"call outgoing",
arrayListOf(ua.uap, call.callp),
System.nanoTime())
)
}
}
fun handleExternalCallRemoved(telecomCall: android.telecom.Call) {

View File

@ -2,7 +2,6 @@ package com.tutpro.baresip
import android.content.Context
import android.content.Intent
import android.net.Uri
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background