1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries from January
2021</title>
5 <description>Entries from January
2021</description>
6 <link>http://people.skolelinux.org/pere/blog/
</link>
10 <title>Latest Jami back in Debian Testing, and scriptable using dbus
</title>
11 <link>http://people.skolelinux.org/pere/blog/Latest_Jami_back_in_Debian_Testing__and_scriptable_using_dbus.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Latest_Jami_back_in_Debian_Testing__and_scriptable_using_dbus.html
</guid>
13 <pubDate>Tue,
12 Jan
2021 17:
00:
00 +
0100</pubDate>
14 <description><p
>After a lot of hard work by its maintainer Alexandre Viau and
15 others, the decentralized communication platform
16 <a href=
"https://en.wikipedia.org/wiki/Jami_(software)
">Jami
</a
>
17 (earlier known as Ring), managed to get
18 <a href=
"https://tracker.debian.org/pkg/ring
">its latest version
</a
>
19 into Debian Testing. Several of its dependencies has caused build and
20 propagation problems, which all seem to be solved now.
</p
>
22 <p
>In addition to the fact that Jami is decentralized, similar to how
23 bittorrent is decentralized, I first of all like how it is not
24 connected to external IDs like phone numbers. This allow me to set up
25 computers to send me notifications using Jami without having to find
26 get a phone number for each computer. Automatic notification via Jami
27 is also made trivial thanks to the provided client side API (as a DBus
28 service). Here is my bourne shell script demonstrating how to let any
29 system send a message to any Jami address. It will create a new
30 identity before sending the message, if no Jami identity exist
36 # Usage: $
0 <jami-address
> <message
>
38 # Send
<message
> to
<jami-address
>, create local jami account if
41 # License: GPL v2 or later at your choice
42 # Author: Petter Reinholdtsen
45 if [ -z
"$HOME
" ] ; then
46 echo
"error: missing \$HOME, required for dbus to work
"
50 # First, get dbus running if not already running
51 DBUSLAUNCH=/usr/bin/dbus-launch
52 PIDFILE=/run/asterisk/dbus-session.pid
53 if [ -e $PIDFILE ] ; then
55 if ! kill -
0 $DBUS_SESSION_BUS_PID
2>/dev/null ; then
56 unset DBUS_SESSION_BUS_ADDRESS
59 if [ -z
"$DBUS_SESSION_BUS_ADDRESS
" ]
&& [ -x
"$DBUSLAUNCH
" ]; then
60 DBUS_SESSION_BUS_ADDRESS=
"unix:path=$HOME/.dbus
"
61 dbus-daemon --session --address=
"$DBUS_SESSION_BUS_ADDRESS
" --nofork --nopidfile --syslog-only
< /dev/null
> /dev/null
2>&1 3>&1 &
62 DBUS_SESSION_BUS_PID=$!
64 echo DBUS_SESSION_BUS_PID=$DBUS_SESSION_BUS_PID
65 echo DBUS_SESSION_BUS_ADDRESS=\
""$DBUS_SESSION_BUS_ADDRESS
"\
"
66 echo export DBUS_SESSION_BUS_ADDRESS
72 part=
"$
1"; shift
73 op=
"$
1"; shift
75 --dest=
"cx.ring.Ring
" /cx/ring/Ring/$part cx.ring.Ring.$part.$op $*
79 part=
"$
1"; shift
80 op=
"$
1"; shift
81 dbus-send --session --print-reply \
82 --dest=
"cx.ring.Ring
" /cx/ring/Ring/$part cx.ring.Ring.$part.$op $*
86 dringopreply ConfigurationManager getAccountList | \
87 grep string | awk -F
'"' '{print $
2}
' | head -n
1
90 account=$(firstaccount)
92 if [ -z
"$account
" ] ; then
93 echo
"Missing local account, trying to create it
"
94 dringop ConfigurationManager addAccount \
95 dict:string:string:
"Account.type
",
"RING
",
"Account.videoEnabled
",
"false
"
96 account=$(firstaccount)
97 if [ -z
"$account
" ] ; then
98 echo
"unable to create local account
"
103 # Not using dringopreply to ensure $
2 can contain spaces
104 dbus-send --print-reply --session \
105 --dest=cx.ring.Ring \
106 /cx/ring/Ring/ConfigurationManager \
107 cx.ring.Ring.ConfigurationManager.sendTextMessage \
108 string:
"$account
" string:
"$
1" \
109 dict:string:string:
"text/plain
",
"$
2"
110 </pre
></p
>
112 <p
>If you want to check it out yourself, visit the
113 <a href=
"https://jami.net/
">the Jami system project page
</a
> to learn
114 more, and install the latest Jami client from Debian Unstable or
117 <p
>As usual, if you use Bitcoin and want to show your support of my
118 activities, please send Bitcoin donations to my address
119 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>