Skip to content

Draft: Revamp plugin infrastructure to accomodate "policy engine" plugins

Evangelos Ribeiro Tzaras requested to merge devrtz/calls:wip/policy-engine into main

** Updated OP **

The CallsPolicyEngine interface and corresponding plugins are meant to tackle the call blocking problem in a somewhat general way. The basic idea is that policy engines get consulted for what kind of action to take on an incoming call.

There are a lot of possible use cases ("simple" blocklist, crowd sourced blocklists, taking work calendar into account, time-based, ...) and I think having specialized per-use-case plugins that do one thing would be easier to implement and maintain vs a single implementation that tries to do everything at once.

and having plugins handle one thing would be simpler than trying to cover all these cases with a single implementation (at the cost of some small amount of complexity for the plugin infrastructure)

Possible actions include (not necessarily implemented right now and all of them are necessarily great ideas):

  • Pass
  • Auto accept (?)
  • Silence ringing (but don't hang up)
  • Reject (hang up, show up in history), see #557
  • Reject (hang up, don't show up in history)
  • Ignore (no indication to the user that they're being called at all, will let the call ring until the caller gives up)
  • Deflect call to different number (or potentially voicemail)
  • Send predefined SMS (and hang up), see #14
  • Forcefully allow (this enables the "callback" mechanism of phosh-antispam)

TODOs:

  • Add more tests
  • Decide how to go about multiple "blocklist" providers
  • Plumbing for CallsPolicyManager
Edited by Evangelos Ribeiro Tzaras

Merge request reports