Commit Graph

15490 Commits

Author SHA1 Message Date
5a83c7a260 build: update opendht
Change-Id: Ia26c97dbe487509d3e346d7c95675bd984d2ab77
2022-03-04 12:31:16 -05:00
4f426634a3 build: hide verbose warning
This warning is caused by ASIO, is harmless, and likely won't be fixed for a while.
Mute it for now.

Change-Id: Ib387aec8138ebed9dc45449ffd19d8ad340044c6
2022-03-04 12:31:01 -05:00
f26f20d567 video interface: homogenize decoding signal names
Change-Id: Ica925c83e44e2326417708768566e33102365ce9
2022-03-03 17:35:14 -05:00
775aa2f803 Build system: No '--disable-shared'
The agent and unit tests can now be compiled without requiring
`--disable-shared' at configuration time.

The agent requires the logger functions to have default visibility instead of
hidden.  Thus, `jami::logger::[v]log' can be considered part of the public API.

The unit tests however require hidden symbols.  Thus, we link the tests against
a static version of libjami instead.

Change-Id: I59d9e67679766e0310a19f9a879c06a31c5124c4
2022-03-03 17:10:21 -05:00
c3d0e5ebee Mute audio: do not change media direction
Mute/un-mute audio is done only locally, i.e. without requesting
a media change (re-invite) as done for the video, thus the media
direction in the SDP must not change for the audio stream.

Gitlab: #688

Change-Id: I3775a29f6c566a159d5b9269b4d9462ab4e3c36f
2022-02-28 09:55:54 -05:00
0f0bb5d89f globals.mk: Remove dead code.
astyle was removed in favor of clang-format in commit
85510893d5.

* globals.mk (ASTYLERC, indent): Delete variables.
(indent): Delete target.

Change-Id: I138f887a5845ff24e12c5c8ece26e30d4cfc7616
2022-02-25 15:20:00 -05:00
3377a4581e manager: Rename the 'ringchoice' local variable to 'ringtone'.
* src/manager.cpp (Manager::playRingtone)<ringchoice>: Rename local
variable to...
<ringtone> ... this.

Change-Id: Ia94ead6dfa070a5c18d3e267e00d8895f38e5b09
2022-02-25 09:28:17 -05:00
e23a88672d account: Make the default ringtone path portable.
Before this change, the default ringtone path would be for example set
to "/data/data/cx.ring/files/ringtones/default.opus" on Android;
migrating the account to GNU/Linux would cause the ringtone to not be
found.  The change leverages existing code that searches for a base
file name in a JAMI_DATADIR-prefixed location.

* globals.mk: Set JAMI_DATADIR from the environment if it's defined.
* src/account.cpp (DEFAULT_RINGTONE_PATH): Universally set to
"default.opus";
* src/manager.cpp: Add a definition check for the JAMI_DATADIR macro.
(Manager::playRingtone): Go through the ringtone path resolution
scheme on all platforms.  Some platforms will need to define the
JAMI_DATADIR macro correctly for this to work; for example the
libjami build on Android should have the JAMI_DATADIR macro set to
"/data/data/cx.ring/files" for this to work correctly.

Accompanying client-android change:
https://review.jami.net/c/jami-client-android/+/21148

Co-authored-by: Amin Bandali <amin.bandali@savoirfairelinux.com>
Change-Id: Ia408a8db263af91c2734f61aa38c4ed717605359
2022-02-25 09:15:40 -05:00
f6bf52ea15 re-invite: bump Daemon version to 11.0.2
Bump Daemon version to 11.0.2 to enable re-invite without ICE
renegotiation.

Gitlab: #671

Change-Id: I287a034b0fb6b6fde77c091ac3543978e533c56a
2022-02-24 13:56:11 -05:00
8a1052781c swarm: banned members MUST NOT receive new messages
membersUris() didn't remove banned members from the list by default,
causing the daemon to send messages to banned members.

Change-Id: I84a80476d36d27ec33379b6e8be38f317322ec3b
GitLab: #298
2022-02-19 10:54:39 -05:00
4ddf1c6f2e swarm: allow admin to kick invited members
/invited was not checked for kicking member, add this directory
and cleanup the function for resolving votes too.

Documentation is updated:
https://git.jami.net/savoirfairelinux/jami-project/-/wikis/technical/\
2.3.-Swarm#remove-a-device-from-a-conversation

https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/340

Change-Id: I18882066e3e42ced8ed656da3b1d2ed0a19929cf
2022-02-19 10:54:39 -05:00
3db5a90828 video: start device event listener when device list is empty
This patch fix video device detection. Before device event listeners
would not start if a video device list is empty.

