Commit Graph

348 Commits

Author SHA1 Message Date
17d89dfd8b fuzzing/utils: Add utilities taken from UT
Change-Id: I53c9da27babcbb1c1f678ddf7b885a322d3a4d96
2021-06-25 11:51:27 -04:00
e5623694cf fuzzing: Add actors and dring-sample
Change-Id: Ia946d08f370143ff2e7d9ece379ad63a8207a4b3
2021-06-25 11:51:27 -04:00
91adbe56f2 fuzzing/common: Common definitions
Change-Id: I5a3718b9c19800bd6615b52a050f6f443394136e
2021-06-25 11:51:27 -04:00
c9757b595d auto-tools: Add fuzzing directory
Change-Id: I189cdf06e74314f6e35b34addafe599d39f2dc42
2021-06-25 11:51:20 -04:00
e5d95eb6d4 test: fix testMemberJoinsNoBadFile by waiting for join before copying
Change-Id: I4e34411c6e362c2aca31337224b077f7674d73da
2021-06-22 16:28:11 -04:00
eaeb865a33 ut_syncHistory: fix testCreateConversationWithMessagesThenAddDevice
sendMessage is async, causing messages to be mixed before the assert

Change-Id: Ia08855a6a1516db2ee5acf01c166055831be80eb
2021-06-22 12:20:25 -04:00
35d4ffc9c1 autotools: fix dependency declaration
Change-Id: Ib1eb25f11fccd51424012bb11d5e8586fcc8e575
2021-06-15 14:34:34 -04:00
8044cab4f7 unitTest: fix fileTransfer, syncHistory
Change-Id: I087ee6e3e0e8f1530272a28f6f940571d542ebc4
2021-06-14 15:45:41 -04:00
348ade9e2a multistream: fix compil and logic (ut_call, ut_conference, ut_media_negotiation)
Change-Id: Ia7ed4438ccd466ec0bab60b5a85d9b67f721d0d8
2021-06-11 16:35:06 -04:00
7ca65af186 swarm: send conversationId in trust request confirm to enable swarm
Change-Id: I20add73ed92aece44687bf133914883547dd2f32
2021-06-11 15:26:00 -04:00
14f286bab8 datatransfer: implement downloadFile logic
Add mechanism to re-ask for transfers and sendProfile
with new logic

GitLab: #524
Change-Id: I9f10328ff0e2bd9128e2d7d1afd7fa272dd14cdf
2021-06-11 15:26:00 -04:00
612f7f6b41 data-transfer: re-ask for transfer
add API to ask for a failed transfer. This can be used when the
client detects a transfer they doesn't have yet. It will ask all
members of the conversation to send the transfer back.

GitLab: #136
Change-Id: I1484298c4fa0eabb614132e22d8032612e14b949
2021-06-11 15:26:00 -04:00
e6bd5d7383 swarm: fallback to old conversation even if trust request confirm is missed
Sometimes a non swarm can send a text message via the DHT but not the trust
request confirm. In this case, the discussion must use the old path.

Change-Id: Id0d5223c830abe0840bef167b4be50abc276a72c
2021-06-11 15:26:00 -04:00
d475a227fb swarm: clean APIs
Pass all methods in async and on the io pool if they write into
the repository. Moreover, now MessageReceived guarantees to be
ordered if announced. e.g. if a parrallel merge and commit are done
previously if the merge was done before the commit you could receives
MessageReceived(merge) after MessageReceived(commit). Now it's
impossible. So the linearizedParent is guaranteed to be announced
before.

Change-Id: If4b94f19f5bf5abd4841fc19074231e3411e077d
2021-06-11 15:26:00 -04:00
c216e3e8fa swarm: remove conversation for non-compatible contacts
If a TrustRequest is confirmed without conversationId this means
that the contact don't support swarm. So, we can drop the
conversation and fallback on old path.

Change-Id: Ic8238312fe79e10f340460d20880dbfc8dccf3f7
2021-06-11 15:26:00 -04:00
030983a5f5 swarm: relink filetransfer
Change-Id: Ia80930bdec6b5e125fd559fcd6b125a45b4eba0c
2021-06-11 15:26:00 -04:00
427e6b3ab3 swarm: relink setMessageDisplayed
Change-Id: Ic1e002a1e8edf79c5c392e707dd857c7e88667ec
GitLab: #319
2021-06-11 15:26:00 -04:00
a1b04c7213 swarm: relink setIsComposing for swarm support
GitLab: #320
Change-Id: I82b049cfa83f1e3e38a106bce142c1e7ce31557c
2021-06-11 15:26:00 -04:00
6a3cdc99e5 media_const: move MediaAttribute constants to media_const
Change-Id: Ie8513b083d696604b36d6b3ecd868ce184a398d0
2021-06-11 12:35:36 -04:00
d35d214bc5 multi-stream: report the list of negotiated media
Modify the CallSignal::MediaNegotiationStatus signal to report
the list of negotiated media in addition to the status event.

