Commit Graph

15511 Commits

Author SHA1 Message Date
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
21c8feb731 meson: link the library with '-Wl,-Bsymbolic'
Change-Id: I2496bc42192ad65135c781476f6f5d4bcc795d19
2021-12-20 15:42:45 +03:00
884549c8c1 build: fix build with --disable-video
Change-Id: I564d9d68f73c20a3105bfd706627b6e3db02aaf5
GitLab: #238
2021-12-17 11:37:17 -05:00
38981578d5 auto-answer - add unit test
Add a media negotiation unit test for auto-answer mode

Gitlab: #645

Change-Id: I37f768ce48e078fbd95a2c9b28997877a4dc468d
2021-12-17 09:35:33 -05:00
c74375b3f8 sipvoiplink: avoid to drop rotation's informations
if videoRtp is not initialized, the information is dropped. So,
it should be stored to avoid any drop of informations.
Note: in the future the container should change, because rotation
is currently applied to all video streams.

Change-Id: I036ffe7b6a248a3d8d7defeff1be78e008447fbd
GitLab: #678
2021-12-16 15:36:43 -05:00
a887b2dee1 SDP - set media direction according to mute state
Currently, the media attribute in the SDP is always set to
'sendrecv' regardless of the mute state of the media.
In this patch, media direction will be set according to mute
state of the media.
Note that this only applies if the mute/unmute requires media
renegotiation (SIP re-invite with new SDP session). Currently,
this only the case for video media. For audio, mute/unmute is
done locally without SIP re-invite.

References:
RFC-3264
RFC-4317 (non-normative)

Gitlab: #645

Change-Id: I604331255bd25dfe732e192039a673a0980105fa
2021-12-16 15:32:36 -05:00
dd700c3177 misc: remove dead code
This code is unused since we introduced processRtcpChecker()

Change-Id: If86295d885997c415e8f1681c6b9ad049c93de9e
2021-12-16 14:32:01 -05:00
40ee25ff8e videomanager: protect double video input creation
getVideoInput is called in two different place:
+ openVideoInput from the client
+ VideoRtpSession::startSender() from the daemon
Nothing is blocking both sides to do it at the same time.
In this case, two VideoInputs can be created, causing the second
one to fail because the device is busy (used by the first one)
and causing weird results (i.e. sometimes the video is not shown).

Change-Id: I23e34a95efe4972fbe111c19f0f0989f5e8ae8a9
2021-12-15 15:36:53 -05:00
ea97002a08 opensl: fix incorrect injected buffer
Sometimes, buffer with incorrect capacity were injected into
the audio, causing the daemon to crash.
Before the stream's split, stopStream was flushing the buffers.
In this patch, stopStream will correctly re-init the buffers and
avoid to inject incorrect buffer into the audio.
Also, remove unused value in buf_manager.h and clean some warnings
for log.
Finally, modify engineServiceRing to avoid many push operations
and make it similar to engineServicePlay

Change-Id: I589cea814452d3dbf5172af6369e448dcd9d5c72
GitLab: #676
2021-12-15 15:05:16 -05:00
41eab75d73 video: fix screen sharing on macOS
Because media encoder flush() involves encoding we should change
initialized flag after calling flush(), otherwise, it could lead to
new stream initializing.

https://git.jami.net/savoirfairelinux/jami-client-macos/-/issues/299

Change-Id: I88d5648a6f252bd78776f505f891f09a4e5b12e1
2021-12-15 12:13:54 -05:00
9c9d11e410 misc: fix typo
- tranport -> transport

Change-Id: I1991ba7324c22625e8b6cdf568357e3ff6540557
2021-12-15 12:01:43 -05:00
09359cdfb3 logger: Fix missing TID for custom timestamp
Change-Id: I3f0015d5f492137592af5d6c247ca439dd75dd38
2021-12-14 13:31:47 -05:00
800dbaba99 logger: Add custom timestamp format
Using JAMI_TIMESTAMP_FMT, developers can now format the log's timestamp
according to their needs and taste.  The formatting is the same as strftime(3).

Change-Id: Ibea56852b2efc37f66aeeeda857e307130099720
2021-12-14 11:00:07 -05:00
1bb4739f59 media-encoder: decouple session creation and initialization
Decouple the creation and the initialization of media coding
sessions to ease the re-initialization of encoding session
(when resolution changes for instance).

Gitlab: https://git.jami.net/savoirfairelinux/jami-project/-/issues/1294

Change-Id: Id5927d4aeb29bc9d4fe806bde6dc9bd28a0e6fe2
2021-12-13 15:07:34 -05:00
3236a6af07 account_archive: add test for import/export on DHT
Change-Id: I547dfeaf1734873ac9f8db82a181769de11a2bb6
2021-12-10 11:54:14 -05:00
a5aed459a0 agent/bindings/conversation: Add swarm bindings
Change-Id: I8a02ae82cb2cf1494a13b263aca0555ab84ed98f
2021-12-10 09:21:18 -05:00
b65146fed3 agent/bindings/account: Add add-contact, remove-contact bindings
Change-Id: I2fca281e9144d06243ca09879a1d86551ccd1996
2021-12-10 09:21:18 -05:00
66ab51817f agent/bindings/signal: Protect from GC callbacks
Change-Id: If91bed7badd8229aee216a91445b758e8901e573
2021-12-10 09:21:18 -05:00
440a71b488 conference: fix current protocol issues
This patch fix 3 little issues:
+ "device" was always empty. Uses the transport to fill the device
field. This will be used in the next version of the protocol.
+ raiseHand was bugguy in two ways:
    + It was only usable by moderators
    + Somebody was able to change the raiseHand for other peers

