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
@@ -886,6 +886,10 @@ class BaresipService: Service() {
return return
} }
"call update" -> { "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 val newHeldState = when (ev[1].toInt()) {Api.SDP_INACTIVE, Api.SDP_RECVONLY -> true
else -> false else -> false
} }
@@ -136,6 +136,8 @@ class ConnectionService : ConnectionService() {
inner class BaresipConnection(val uap: Long, var callp: Long) : Connection() { inner class BaresipConnection(val uap: Long, var callp: Long) : Connection() {
private var isDisconnecting = false
override fun onAnswer() { override fun onAnswer() {
Log.d(TAG, "Telecom Connection onAnswer $callp") Log.d(TAG, "Telecom Connection onAnswer $callp")
val intent = Intent(this@ConnectionService, MainActivity::class.java) val intent = Intent(this@ConnectionService, MainActivity::class.java)
@@ -156,15 +158,25 @@ class ConnectionService : ConnectionService() {
} }
override fun onDisconnect() { override fun onDisconnect() {
if (isDisconnecting) return
Log.d(TAG, "Telecom Connection onDisconnect $callp") Log.d(TAG, "Telecom Connection onDisconnect $callp")
if (callp != 0L) { isDisconnecting = true
Api.ua_hangup(uap, callp, 0, "") if (callp == 0L) {
connections.remove(callp)
} else {
pendingOutgoingConnection = null 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)) setDisconnected(DisconnectCause(DisconnectCause.LOCAL))
destroy() 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() { override fun onAbort() {