Similar conversation (https://forums.puri.sm/t/spam-blocker-for-phosh-to-automatically-hang-up-calls-from-unknown-callers/) and an app that came of it: Chris Talbot / Phosh Anti-Spam · GitLab [the logic how things get blocked is explained there]
(available to install via apt-get install phosh-antispam If I recall)