Change-Id: I5b320c1ae47b945d6f570e3cd2afcd6bd01dfdae
2022-02-18 11:37:55 -05:00
53cf11bd0c swarm: verify all certificates changes
In some cases, a user in the swarm can update its certificates.
However, the new certificate MUST be checked and MUST be signed
by the account.
So, this patch validates two scenarios:
+ Check that a fetch error is sent to the client whenever an invalid
certificate is detected in the original clone
+ Check that a fetch error is sent to the client whenever a
certificate is replaced during the conversation.

Change-Id: Ieb15fb6444dcf4541f00c511a9f4ba0c64617130
2022-02-15 16:00:44 -05:00
d2d18bdedc swarm: handle device's expiration
If a device expires, a migration will regenerate the device's
certificate. In this case, the device certificate in swarms must
be updated.
So, the idea of this patch is to verify that the current certificate
in the repository for this device is still correct. If the device or
the member got invalidated, it tries to replace the current certificate
(updated via the migration). So that the new commits will still be valid.

Change-Id: I75b19b0edbb5601a758a73a4c4a44678d77295e1
GitLab: #684
2022-02-15 16:00:44 -05:00
6e83fc2a45 build: update libarchive path
Change-Id: I3a54032a774b8edb2b8d51ae1115fa84a0487ac7
2022-02-14 16:46:53 -05:00
2269b76fa8 coreaudio: handle the case when no audio device is connected
https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/671

Change-Id: If0f2237042c746214cadb33ef8e56c22fe327a37
2022-02-11 16:21:31 -05:00
7634487e9f libressl: update hash
The hash changed because the libressl team updated their tool,
changing the copyright in the tarball

Change-Id: I0fcf3d65d5058a5fdfdc161aa427758ca20e9a2f
2022-02-09 15:52:29 -05:00
0078370f9e swarm: make sure appdata/contacts is synced with appdata/convInfo
On older versions, removeConversation didn't update appdata/contacts
causing some removed conversations to be announced in contacts details.
On Android, this hide the contact from the smartlist, as it's waiting
for a removed conversation.

Change-Id: I05be12ffcd2e5fe38d84c6f972b97e082c612ac7
GitLab: #714
2022-02-07 15:23:39 -05:00
34af9c4a3a account_archive: re-work migrating process
When a device is expired, the migration will update the certificate
chain with the previous key. So, after a migration, the device's id
must be unchanged.
However, if a device is revoked, this should trigger a re-generation
of the device with a new PrivateKey (so generates a new device).
Add related unit tests.

GitLab: #684 (this is some preparative work)
Change-Id: I7ff0cff97b7285186539cfadc6e33b620ded5b27
2022-02-04 15:59:04 -05:00
57723b8c5a tests: fix ut_conversation
+ testSetMessageDisplayed and testSetMessageDisplayedPreference were
broken because the lastDisplayed behaviour was recently changed to
support syncing across devices. Update the two related tests. Also,
avoid to update the lastDisplayed on merge
+ testSyncWithoutPinnedCert was badly written causing some sporadic
failures.

Change-Id: I364818b4ececb0fa63e87441f55a7da76fe1feb6
2022-02-02 15:45:14 -05:00
afe8b7c307 dbus: add startShmSink
Since the video split, the daemon can manages a lot of Sink clients
which are generally not used by any client. This introduces a lot
of wasted computation.
One of the problems is that every sink client have a SHM memory if
dbus is enabled and any update generates frames for this SHM memory
even if the client is not showing them.
This patch introduces VideoManager::startShmSink, which enable
or disable transfer and works like VideoManager::registerSinkTarget.
Thus, a transfer will only be done if the client is explicitly
asking to transfer frames.

Change-Id: I1d265b7ffcdc37aff9c5f729a146fa26c5d7d4a1
GitLab: https://git.jami.net/savoirfairelinux/jami-product-backlog/-/issues/9
2022-02-02 13:26:19 -05:00
e215d54a7d test/agent/scenarios: Add bulk calls
Gitlab: #687

Change-Id: Ib21093ab520165f02631aab483c1a86efc31aae7
2022-01-28 17:47:06 -05:00
945c4ce971 test/agent/jami/signal: Add syntax rules for signal handlers
Small helpers for signal handling.

`with-signal-handler` is useful for scoping signal handler and
`with-signal-handler-sync` for signal synchronization.

Change-Id: Idc7696fb273003d526f3a4658e7fb5623c2c5827
2022-01-28 17:47:06 -05:00
84c7c9de75 swarm: sync read status across devices
Because swarm is a synched history compatible with multi-devices,
if a message from the swarm is read on one device it should be
synchronized with other devices as much as possible.
The idea of this patch is to add lastDisplayed sent in synched
datas to allow clients to update the read status. However, there
is several scenarios to take into account, because the history
can be partially synched across devices.