Change-Id: I32bf37c5063973a5a5962dd8984c87fb05d33a3d
2021-12-09 14:50:33 -05:00
ff37ad28cc dbuscpp: uncomment check for version
Change-Id: I82bde67fed7a295e888c2ea8f96c6e4646f51e64
2021-12-08 16:19:57 -05:00
b4167b175b screensharing: add framerate for macOS
Change-Id: I2a22e80a8ea826641afef9a82bf3b17ca35fcaed
2021-12-08 16:18:11 -05:00
dc71d87c73 media_encoder: avoid segfault on nullptr
Caught by ut_media_encoder:

READ of size 8 at 0x602000029818 thread T0
    #0 0x5649e914d6e0 in jami::MediaEncoder::send(AVPacket&, int) media/media_encoder.cpp:504
    #1 0x5649e914d05c in jami::MediaEncoder::encode(AVFrame*, int) media/media_encoder.cpp:480
    #2 0x5649e8cac119 in jami::test::MediaEncoderTest::testMultiStream() media/test_media_encoder.cpp:183

outputCtx_->nb_streams can be different from encoders.size(), and if
not checked can lead to a crash

Change-Id: I3c0217ec3e1d50950bf46989e0dd6797fee8972e
2021-12-08 08:47:46 -05:00
feb26e4741 sink: avoid deadock during frame size change
Lock was:
    frame #3: 0x00000074f22d0b74 libc++_shared.so`std::__ndk1::mutex::lock()
    frame #5: 0x00000074f2f91b10 libring.so`std::__ndk1::lock_guard<std::__ndk1::mutex>::lock_guard()
    frame #6: 0x00000074f3156d3c libring.so`jami::video::SinkClient::registerTarget() at sinkclient.h:80:37
    frame #7: 0x00000074f3154f74 libring.so`DRing::registerSinkTarget(sinkId="2920319278288091") at videomanager.cpp:527:15
    frame #8: 0x00000074f2f1dccc libring.so`Java_net_jami_daemon_JamiServiceJNI_unregisterVideoCallback()
    frame #45: 0x00000074f2f3491c libring.so`SwigDirector_VideoCallback::decodingStopped()
    frame #48: 0x00000074f319a480 libring.so`void jami::emitSignal<DRing::VideoSignal::DecodingStopped>() at ring_signal.h:66:13
    frame #49: 0x00000074f31993ec libring.so`jami::video::SinkClient::setFrameSize(this=0x00000074c298caa0, width=0, height=0) at sinkclient.cpp:482:9
    frame #50: 0x00000074f3199f74 libring.so`jami::video::SinkClient::update() at sinkclient.cpp:427:13
    frame #51: 0x00000074f316c69c libring.so`jami::Observable<std::__ndk1::shared_ptr<DRing::MediaFrame> >::notify() at observer.h:138:23
    frame #52: 0x00000074f31a7094 libring.so`jami::video::VideoGenerator::publishFrame() at video_base.cpp:56:5


Change-Id: I1824bad767543a3e789e13af1489613a044a7473
2021-12-07 13:13:09 -05:00
9c74ea2cbb contrib: fix build without flock
Change-Id: I274ed5b9b6f97b06e7a355b941f81f86c7816c24
2021-12-07 10:31:58 -05:00
3466f1a2af build: lower minimum required version for webrtc-audio-processing to 0.3
This allows us to build with webrtc-audio-processing distro packages
currently available across supported Debian releases.

Change-Id: I25584a0564ceb78e8eefec78e5e903356c37ddab
2021-12-06 13:55:04 -05:00
0264efe968 ffmpeg: enable mkv support
This fix ut_media_encoder
Also avoid crash when outputCtx_ is nullptr and the format is unrecognised.

Change-Id: I6df5a2e229e0313ea2b3c34b37f9f2900058c75f
2021-12-03 10:43:23 -05:00
ac4993401a video sender: allow sending encoded packets
This fixes Android' accelerated video encoding

Change-Id: Ie0cc7f3699f8c74eb205a395ae4235b1b1a7af89
2021-12-02 17:39:03 -05:00
de0b797836 sinkclient: add the ability to disable shm via libwrap
This allow to generate jamid for dbus usage and client-qt with
libwrap.

Change-Id: Ia23a0cec2efb4347166e0123c662da6c134c2238
GitLab: https://git.jami.net/savoirfairelinux/jami-project/-/issues/1312
2021-12-02 12:16:21 -05:00
cc8fb02462 x11: window sharing
+ If in screen sharing, the hardware acceleration encoding is disabled

GitLab: https://git.jami.net/savoirfairelinux/jami-project/-/issues/1294

Change-Id: I24982b4454d724bb86059a50a3c2d01fe6fab147
2021-11-30 12:08:50 -05:00
35e4cfce40 multiplexed_socket: fix race condition on acceptation
Because some callbacks can take a long time (accepting a SIP channel
will starts to sync profiles, ask for new channel, etc), control packets
are handled in their own thread. However, if the peer accepts a request,
it can starts to use it and send data on it. When finished, it will close
the socket and both peer will remove the channel.
In some case, the channel can be removed before
MultiplexedSocket::Impl::onAccept, causing upper layers to handle a
bad channel. In this patch, we removes the channel only when upper layers
know that the channel is accepted and ready to use. Also, onAccept()
doesn't create wrong channels (which was a bug, where isInitiator() was
in the wrong state).

GitLab: #659
Change-Id: I4f45feacc2624ce0135ace09f7e0188b56fcf81f
2021-11-29 09:57:52 -05:00