A call blocking functionality is making its way into the Sailfish OS code. I’ve started since March to find how to have it officially available. I would like to thank @slava, @abranson, @attah and @pvuorela for their great help in the matter, bearing all my various attempts and numerous pointless pull requests in a large number of repositories. Thanks also to @pvuorela for its work in the close source parts of Sailfish OS. So the functionality has finally landed in voicecall, with a new API that allows to filter out incoming calls.
The preparing pull requests have been accepted:
- in libcommhistory, to add a new incoming status and being able to identified blocked calls in the call log.
- in commhistory-daemon, not to log the calls anymore, but delegating it to voicecall manager so it can label blocked calls.
- in voicecall, creating a new plugin to log calls ; but also some rework of the call status evolution.
The main pull request in voicecall introducing the new API has also been accepted.
The main part is adding a new filter()
method to an incoming call. This method can be used besides the answer()
method (or the hangup()
method) to filter out the call. It takes an argument which is the action to perform : “continue” means let the call ring, “ignore” means let the caller on ring tone, but don’t notify the user with a ringing device, and “reject” means immediately hang up without user intervention. This method is also available on D-Bus. Which means that phonehook can be adjusted to use it.
A minimal plugin also exists when installing the voicecall-filter-plugin
package (not available yet on 4.6 obviously). This package stores ignored and rejected numbers in DConf entries ("/sailfish/voicecall/filter/rejected-numbers" and “/sailfish/voicecall/filter/ignored-numbers”). It only supports exact matching for the moment. But, I’ve a pull request under discussion to add pattern matching.
This implementation only deals with incoming calls, but not SMS. It may be an answer to these various threads: