Request - internal call and SMS blocklist

P.S. It looks that hangup takes some time, enough for half-a-second of ringtone to be heard in some cases. So muting the ringtone first turns out to be helpful:

QDBusMessage m = QDBusMessage::createMethodCall("org.nemomobile.voicecall",
                                                "/calls/active",
                                                "org.nemomobile.voicecall.VoiceCall",
                                                "silenceRingtone"); 
QDBusConnection::sessionBus().call(m);
7 Likes

Great work. I think one should be able to write some kind of daemon that monitors DBUS for the right signals and fires the appropriate method calls if the numbers match certain criteria.
If I remember it right there is also some kind of “new SMS received” DBUS signal but when I played around with it some years ago I’ve never been able to prevent the SMS tone from being played. Would be nice to have a solution for that, too :slight_smile:

2 Likes

It needs some further investigation. I’ve been playing with it and there’s a strange phenomenon that an incoming call seems to be nicely and silently rejected, a notification is shown on the screen that the call has ended, and so far so good, but it turns out that the actual connection doesn’t really get rejected and after a few seconds the incoming call is reported once again :open_mouth: It gets rejected, too, but this time it takes longer, enough for the call UI to be shown for a short while and ringtone to be heard for a fraction of second. Only after this second time the actual connection gets rejected.

I’ll take some testing to find out why is it so and how to avoid it.

BTW. It looks that one can also use

QDBusMessage m = QDBusMessage::createMethodCall("org.ofono",
                                               "/ril_0",
                                                "org.ofono.VoiceCallManager",
                                                "HangupAll");
QDBusConnection::systemBus().call(m);

to hangup a call, but with the same result.

1 Like

There is a strange bug with hanging up a call, both methods, no matter if I call HangupAll of org.ofono.VoiceCallManager or hangup of org.nemomobile.voicecall.VoiceCall.

Most of times, even though the UI on the phone behaves as if the call was ended (the call UI closes, there’s a system pop up that the call has ended, etc.) the actual connection remains active (on the other phone one can still hear the waiting tone) and after a few seconds the call comes in another time, and only this second time it really gets disconnected. The caller hears “beep beep beep” (as in case of a network error) and the connection just terminates.

Only very rarely, the call gets rejected right away, as it should. In such case the connection gets forwarded to voicemail, just as it happens if I manually reject a call with the red button.

So this leads me to a conclusion that there must be some bug in voice call management on SFOS, if it behaves differently in the same conditions. The telephony system must be sending to the network some different messages, if the call sometimes gets forwarded to voicemail (as it should with my call forwarding settings) whereas most of times it remains active even though SFOS shows it as disconnected, then it starts ringing again and only this second time it gets terminated, but with a “beep beep beep” tone like in case of a network error, without being forwarded to voice mail.

I’m not sure if I should report it as a bug by filling the bug report form?

Anyway, add to it that in most cases the reaction to HangupAll of org.ofono.VoiceCallManager or hangup of org.nemomobile.voicecall.VoiceCall is slow enough for some 0.5 - 1 second of ringtone to be heard before it gets silenced and rejected (and due to the aforementioned bug it often happens twice within a few seconds) and it turns out that in its current state it’s probably not possible to fully silently reject calls :frowning:

2 Likes

That’s not exactly encouraging. Still, thank you for the work done so far.

One possible way (although born out of pure desperation) to overcome this might be to keep the ringtone silenced all the time and only activate it when the daemon detects a negative match (i.e. the number/pattern is not on the blocklist) which, of course, comes with it’s own set of problems.

I reported it as a bug here because I realized that this strange behavior also happens when I try to reject incoming calls normally, via the UI, and not just programmatically. When I get an incoming call and press the red handset icon to reject it, everything looks as if the call got rejected, but the actual connection (with waiting tone) continues on the calling phone and after a few seconds it starts ringing again and the Phone app with incoming call screen pops up again. Only pressing the red handset button the second time hangs up the call.

Someone in the other thread reported that he tested it on a 10 II and couldn’t reproduce such problem. So maybe it’s XA2 unique (maybe something to do with its specific modem). Or maybe my system is broken (which would be strange as I flashed it less than a month ago and didn’t really mess with it too much).

It would be great if more people could test it, especially on XA2.

To test it, just please call to yourself from some other phone and reject the call the normal way via the UI, i.e. using the “red handset” icon/button of the Phone app UI. Please repeat a few times and see if the call always gets rejected correctly.

I’ve got an application to reject calls in a quite advanced state (with configurable white list, black list, etc.) so quite soon I could share it if this problem could be ironed out.

2 Likes

I tried 7 times on XA2 4.3 free but I couldn’t reproduce.
Great to know you are cooking something!

Then I really don’t know why it happens all the time on my XA2 Ultra. Is your XA2 Dual SIM?
Well, if no one else can reproduce it then I guess that reflashing the OS will be the only option left…

Tomorrow I will be able to test on an XA2 whit SFOS 4.3, one sim

Here’s a video showing this bizarre phenomenon (sorry for that heavy blur, but there were too many personal details to hide on both screens to do it in some other way):

