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 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.