5 scenarios are supported:
+ if the last displayed sent by other devices is the same as the
current one, there is nothing to do.
+ if there is no last displayed for the current device, the remote
displayed message is used.
+ if the remote last displayed is not present in the repo, it means
that the commit will be fetched later, so cache the result
+ if the remote is already fetched, we check that the local last
displayed is before in the history to replace it
+ Finally if a message is announced from the same author, it means
that we need to update the last displayed.

If the last displayed message is updated, AccountMessageStatusChanged
is triggered for the client.

Doc: https://git.jami.net/savoirfairelinux/jami-project/-/wikis/technical/2.3.%20Swarm
Change-Id: Iedd29129d72cbeb43499471bdfd492dd4d49dcb6
2022-01-27 21:28:44 -05:00
d1bc939090 jamiaccount: add test for migrations
Accounts can see their certificates expire. When it's the case, a
migration is needed. However, several regressions can happen, because
this behaviour can be tricky to test correctly. In this patch, a
test is added to validate that the migration is done whenever the
certificate expires.

+ OpenDHT needs to be bumped in order to be able to change the validity
period of a certificate.
+ In ArchiveAccountManager, a method is added to change the validity
of a certificate in the chain.
+ This patch also fixes a crash when a migration occurs directly on
the archive (info_ was null causing a segfault).
+ Finally, cleanup some signatures unused in JamiAccount.

GitLab: #684 (this is some preparative work)
Change-Id: I901bc67fd63ce2ab26ded64662f8333d3a0eed50
2022-01-26 15:18:07 -05:00
9fa8bf161a conversationrepository: fix isValidUserAtCommit
The method was bugguy, because the whole point here is to check
if the conversation contains enough informations at this point to
validate the user, not to compare with pinned certificate.
Moreover, a user can sync the history from another device, without
ever connecting to the original author, so the certificateStore
will not have the device certificate in this case, so only uses
from the repository.
A test is added to reflect this.

Change-Id: I3af5e7769174eedcb54e17181d4530593960c9c9
2022-01-25 13:13:01 -05:00
70a2a65086 SIP call: re-invite without ice re-negotiation
When muting/un-muting the video, a re-invite is performed
leading to a full media renegotiation and restart,  including
ICE session if used.
With these changes, the mute/unmute video will still require
a re-invite (a new SDP to indicate the new media directions), but
the ICE session is re-used and only the video is stopped/started
accordingly.
The behavior improves the UX by avoiding unnecessary audio disruptions
and is more compliant with SIP/ICE specs (see RFC-5245 section 9.1.1.1
for example)

Gitlab: #671

Change-Id: I13caf9a965af1d76e922fe5f6b86d5332b3296d6
2022-01-25 10:09:13 -05:00
518b4b0492 misc: remove unused files
Major part seems from SFLPhone

Change-Id: Icc557d84acf96b35520a03e998b710fb553c93b1
2022-01-24 13:22:42 -05:00
a290a6f7f2 misc: remove shortcuts preferences
Unsed by all the clients, since years.

Change-Id: I47654d25a04b9574ddac8a717adec25ba3efaa90
2022-01-24 13:22:38 -05:00
90a5ea27c6 certstore: make TrustStore thread safe
Because multiple threads can access the TrustStore to update/add/rm
certificates, introduce a mutex to protect the maps.

Because a lot of methods only access the maps in read-only, the
mutex is mutable. Moreover, because isAllowed will check the whole
chain, to avoid multiple lock/unlocks, the mutex is a recursive one.

Change-Id: Iec197221e2eefba4a7192f36f1a9a952f2533778
GitLab: #690
2022-01-24 11:06:41 -05:00
8ca7dd3acb conference/auto-answer: fix request media change
In conference and auto-answer mode, if the remote peer requests
a media change, the remote media was used to configure the local
media. This is bad, since if the remote muted its audio, it will
also mute the local audio.
Now, the existing media will not be modified, and the new media
will be automatically added if any.

Gitlab: #688

Change-Id: Id5388ed916eaa5755202b4b5b5fad118f0dc9c1e
2022-01-21 10:45:42 -05:00
754ae6bfdb build: Rename PROGSHAREDIR to JAMI_DATADIR.
This name matches a common naming convention in build systems.

* compat/msvc/config.h (PROGSHAREDIR): Rename to...
(JAMI_DATADIR) ... this.
* globals.mk (-DJAMI_DATADIR): Likewise.
* meson.build (conf): Likewise.
* src/account.cpp: Likewise.
* src/manager.cpp (Manager::playRingtone): Likewise.

