Do not allow update of conference call

Allow hanging up individual members of conference call
This commit is contained in:
Juha Heinanen
2026-04-06 14:59:48 +03:00
parent bca39aa1b0
commit 45497e8868
2 changed files with 20 additions and 4 deletions

View File

@ -886,6 +886,10 @@ class BaresipService: Service() {
return
}
"call update" -> {
if (call!!.conferenceCall) {
Log.d(TAG, "Refusing to update conference call ${call.callp}")
return
}
val newHeldState = when (ev[1].toInt()) {Api.SDP_INACTIVE, Api.SDP_RECVONLY -> true
else -> false
}

View File

@ -136,6 +136,8 @@ class ConnectionService : ConnectionService() {
inner class BaresipConnection(val uap: Long, var callp: Long) : Connection() {
private var isDisconnecting = false
override fun onAnswer() {
Log.d(TAG, "Telecom Connection onAnswer $callp")
val intent = Intent(this@ConnectionService, MainActivity::class.java)
@ -156,15 +158,25 @@ class ConnectionService : ConnectionService() {
}
override fun onDisconnect() {
if (isDisconnecting) return
Log.d(TAG, "Telecom Connection onDisconnect $callp")
if (callp != 0L) {
Api.ua_hangup(uap, callp, 0, "")
connections.remove(callp)
} else {
isDisconnecting = true
if (callp == 0L) {
pendingOutgoingConnection = null
setDisconnected(DisconnectCause(DisconnectCause.CANCELED))
destroy()
return
}
val call = Call.ofCallp(callp)
if (call != null)
Api.ua_hangup(uap, callp, 0, "")
setDisconnected(DisconnectCause(DisconnectCause.LOCAL))
destroy()
// Allow other disconnects after a short period
// to prevent the "Telecom Cascade" effect
android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({
isDisconnecting = false
}, 1000)
}
override fun onAbort() {