1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-07-04 16:09:29 +00:00
Commit graph

60 commits

Author SHA1 Message Date
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
Evangelos Ribeiro Tzaras 3fd07c4dee tests: don't special case tests needing FOR_TESTING define
This was introduced in 649da75 and was in preparation for the
sip testing code from 030313d and 21abfb4.
2021-04-06 16:55:33 +00:00
Evangelos Ribeiro Tzaras a44c265903 sip: remove FOR_TESTING ifdef 2021-04-06 16:55:33 +00:00
Evangelos Ribeiro Tzaras 25d651c834 manager: set default origin
This is a bit of a hack to get the country code property hooked up
and will require a rework when multiple provider support is being added.
As the default origin is not being used anywhere else in the code
it's currently not a problem that we're not tracking if the default
origin is being removed.

Additionally test-manager.c needed some adjustment.
2021-04-06 14:27:26 +00:00
Guido Günther 443d23dd56 build: deduplicate sources
Shorten the needed sources from

 calls_sources, calls_enum_sources, calls_resources,
 wl_proto_sources, wayland_sources,

to

  calls_sources

so adding new things such as generated dbus sources doesn't have to
happen in four locations but just one.
2021-04-06 14:18:06 +02:00
Evangelos Ribeiro Tzaras 75d32d0924 sip: Allow controlling automatic account loading via environment 2021-04-05 06:13:44 +00:00
Evangelos Ribeiro Tzaras 0b73103384 test: test-plugins: Add SIP plugin 2021-04-05 06:13:44 +00:00
Evangelos Ribeiro Tzaras e3597f4a88 tests: use plugin load API 2021-04-05 06:13:44 +00:00
Evangelos Ribeiro Tzaras 21abfb4f37 test: Test CallsSipOrigin 2021-04-03 00:46:29 +02:00
Evangelos Ribeiro Tzaras 030313d42e test: Add basic SIP provider tests 2021-04-03 00:46:27 +02:00
Evangelos Ribeiro Tzaras 649da75a2f test: Test loading provider plugins 2021-04-02 07:24:51 +00:00
Mohammed Sadiq eda460ac15 provider: Use GListModel to track origins
And adapt to changes

It's easier to track changes if we are using GListModel than
a GList.  Also, eventually we shall have multiple providers,
and we can use GtkFlattenListModel to merge multiple origins
without manually managing pointers ourself.

Since several widgets has APIs to handle GListModels, it will
also help us create widgets from GListModels easily.
2021-02-25 08:44:56 +05:30