We have moved to a new Sailfish OS Forum. Please start new discussions there.
5

call from command line

asked 2015-08-10 12:53:38 +0300

pan tau gravatar image

updated 2016-01-06 00:42:00 +0300

piero gravatar image

how to:

  • create outgoing call from command line?

  • detect if person answered or rejected call

  • hang call

thinking about scenaria where jolla make call to specific person and idealy change pulseaudio routes to play mp3 instead sound from microphone

purpose: call service man if there is new support ticket, to force his action even in night...

edit:

basic functionality works, if there are new email in Maildirs, count of emails is stored to text file, jolla via systemd timer checking that textfile over https (curl) and then store dialout time to prevent dialing often than minimal interval.

dbus needs in the dialout script which is called by systemd service:

export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/100000/dbus/user_bus_socket
edit retag flag offensive close delete

Comments

4

Hej,

For the first question, try this code:

gdbus call -e -d com.jolla.voicecall.ui -o / -m com.jolla.voicecall.ui.dial '+0123...'

LVPVS out.

LVPVS ( 2015-08-10 21:24:00 +0300 )edit

great, thank you

i also found Mute speaker signal, but as i am not friend with dbus i had no luck on send signal properly (syntax)

i wonder if there is any way how to detect if person rejected or accepted call

pan tau ( 2015-09-01 02:17:03 +0300 )edit

@LVPVS cool, and to end the call: gdbus call -e -d org.nemomobile.voicecall -o ``/usr/lib/qt5/bin/qdbus org.nemomobile.voicecall | grep "/calls/.\{32\}"`` -m org.nemomobile.voicecall.VoiceCall.hangup. I got these informations with dbus-monitor command. You can get qdbus command with pkcon install qt5-qttools-qdbus. PS: there is no double backticks for qdbus command, only one backtick at the beginning and the end of command but I don't know how to escape backticks with Askbot used by together.jolla.com.

baptx ( 2016-11-08 23:09:53 +0300 )edit

Dialling with the string gdbus call -e -d com.jolla.voicecall.ui -o / -m com.jolla.voicecall.ui.dial '+0123...' doesn't work for me on XA2+ with dual sim. Is there an extra parameter to specify the sim to use for the call?

jollajo ( 2019-11-26 17:52:16 +0300 )edit

As alread implied by @baptx in his comment, I just found out that in more recent Versions of SFOS the destination and method parameter have changed to "org.nemomobile.voicecall" and "org.nemomobile.voicecall.VoiceCallManager.dial".

jollajo ( 2019-11-26 20:45:54 +0300 )edit

1 Answer

Sort by » oldest newest most voted
4

answered 2019-11-26 20:49:47 +0300

jollajo gravatar image

updated 2019-11-26 20:51:37 +0300

I wrote a little script to initiate and terminate calls from my Linux desktop: (The hostname 'jolla' is defined in ~/.ssh/config, to allow ssh sessions without password)

#!/bin/sh

[ $# -ne 2 ] && echo "usage: $0 <sim1 | sim2> <phone number>" && exit
[ "$1" != "sim1" ] && [ "$1" != "sim2" ] && echo "usage: $0 <sim1 | sim2> <phone number>" && exit

SIM=""
[ "$1" = "sim1" ] && SIM=/org/freedesktop/Telepathy/Account/ring/tel/ril_0
[ "$1" = "sim2" ] && SIM=/org/freedesktop/Telepathy/Account/ring/tel/ril_1

ssh jolla "gdbus call -e -d org.nemomobile.voicecall -o / -m org.nemomobile.voicecall.VoiceCallManager.dial ${SIM} $2" > /dev/null
sleep 1
MYCALL=$(ssh jolla "/usr/lib/qt5/bin/qdbus org.nemomobile.voicecall" | grep "/calls/.\{32\}")

kdialog --yesno "Calling $2 on $1\nHangup?" && \
  ssh jolla "gdbus call -e -d org.nemomobile.voicecall -o ${MYCALL}  -m org.nemomobile.voicecall.VoiceCall.hangup" > /dev/null
edit flag offensive delete publish link more

Comments

Also a tiny script to answer an incoming call:

#!/bin/sh
MYCALL=$(ssh jolla /usr/lib/qt5/bin/qdbus org.nemomobile.voicecall | grep "/calls/.\{32\}")
echo $MYCALL
ssh jolla \
  "gdbus call -e -d org.nemomobile.voicecall -o $MYCALL  -m org.nemomobile.voicecall.VoiceCall.answer" > /dev/null

kdialog --yesno "Active call\nHangup?" && \
  ssh jolla "gdbus call -e -d org.nemomobile.voicecall -o ${MYCALL}  -m org.nemomobile.voicecall.VoiceCall.hangup" > /dev/null
jollajo ( 2019-11-26 21:41:19 +0300 )edit
Login/Signup to Answer

Question tools

Follow
5 followers

Stats

Asked: 2015-08-10 12:53:38 +0300

Seen: 1,725 times

Last updated: Nov 26 '19