From 842ceda34ff6b587f924861cb5589e25964f53ac Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Sun, 28 Jun 2026 20:56:07 +0300 Subject: [PATCH] Check if blocking rules match also to incoming mobile call --- .../kotlin/com/tutpro/baresip/BaresipService.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt index 56531f70..828e27c3 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt @@ -2116,6 +2116,22 @@ class BaresipService: Service() { ).add() return } + if (isBlocked(uri)) { + Log.d(TAG, "Auto-rejecting incoming PSTN call from $uri by block rule") + telecomCall.disconnect() + toast( + String.format(getString(R.string.call_blocked), + Utils.friendlyUri(this, uri, ua.account)) + ) + if (ua.account.callHistory) + Blocked( + ua.account.aor, + uri, + "invite", + GregorianCalendar().timeInMillis + ).add() + return + } } val call = Call.ExternalCall(