Added auto-answer support to mobile account
This commit is contained in:
@ -1288,8 +1288,8 @@ private fun AccountContent(
|
|||||||
Rel100()
|
Rel100()
|
||||||
Dtmf()
|
Dtmf()
|
||||||
Redirect()
|
Redirect()
|
||||||
Answer()
|
|
||||||
}
|
}
|
||||||
|
Answer()
|
||||||
Voicemail()
|
Voicemail()
|
||||||
CountryCode()
|
CountryCode()
|
||||||
if (!ua.account.isMobile)
|
if (!ua.account.isMobile)
|
||||||
|
|||||||
@ -1828,14 +1828,19 @@ class BaresipService: Service() {
|
|||||||
setCallVolume()
|
setCallVolume()
|
||||||
ensureCommunicationMode()
|
ensureCommunicationMode()
|
||||||
|
|
||||||
if (isIncoming)
|
if (isIncoming) {
|
||||||
handleIncomingCall(call)
|
handleIncomingCall(call)
|
||||||
else
|
if (ua.account.answerMode == Api.ANSWERMODE_AUTO) {
|
||||||
|
Log.d(TAG, "Auto-answering external call ${call.callp}")
|
||||||
|
call.answer()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
postServiceEvent(ServiceEvent(
|
postServiceEvent(ServiceEvent(
|
||||||
"call outgoing",
|
"call outgoing",
|
||||||
arrayListOf(ua.uap, call.callp),
|
arrayListOf(ua.uap, call.callp),
|
||||||
System.nanoTime())
|
System.nanoTime())
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleExternalCallRemoved(telecomCall: android.telecom.Call) {
|
fun handleExternalCallRemoved(telecomCall: android.telecom.Call) {
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package com.tutpro.baresip
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
|
||||||
import androidx.activity.compose.BackHandler
|
import androidx.activity.compose.BackHandler
|
||||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
|||||||
Reference in New Issue
Block a user