bluez5: telephony: implement asynchronous D-Bus calls

This removes the need to call poll() on the rfcomm socket in order
to wait for replies from the AG.

Use a queue to buffer all the commands that are to be sent to the AG
and match them to replies when they are received. Optionally associate
each command with a DBusMessage that is assumed to be a method call
from the telephony interface, which is then replied to when the rfcomm
command reply is received. Also associate each command with a state,
so that it is always deterministic what gets executed after the reply
is received.

On the telephony module, pass on the DBusMessage on the callbacks and
add a method to allow the receiver to send a reply. Only send FAILED
directly when the callback is not handled. Also, remove the return value
from the Dial() command (it was not advertised on the introspection
anyway) to make things easier.
This commit is contained in:
George Kiagiadakis 2025-07-25 22:15:17 +03:00 committed by Wim Taymans
parent 0b647a9009
commit e4b0f68e0b
4 changed files with 369 additions and 628 deletions

View file

@ -102,10 +102,10 @@ NOTE: This method is implemented only on the `org.ofono.VoiceCallManager`
interface, for compatibility. Call announcements are normally made available via
the standard `org.freedesktop.DBus.ObjectManager` interface.
`object Dial(string number)`
`void Dial(string number)`
Initiates a new outgoing call. Returns the object path to the newly created
call.
Initiates a new outgoing call. If this succeeds, the new call is announced via
the signals.
The number must be a string containing the following characters:
`[0-9+*#,ABCD]{1,80}` In other words, it must be a non-empty string consisting
@ -176,12 +176,12 @@ Possible Errors:
* org.pipewire.Telephony.Error.InvalidState
* org.freedesktop.DBus.Error.Failed
`array{object} CreateMultiparty()`
`void CreateMultiparty()`
Joins active and held calls together into a multi-party call. If one of the
calls is already a multi-party call, then the other call is added to the
multiparty conversation. Returns the new list of calls participating in the
multiparty call.
multiparty conversation. Changes to the call objects are announced via the
signals.
There can only be one subscriber controlled multi-party call according to the
GSM specification.