Phone call API?

Is there API access to phone calls?

e.g. to start a call, and to audio input / output over the phone?

I don’t know that it is documented yet. My understanding is it uses dbus messages to make calls and route the audio. It shouldn’t be too hard to rip into the dialler program to see what messages it sends, and either send or subscribe to those messages in a different program.

1 Like

Dunno about an API, but the source is here:

So one can in principle dig in and see what is happening


As I understand it, Calls doesn’t itself provide an API for making calls.

You could probably use ModemManager’s Voice API instead.


Just to follow up on this, I enabled the modem, unlocked my SIM card, then waited for the Voice interface to become available.

Then I entered this command in the shell (note that the /3 at the end is for the particular modem instance I had):

sudo gdbus call --system \
                --dest org.freedesktop.ModemManager1  \
                --object-path /org/freedesktop/ModemManager1/Modem/3 \
                --method org.freedesktop.ModemManager1.Modem.Voice.CreateCall \
                         "{'number': <'********'>}"

where ******** is a phone number.

This started a call and Calls popped up to show that the call was in progress.


Is that the first time a phone call was made via command line from a device not wired to anything?

Sort of obscure, but it’d still be neat.

No, not the first, i was doing it on SFOS and am pretty sure it was doable before on N9

Ah well. I’ll be a part of some other piece of history.


I wonder if audio is accessible just through… hooking into an ALSA device? (though I hesitate to use the word “just” when talking about ALSA)

As a former Acorn user, it’s cool to be talking to a Boddie :slight_smile:

I don’t know enough about calling to be able to say, unfortunately. :frowning_face:

It’s good to see familiar faces here, I guess! :blush:

Yes, the call audio is just routed through ALSA. I don’t know if the chipset used has a hardware DSP or not (probably not), so you probably can’t just open the alsa device to listen and have the audio continue routing out the speaker/out the modem. Also note that Pulseaudio will almost certainly have grabbed exclusive lock on the hardware devices, regardless of DSPs (hardware or software). You can work around this by either configuring a software DSP and making pulseaudio use that, or ripping pulseaudio out and doing something else (arecord | aplay or similar).

I’ve made no secret that my plan is to replace pulseaudio with jack2 and a manager script, as that makes splitting streams trivially easy.