Correct connection sequence to maximize chances of e.g.: getting connected :)

Aleksander Morgado aleksander at aleksander.es
Mon May 4 12:44:30 UTC 2020


Hey!

> I would like to ask some advice for Voice calls handling.
> I will at some point get a MMModemVoice to which I'll connect some GSignals to keep track of when new call objects are added and removed (e.g.: via mmcli).
> My callbacks will be invoked with the MMModemVoice object as argument, and the const gchar path of the object itself.
> Should I implement a search function where I get the calls list and search for the call with that path as object, like it's done for SMS here:
> https://source.puri.sm:443/Librem5/purple-mm-sms

Yes, that is possibly the easiest way to do that. It is guaranteed
that by the time you get the "new call" signal invoked, the internal
call list in the voice interface (Calls property) already has the new
call object available, so you just need a quick lookup based on the
path as you said.

>
> or is there another way to get a MMCall object directly? I remembered trying to get such an object various ways but didn't find the correct solution.
>

Nope, no.

> Second, I guess that the "marshallers" for these GSignals, like the ones for SMS messages, don't provide for a way to pass user_data around.
> am I wrong? Should I recur to static variables in the C file ? Or is there a different possible solution?
>

No no, that's not right. You can definitely use user_data passed
around. You g_signal_connect() for the "call-added" signal passing the
user_data as last argument and once the callback is called, you'll
receive the user_data you gave in the connect() just after the object
path argument.

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list