Gitlab: #564

Change-Id: I9ac77656f4f268317ddd87b085f1581ceac0b5b9
2021-06-11 12:35:01 -04:00
4ca000a819 unitTest/common: Fix missing includes
Change-Id: I08d78c5a243adf1ab78e24528f5798c8a49d3350
2021-06-09 13:34:12 -04:00
302c04d099 unitTest/common: Fix race conditions
Signal handlers can be called after lifetime of stack variables within
`wait_for_*` functions.  Thus, moving or copying the accounts vector to avoid
race condition.

Change-Id: I25eaed11e04b3c3cc6e40662bef326c4fe319603
2021-06-09 13:34:12 -04:00
3c12d9998a ut_conversation: fix wait_for_announcement
Change-Id: I9c0b24842e44eae098307fda5e27f341031074fa
2021-06-08 16:27:58 -04:00
9501a2a42a ice_sdp_parser: Fix wrong function name
Change-Id: I4ef0f1168f94d35b049735a6c739b3bf4d489aa5
2021-06-04 09:41:32 -04:00
68b21ee374 unitTest: Share common.cpp between check programs
Change-Id: I88c44743227dc264a7bae899caccbb02b7a29a69
2021-06-04 09:41:32 -04:00
24dc22576d ut_call: use refuseCall, not hangup to decline
Else, the closing is not guaranteed due to potential 481 errors when invite is
deleted before the message sent.

Change-Id: I7e02b55c7967e336ca6357869034103a36ecb262
GitLab: #559
2021-06-02 14:39:22 -04:00
f3e58e4c8a unitTest/common: Make GCC quiet about unused functions
Change-Id: I783cca7a53677dbaf1815aa6d0a5904f14baf0fd
2021-06-02 12:01:06 -04:00
8a8abc1951 unitTest: Add wait_for_removal_of functions
Change-Id: Icf4453467c246ac29b3d178e73380fbeb174d3cd
2021-06-02 12:01:06 -04:00
cabbc523a8 unitTest: Add load_actors function
Load actors from YAML description for unit tests.

Change-Id: Id1840e2bd7244abf902c9be95589b82503c72840
2021-06-02 12:01:06 -04:00
e4eb13038f test: fix call
Change-Id: I0fbcc84207da1834601a99680842ee0da0dbfde8
2021-06-01 18:53:26 -04:00
c103a9935f tests: add some tests for conferences
Add some basic tests to generate a new conference and validate the mute status
and getConferenceList()

Change-Id: Ie7a0415a2c9f77462044c0c26f237cf1ce5c92fe
GitLab: #558
2021-05-31 14:13:23 -04:00
fbb4c95312 unitTest: Add wait_for_announcement_of function
Change-Id: I200b7fa80f8d0bf769bfb84a2915c220880a1146
2021-05-31 11:20:04 -04:00
298a8e35d8 test: fix tearDown condition
Change-Id: I2204dbe8f5e141cdab23db82d9c9a4d47a90cf80
2021-05-26 20:49:40 -04:00
f98420165f test: add test for trimming ice candidates
Change-Id: I29830dcdcf91b98a75d90a001596a332f256ccd9
2021-05-26 09:24:33 -04:00
1c2131803e ICE/SDP: generate/parse component IDs compliant with RFC-5245
The ICE component IDs are numbered relative to the SDP session, i.e.,
starts from 1 and incremented for each component.
However, RFC-5245 requires that the ICE component IDs are numbered
relative to the media stream, e.g., component IDs 1 and 2 for audio
and component IDs 1 and 2 for video.
This patch allows parsing ICE components IDs in format specified by
the RFC and in the current format.
This patch also allows generating component IDs compliant with
RFC-5245. The generation is disabled by default, and can be enabled
per account on runtime.

Gitlab: #516

Change-Id: I40c0fa54a64b7d729f714c9769ea36335568f4c9
2021-05-20 16:00:22 -04:00
602f0a680b sipcall: add validation for isAudio/isVideoMuted APIs
Change-Id: Id42a16dfd280f835dedc3c007883f1b441d2e9ad
Gitlab: #445
2021-05-17 17:36:14 -04:00
e3c5a978fe jamiaccount: no more calls through dht
Gitlab: #543

Change-Id: I9fcb458e1f3a6fcc1a9d2daad11cdee8a3737d05
2021-05-17 16:35:55 -04:00
ff625b27a9 call: hangup subcalls if a peer decline a call
Due to 6f81927c70 PJSIP_SC_BUSY_HERE is sent
instead of PJSIP_SC_DECLINE. This means that the signal received must be
taken into account for closing other subcalls on a multi-device context.

