1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-11-16 13:25:39 +00:00
Commit graph

92 commits

Author SHA1 Message Date
Evangelos Ribeiro Tzaras
50e7c87a4d sip: Store media encryption account preference to disk 2022-05-24 22:48:59 +02:00
Evangelos Ribeiro Tzaras
e75e04fb4e sip: Allow specifying if media encryption is desired
A property of type SipMediaEncryption is added to both the origin and
the call which allows to state if we want the media session to be
encrypted with SRTP.

Logic is added to interact with the CallsSdpCryptoContext if encryption
is desired.
2022-05-24 22:48:56 +02:00
Evangelos Ribeiro Tzaras
0e57d31c1e sip: media-manager: Include crypto attributes for capabilities
The API is changed to accept a list of calls_srtp_crypto_attributes
which get inserted into the SDP line.
2022-05-24 22:30:03 +02:00
Evangelos Ribeiro Tzaras
14350a38ed sip: Add SDP crypto context class
Objects of this type keep track of SDP of the local and remote peers,
allow generating offers and answers and codify default policy used for
cryptographic parameters.
2022-05-24 22:30:03 +02:00
Evangelos Ribeiro Tzaras
ea5b4f2895 sip: media-pipeline: Use cryptographic parameters
Allows setting up cryptographic parameters with
calls_sip_media_pipeline_set_crypto() and use them to set GstCaps for
GstSrtpDec and GObject properties for GstSrtpEnc
2022-05-24 22:30:03 +02:00
Evangelos Ribeiro Tzaras
4937723541 sip: Add srtp-utilities
These utilities aid in generating and parsing SDP crypto attributes to be used
during the offer/answer negotiation.
2022-05-24 22:30:03 +02:00
Evangelos Ribeiro Tzaras
e052201553 tests: Add testing for sideeffects of using CallsSettings
When setting up a binding between GSettings and GObject properties the
CallsSetting used to set the value from the GSetting to the property and
back to the GSetting.

While the value was still the default value it was marked as non default
because it had explicitly been set without any user interaction.
2022-05-13 19:58:07 +02:00
Evangelos Ribeiro Tzaras
94fa13af4c settings: Convert to the singleton pattern
We only have a single source of settings, so we should reflect that by
using a singleton. This also reduces our LoC.

This doesn't impair our ability to run tests because there we run with
GSETTINGS_BACKEND=memory
2022-05-13 19:58:07 +02:00
Evangelos Ribeiro Tzaras
85ee014cc9 tests: media: Rename tests 2022-04-12 08:03:49 +00:00
Evangelos Ribeiro Tzaras
acfd185e9e tests: media: Test pipeline
Run some basic tests on the pipeline
2022-03-05 23:02:15 +01:00
Evangelos Ribeiro Tzaras
849f298609 sip: media-pipeline: Remove lport-rtp and lport-rtcp property
We're not setting the desired ports from the outside anymore, but rather
querying the ports that have been allocated by the operating system.

Therefore the lport-rtp and lport-rtcp property have become superfluous and are
being removed. We also adapt to changes outside of the pipeline code.
2022-03-05 23:02:15 +01:00
Evangelos Ribeiro Tzaras
30c4e90499 ui-call-data: Store origin id and adapt to changes 2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
16b86c29b2 origin: Add id property and adapt to changes
The id property will be used to keep track of which origin was used for a call,
so that we can default to reusing the same origin when placing a call from the
history.
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
c2d2c33eae tests: build: Avoid linking against sip module
Fixes the deprecation warning from meson:

DEPRECATION: target sip links against shared module sip, which is incorrect.
             This will be an error in the future, so please use shared_library() for sip instead.
             If shared_module() was used for sip because it has references to undefined symbols,
             use shared_libary() with `override_options: ['b_lundef=false']` instead.
2022-03-02 09:16:12 +01:00
Evangelos Ribeiro Tzaras
f017261c59 tests: Split media tests into separate file
This gives us a better separation of concerns and it will make it a bit easier
to move the sip independent media pieces out of the plugin in the mid to long
term.
2022-03-01 18:24:04 +01:00
Evangelos Ribeiro Tzaras
ab64421880 tests: sip: Initialize and deinitialize GStreamer explicitly 2022-03-01 18:04:18 +01:00
Evangelos Ribeiro Tzaras
c3c099294c tests: sip: Codestyle: Use int and char instead of gint and gchar 2022-03-01 18:04:18 +01:00
Evangelos Ribeiro Tzaras
bac8b81a43 tests: util: Test STR_IS_NULL_OR_EMPTY macro 2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
f0cd344072 tests: Add primitive contact tests
This makes sure that a NULL id will return a NULL contact and additionally
asserts that even a NULL contact will give us sensible primary/secondary display
information.
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
3fe976505c manager: Delay UI Call removal and adjust to changes
This was handled explicitly in the Call window.
By changing the logic to delay the emission of "ui-call-removed" we make sure
that the Call UI and the exported DBus object is consistent.

We also need to change the test cases to use run a GMainLoop because we now have
to wait until signal comes in.
2022-02-03 12:37:05 +01:00
Evangelos Ribeiro Tzaras
93cf894a8c ringer: Take ui-active property into account
Only start ringing once the UI is deemed active, i.e. the "pre-ring" phase has
passed.