Not only the call stays active after the first attempt to reject it even though SFOS behaves as if the call was terminated (see iPhone’s display on the right, the call is still waiting to be picked up as if nothing happened), but when the call magically comes back on SFOS, two different ringtones play simultaneously. I have no idea where that second ringtone comes from, maybe Android. What a cr*p. Now all those obtrusive telemarketers and frauds will annoy me twice more as I will be struggling with my Sailfish phone to hangup their calls.

I have experienced and reported back in TJC general slowness of the dialer UI. Specifically, if I press the hang button once it is almost certain that the call will not be hung up, and no feedback will be provided, be it visual, aural or haptical. When hanging up, I usually press the button several times in a row to be sure to succeed. Unfortunately, sometimes this causes me to press on the just appeared “Call again” button - which will let a call start before the hang up button can respond to my subsequent frenetic presses.

But this case is different. It is not lack of response from the UI, on the contrary, as you can see on the video, the UI does instantly respond to pressing the “red handset” button. There is no slowness or lag, it’s very responsive. After I press the Hangup button, the call window instantly closes and a system notification is displayed that the call has ended (with connection time 0:00:00), i.e. everything looks as it should. The Phone UI acts as if it normally rejected the call. But it doesn’t. It rejects the call only the second time, but even in that case some incorrect signal is sent to the mobile network because instead of being forwarded to voicemail (or busy tone being sent if there is no voicemail forwarding enabled) like it is with this SIM card in any other phone (or even in this same phone reflashed with Android), the caller hears “beep beep beep” connection error tone. Something is simply scr*wed up with modem handling by SFOS.

BTW. I’ve just entered Android settings, checked ringtone settings there and identified that this second ringtone being played simultaneously with my SFOS ringtone is the default Android ringtone. So maybe it is the Android support stuff doing all this mess.

1 Like

I just tested around 10 times, in my XA2, one sim, SFOS 4.3, with and without android support, and every time it worked right (finishing calling in the first reject)

I’ve tried to find a workaround in order to be able to finish my call rejecting app. The idea was that if the hangup method doesn’t work, then I’ll use the deflect method to forward unwanted calls to voicemail.

So I did this:

QDBusMessage m = QDBusMessage::createMethodCall("org.nemomobile.voicecall",
                                                    "/calls/active",
                                                    "org.nemomobile.voicecall.VoiceCall",
                                                    "deflect");
m << "+48602951000";  // voicemail phone number here
QDBusMessage response = QDBusConnection::sessionBus().call(m);

Result? “Problem with network” (“Problem z siecią” in Polish) notification is shown and the incoming call keeps ringing and doesn’t get deflected / forwarded.

Apparently, Sailfish OS’ telephony isn’t compatibile with Polish T-Mobile network.

Same bug on Jolla 1 phone:

Upgrading to 4.4 has broken Phonehook and I can’t seem to get it to reinstall (versioning repo issues so it might get fixed at some point), it’s made me realise how brittle it is, to rely on an application for call blocking. While I appreciate what @wetab73’s trying to do here, we really, really need this building into the OS.

5 Likes

My application is ready and I use it. It has configurable whitelist and blacklist mode and it does its job. It’s Sailjail friendly, including normal access to the contacts database, etc.

However, I am not releasing it yet because besides the ofono patch so that hanging up works correctly in certain networks, there is another problem to solve:

ofono is VERY SLOW to react to the call hangup command, and in many cases it takes it long enough to hangup the call for the first ring to be heard for about 1 second. I’ve noticed that it happens very rarely (almost never) on 3G, but if 4G network is in use (which gets switched to 3G when there’s an incoming voice call) then apparently such a switch from 4G to 3G delays hanging up the call enough for the ringtone to be heard for a second or so ALMOST ALWAYS.

I’ve tried to first silence the ringtone using

QDBusMessage m = QDBusMessage::createMethodCall("org.nemomobile.voicecall",
                                            "/calls/active",
                                            "org.nemomobile.voicecall.VoiceCall",
                                            "silenceRingtone"); 
QDBusConnection::sessionBus().call(m);

but I can’t make it work at all.

I’m currently using

org.nemomobile.voicecall.VoiceCall.hangup

to reject calls, but maybe using

org.ofono.VoiceCallManager.HangupAll

turns out to be quicker…? I’ll need to further experiment with it in order to make it quick enough to always hangup the call BEFORE it manages to start ringing. Which, I’m afraid, won’t be easy. Only then I will release my app for public use.

2 Likes

Moving the “call again” button to a different screen position so that this would not happen is a feature request I have made before.

(btw, this is generic UI issue now in the modern world of uselessly slow UIs on multi GHz cpus)

2 Likes

I used to sometimes get that with Phonehook, if it’s any consolation.

Good luck with it, and it is appreciated. Sailfish is old enough now though, that it shouldn’t need doing, I think.
These days nuisance calls are common enough these days, that it should be built into every phone OS, by default.

1 Like

It takes the OS (or more precisely ofono) too long to process the hangup command, sometimes only after the phone already started ringing… This affects all such applications - mine, Phonehook, any other… I’ve just checked Phonehook source code and it uses the same D-bus call as my app to org.nemomobile.voicecall.VoiceCall.hangup

Maybe that’s why there is no such functionality built into the OS as currently it can’t be made working 100% OK, i.e. without the ringtone sometimes being heard for a second or two (and sometimes the phone UI appearing for a fraction of a second as well).

I guess it’d need some optimizations to ofono to make it work faster in this regard.

2 Likes