Change-Id: Iad36d2a5b07eb75d89a31a5476c6aa5ddeec2ced
GitLab: #547
2021-05-14 10:09:05 -04:00
5e69af154d unitTest/call: Increase wait time for accounts announcement
Also add missing newline at end of file.

Gitlab: #545
Change-Id: Ie96ff446d27d40f63fb6f4471b10006bcfba5d46
2021-05-14 08:56:23 -04:00
252f1b005b unitTest/scheduler: Increase timeout
2 seconds is too short on some system to spawn 1024 threads.  Increase this by a
second.  This is highly system dependent and we might want to change the logic
of the test instead.

Gitlab: #545
Change-Id: Id939ad4809e47a2cdce19885387464289110e137
2021-05-14 08:56:23 -04:00
8c8efa4f6d testVideo_input: Call DRing::fini
If not called, other threads might read memories freed by the exit handlers of
the main thread, resulting in a race condition that can cause a segmentation
fault.

Gitlab: #545
Change-Id: I29ec4c1ffee96b6a083e36f31cd738daf622315d
2021-05-14 08:56:23 -04:00
ad8a1f85fd test_media_filter: Make it compile again
There's no implicit conversion from `rational` to `int` for the bitrate
parameters.

Gitlab: #545
Change-Id: Ic8fac9633c05f458992ee7e16cd39cdd16cfb365
2021-05-14 08:49:49 -04:00
36c8db5d0f test/unitTest/Makefile.am: Remove ut_channel
See commit a760dd17ce

Gitlab: #545
Change-Id: I46c5f0ee2cff9cc98c5611747ae7f1d6893aace5
2021-05-14 08:49:47 -04:00
ffa12c740b multiplexed_socket: add ping/pong logic
Detecting that a socket is down via a keep alive can take time, moreover
if a relay is used, because the keep alive can continue to work even if the
connection is half closed.
In this patch, we add a mechanism where a beacon is sent over the multiplexed
socket to know if the peer can answer. This message can be used to detect
if a socket is usable and is sent whenever the user starts a call or that
a connectivityChanged() occurs.
Moreover, the multiplexedsocket can now sends a version to enable features
and if a bad packet on the control socket comes, the socket is not stopped.

GitLab: #542
Change-Id: Ia66d8d7f9b66bba02927f4ea41c21ef27089bceb
2021-05-13 18:11:02 -04:00
dc25cb3ea4 unitTest/fileTransfer: Fix buffer overflows
Wrong constructor was used, resulting in buffer overflows.  Although it's benign
because of read only of a data section, ASAN doesn't like it at all.

Also added missing newline at end of file.

Signed-off-by: Olivier Dion <olivier.dion@savoirfairelinux.com>
Change-Id: I15553855ea368ec00456db80abb065599adc0d49
2021-05-13 17:30:46 -04:00
bac6a6e981 multi-stream: report an incoming call with a media list
Currently, an incoming call is always assumed to have either audio
and video media or only audio media.
This assumption was removed and the incoming call are reported with
the list of included media with some of their attributes as found in
the call invite (SDP). This will allow to process calls with an
arbitrary number of media.
It will also allow to add new media to a call by requesting a media
change using a SIP re-invite (with new SDP). For instance, add video
to an audio-only call. The peer will receive the new offer and may
choose to accept or not the new media.
Not all media change requests require validation from the user/client.
Meaning that for instance, if a new SDP (media change request) is
received to notify that the peer muted it's audio, the media change
request can be processed without requiring validation from the
user/client.

Gitlab: #445

Change-Id: Ibc2b2501a3ec7e2c22f4e9d47cec3eda3dd43fef
2021-05-05 14:32:01 -04:00
f038475435 test: add tests to validate connection to TURN
Change-Id: I3d906c58323627cad51aed6ad21881a9d2c443d9
2021-04-29 17:24:32 -04:00
3152c635d9 unittest: fix build
Change-Id: I4bfaf16797afefba0e33b1f58bfc5f56a6a0ef63
2021-04-22 10:20:53 -04:00
46cdb949a9 swarm: add conversationId to archive and improve sync
Some informations should be save into the archive to allow the
daemon to be able to auto-clone from remote and re-ask for invites
when re-importing an account. Also fix some sync issues caused
by some locks.

Change-Id: I37ba32bcd1c748c933bd264502c5aa5664875bc0
2021-04-21 15:13:02 -04:00
fd944896fa swarm: sync infos such as title/description/avatar
Change-Id: I0b56d6a8583923bfbac350ee497956d8268d11de
GitLab: #381
2021-04-21 15:13:02 -04:00