Fixes #371
2022-02-03 12:37:05 +01:00
Evangelos Ribeiro Tzaras
d5ccb40e68 tests: ui-call: Test property equality
And especially if properties get updated on both sides.
2022-02-02 00:09:12 +01:00
Evangelos Ribeiro Tzaras
1ca83bc2bc tests: Add ui-call tests
For now we only test the state mapping.
2022-02-02 00:09:12 +01:00
Evangelos Ribeiro Tzaras
9f8c20995c tests: Fix typo 2022-02-02 00:09:12 +01:00
Evangelos Ribeiro Tzaras
5b9609c4f7 ringer: Use CallsUiCallData instead of CallsCall
This will allow us to handle pre-ringing better.
2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras
6f9b071bbc tests: manager: Switch to CallsUiCallData 2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras
72adee4922 tests: mock-contacts-provider: Add license header 2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras
d75d4916af manager: Use state flags instead of an enum and adapt to changes
This gives us some more granularity and is overall a better fit than the states
previously used.

Closes #327
2022-01-31 17:08:38 +00:00
Evangelos Ribeiro Tzaras
15943b9776 manager: Hardcode supported protocols and adapt to changes
This simplifies the code quite a bit by removing the supported protocols from
being determined dynamically via the loaded plugins.

It was previously used to add/remove a GListStore to origins_by_protocol.

This is a prerequisite for having per protocol dial actions.
2022-01-31 17:08:38 +00:00
Evangelos Ribeiro Tzaras
7cba40ff60 tests: origin: Fix memory leaks 2022-01-27 18:02:15 +01:00
Evangelos Ribeiro Tzaras
6c857ba94a tests: call: Prefer G_SOURCE_REMOVE instead of FALSE 2022-01-27 18:02:15 +01:00
Evangelos Ribeiro Tzaras
0dc761d87c tests: sip: Switch to state notify signal 2022-01-20 10:23:09 +00:00
Evangelos Ribeiro Tzaras
85c6ac2ff8 tests: dummy origin: Use correct origin
And unref it after we're done. Otherwise we're leaking memory because the dummy
provider only keeps actively unrefs the origin it added itself.
2022-01-20 10:23:09 +00:00
Evangelos Ribeiro Tzaras
cdb6f90acc account: Rework account states
Introduce a state-changed signal which also gives a reason for why the state
changed. This will allow the UI to give some meaningful feedback to the user.

Additionally we can get rid of a number of things that were not really states,
but rather reasons for why a state changed (f.e. authentication failures).
2022-01-11 12:00:10 +00:00
Evangelos Ribeiro Tzaras
8b126484cb sip: Use per origin IP instead of a global IP
Sofia detects a NAT by presence of the "received" parameter in the Via header in
the response to a REGISTER. Sofia will then update the Contact header to use the
IP as reported by the registrar.

The "received" parameter MUST be included in the response according to
https://datatracker.ietf.org/doc/html/rfc3261#section-18.2.1
when the registrar detects a difference between the domain part of the top Via
header and the packet source address but practice has shown that this will not
always be the case.

Addditionally this change allows us to have origins bound to different network
interfaces which would be useful when a registrar can only be accessed through a
VPN.

This also fixes an issue with SDP introduced in
36880c3d34 which was only seen on some SIP
providers:

The session name ("s=") line is not relevant for establishing a connection,
the connection data (c=") line is.

See https://datatracker.ietf.org/doc/html/rfc4566 section 5.3 and 5.7
2022-01-08 21:25:09 +00:00
Evangelos Ribeiro Tzaras
fbbe17139d sip: origin: Add property tracking usage for tel URIs
Fixes #277
2021-12-26 17:45:12 +01:00
Evangelos Ribeiro Tzaras
da4434564d test: sip: Add debug messages 2021-12-21 15:05:47 +01:00
Evangelos Ribeiro Tzaras
dbfa593a07 call: Move name property to base class
This let's us avoid some duplication in the derived classes.
2021-12-20 12:25:19 +01:00
Evangelos Ribeiro Tzaras
a1fefcdbac call: Move id property into base class
This allows us to avoid some duplication in the derived classes.
2021-12-20 12:25:19 +01:00
Evangelos Ribeiro Tzaras
a048b4c83d call: Move state property into base class
This let's us get rid of a lot of duplication in the derived classes.

Additionally we set the initial state to CALLS_CALL_STATE_INCOMING if
inbound is TRUE and CALLS_CALL_STATE_DIALING otherwise.
2021-12-20 12:25:19 +01:00
Evangelos Ribeiro Tzaras
ddf1dd7349 call: Move inbound property into base class
This avoids some repetition in the derived classes.
2021-12-20 12:25:18 +01:00
Evangelos Ribeiro Tzaras
a0942034de test: call: Codestyle 2021-12-20 12:25:18 +01:00
Evangelos Ribeiro Tzaras
a87c3eeb2e tests: util: Unit test call icon name function 2021-12-07 11:05:12 +01:00
Evangelos Ribeiro Tzaras
bbccb7667e tests: util: Codestyle 2021-12-07 11:05:12 +01:00
Evangelos Ribeiro Tzaras
85c23cfc3d test: ringer: Test quiet ringing 2021-12-05 10:04:05 +01:00
Evangelos Ribeiro Tzaras
7dadb3c50f tests: Add ringer tests
We mock libfeedback and CallsCall to test the ringer for the following
scenarios:
- Call state changes
- User requested silencing of ringer
- Multiple calls
2021-12-05 09:50:25 +01:00
Evangelos Ribeiro Tzaras
f206b7d257 call: Rename property from "number" to "id"
The term number is not necessarily accurate when dealing with f.e. SIP.
2021-12-05 09:49:05 +01:00
Evangelos Ribeiro Tzaras
075dca5c35 tests: Add dtmf tone validity tests 2021-11-23 08:50:01 +00:00
Evangelos Ribeiro Tzaras
6477446a29 tests: Add gsettings schema directory to environment 2021-09-27 08:46:09 +00:00
Evangelos Ribeiro Tzaras
3f12b3fcd5 sip: provider: Add argument to _add_origin() whether to store credentials
This allows us to avoid unnecessary saving to disk during initial account
loading.
2021-07-20 10:17:17 +02:00