Change-Id: I123251f3e420948bc7359ce0a3ac54bddd12977a
2022-01-20 13:31:58 -05:00
89b7ffe91f jamiaccount: avoid to block in doUnregister if ERROR_GENERIC
If the account is incorrectly registered (i.e. the common case
is that the DHT socket is not correctly initialized),
setRegistrationState(RegistrationState::ERROR_GENERIC) will be
called and the dht will not be usable.

Calling doUnregister will cause the daemon to block on
dht_->shutdown(). Because the account is not ready to be used,
doUnregister() should do nothing if any error happened during the
registration.

Also, removes 2 unused states.

Change-Id: I0393786afea8c13506c7c87caf265b09182ea0ae
2022-01-19 16:51:16 -05:00
bdc5a12a07 conversation_module: avoid double lock
cloneConversation try to lock conversationsMtx_ a second time.

Change-Id: I1e685a7ad478d1153ec480d2a7dd3ac962478099
2022-01-14 10:02:28 -05:00
523b2780bf account_archive: add test to validate changeAccountPassword
Change-Id: I7380645f022b1b08d2a961e191c3dd978916fe0e
2022-01-12 12:43:34 -05:00
7c73d69c7e fmt: uses 6.0 as th minimal version
fmt from the system on Fedora is not working properly

Change-Id: Ic28a976e110fc168faa3b985cc0852a31ec34114
2022-01-10 10:30:31 -05:00
70ed6c52ef dbus: avoid using of non-API library headers
Change-Id: I89e0f1a9006e01690fdf4fdc8cd49f404733d0bf
2022-01-08 01:10:17 +03:00
5018565239 misc: update copyright date to 2022
Change-Id: I795e3f2f69c07349bf84c87dbcafb502dc8490f8
2022-01-05 16:21:58 -05:00
399b2ff689 misc: clean dbus warning
https://git.jami.net/savoirfairelinux/jami-libclient/-/issues/408

Change-Id: I930b1498b0cffc90c16cc7f4b0214f5da855b6e9
2022-01-05 12:22:18 -05:00
256743d590 meson: update tests
Change-Id: I834b8f24f94e639ab65272a2ff7e5ac4ea84c725
2022-01-05 12:15:55 -05:00
4b778bb6ca jamiaccount: refresh deviceAnnounced_
deviceAnnounced_ should be cleared if unregistered, to be valid for
next annoucement

Change-Id: I35d62e01d11780d4b30c312ec695b9cb0321d618
2022-01-03 15:09:43 -05:00
f2cf4eda8c ice-media: proper handling of re-invite
When processing an incoming or outgoing re-invite, the ice media
session and its associated RTP sessions are kept until the
new ice media session is successfully negotiated.

Gitlab: #666
Change-Id: I608d241d82b346b2c190ada046eed86dd86a7178
2022-01-03 13:45:36 -05:00
e14868e43b doc/agent: Add agent documentation
Change-Id: I028985ac90d07199cfa30d33e21f55ebef228ff3
2021-12-30 11:30:29 -05:00
8bab18aad4 agent: Add compilation of Scheme file
Change-Id: Ic25a41cb28ae1e8b8dc51a149c304edc7f04ef50
2021-12-30 11:30:29 -05:00
aadc86900d agent: Add commentaries to examples and peer-monitor scenario
Change-Id: I3aae03770f302bfe043f7bf6070a99a0d56fcebc
2021-12-30 11:30:29 -05:00
ce1995d172 agent: Use GOOPS
GOOPS is Guile Object Oriented Programming System.

It's easier to extend and break less the scenarios using GOOPS.  e.g., a
scenario published on Gitlab should work two weeks later.  This is not the case
right now and the goal of using GOOPS is to offer a stable API for the agent,
while keeping it flexible.

Change-Id: If6a038b6d8c371f8e74849749770f1dec8559b91
2021-12-30 11:30:29 -05:00
cefe9ce86b docker: add meson for CI
Change-Id: I1e8e88f993d8fa66224ea1bcd48d6e9fbcb39d5e
2021-12-28 16:53:48 -05:00
ee1b80d991 sipvoiplink: reset transport after callbacks
callbacks, such as transaction_request_cb uses the sipTransportBroker
object. So, sipTransportBroker MUST be destroyed after that every
callbacks are called, so after the destruction of endpt_

Change-Id: I795e02544abf9188db4971d7465ac537b1a568d9
GitLab: #681
2021-12-28 15:54:33 -05:00
02c5cecd36 agent/active-agent: Fix calling problems
Change-Id: I3f7b3fd9e5bea986f5b600273ae4ddb07bdd787a
2021-12-23 09:52:48 -05:00
ea6a019d97 logger: Add NO_COLOR for console logger
Change-Id: I02ccb3c2d05aaa14a7f42dd0c6e2854f9905ccf2
2021-12-22 10:59:09 -05:00