1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-11-15 04:45:36 +00:00
Commit graph

71 commits

Author SHA1 Message Date
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
Evangelos Ribeiro Tzaras
1a4b501653 sip: provider: Rename test environment variable 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
babd013bd7 Remove CallsCredentials and adapt to changes
The provider knows best which credentials it needs and CallsCredentials
was not generic to begin with, so get rid of it.
2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
de6293c05e meson: Passing -fPIE explicitly is discouraged
as indicated by the logs during configuration:

`WARNING: Use the 'pie' kwarg instead of passing '-fpie' manually to 'provider'`
2021-06-22 04:37:11 +02:00
Evangelos Ribeiro Tzaras
f74f4b6469 test: manager: Expanded *has_provider() testing 2021-06-11 17:52:56 +02:00
Evangelos Ribeiro Tzaras
96a7d901c1 Fix old-style warnings all over the codebase
As caught by compiling with `-Wold-style-definition` and `-Wstrict-prototypes`.
2021-06-03 19:46:45 +00:00
Evangelos Ribeiro Tzaras
4990529c6c tests: manager: Add multiple provider tests
The test suite can be further expanded later. For now this suffices to
have some basic regression testing for multiple provider support in place.
2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras
dde4bd8abf sip: provider: Don't warn when trying to add account multiple times
A g_debug() will suffice which will let us get rid of g_test_expect_message() to
as we don't need to guard against the warning anymore.
2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras
9c91a33604 test: manager: Use more appropriate g_assert_*() calls 2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras
0b2f146053 manager: support multiple providers
This includes the following changes:
- Introduce a `providers` hash table to keep track of multiple CallProvider's
  and remove the `provider` member
- Remove `calls_manager_get_provider()` and `calls_manager_set_provider()`
  in favour of `calls_manager_add_provider()`, `calls_manager_remove_provider()`
  and `calls_manager_has_provider()`
- Introduce a `origins` GListStore to keep track of available origins.
  `origins` is updated in `items_changed_cb()` when the origins of any
  CallsProvider are updated.
- Adapt to changes with respect to `calls_manager_get_origins()`.
- Introduce `origins_by_protocol` hash table to keep track of available origins
  per protocol.
- Adjust tests
- We temporarily break country code lookup which was handled previously
  with the "default-origin" mechanism. We will add it back to the CallsSettings
  class which will provide a better application-wide mechanism.
2021-06-01 14:52:18 +02:00
Evangelos Ribeiro Tzaras
503e5c2154 test: Add util tests
Unit test the `get_protocol_from_address()` function family.
2021-05-28 13:18:24 +02:00
Mohammed Sadiq
b1278f6140 build: Avoid building files multiple times
We don't have to build each source for every test, instead we could
create a static library link it with every test, which will be a lot
faster.
2021-05-17 20:00:04 +05:30
Evangelos Ribeiro Tzaras
1db1ba6ca9 test: Add account tests 2021-05-04 06:48:36 +02:00
Evangelos Ribeiro Tzaras
781adaddee sip: origin: Use CallsAccountState instead of SipAccountState 2021-05-04 05:57:42 +02:00
Evangelos Ribeiro Tzaras
5d0de3d299 sip: origin: Use CallsCredentials and adapt to changes
All parts not related to credentials are now being set when creating the nua
handles and then updated with nua_set_params() when the credentials get updated.
2021-05-04 05:57:06 +02:00
Evangelos Ribeiro Tzaras
0d467244b2 test: sip: Connect to state-changed signal
instead of relying so much on g_timeout_add()
2021-04-30 09:42:44 +02:00
Evangelos Ribeiro Tzaras
1593dd299b test: sip: Don't use DNS lookups
Otherwise build servers might not be happy.
2021-04-23 15:10:46 +02:00
Evangelos Ribeiro Tzaras
efe1b12eb5 test: Add calling tests 2021-04-20 09:50:19 +02:00
Evangelos Ribeiro Tzaras
cbe1280fb2 test: Use dummy audio elements for Gstreamer pipelines 2021-04-20 09:47:19 +02:00
Evangelos Ribeiro Tzaras
42c1ba7bba test: sip: use g_assert_cmpint for asserting enums 2021-04-20 09:47:19 +02:00
Evangelos Ribeiro Tzaras
9502d10970 tests: Test SDP messages 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro Tzaras
2506827c17 tests: Update year in SPDX header 2021-04-12 08:38:24 +00:00