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

140 commits

Author SHA1 Message Date
Evangelos Ribeiro Tzaras
f930874d00 sip: provider: Keep provider alive while there are still origins
CallsSipOrigin accesses the CallsSipContext (owned by the provider) in its
dispose() which will be invalid once CallsSipProvider gets freed.
This commit will make certain that the provider stays alive for the lifetime
of it's origins.
2021-06-26 08:56:18 +02:00
Evangelos Ribeiro Tzaras
8a230fc5b5 sip: origin: No need to explicitly clear nua handles
Memory allocations from su_home_t will get cleaned up, when the home is freed.
2021-06-21 13:20:32 +02:00
Evangelos Ribeiro Tzaras
a803294c4a sip: origin: Handle unregistering (going offline)
and set the account state accordingly.
2021-06-18 19:29:25 +02:00
Evangelos Ribeiro Tzaras
e6c7994abc sip: origin: Remove unnecessary notify 2021-06-18 19:29:25 +02:00
Evangelos Ribeiro Tzaras
5bd84043b9 sip: origin: codestyle 2021-06-18 19:28:12 +02:00
Evangelos Ribeiro Tzaras
dbb829be06 debug: Add G_LOG_DOMAIN to every file using g_debug() 2021-06-18 11:12:13 +02:00
Evangelos Ribeiro Tzaras
736c17a4bc sip: origin: Fix if condition in dispose()
This should make sure that origins go offline
2021-06-11 17:51:06 +02:00
Evangelos Ribeiro Tzaras
7988ddf85b sip: media-pipeline: Don't shadow props variable
As caught by compiling with `-Wshadow`
2021-06-03 19:46:45 +00:00
Evangelos Ribeiro Tzaras
2847508034 Fix missing-declarations warnings all over the codebase
As caught by compiling with `-Wmissing-declarations`
by either making functions static, or declaring them in the header.
2021-06-03 19:46:45 +00: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
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
0c966fdf83 origin: Add API to query supported protocols
This will allow selecting a suitable origin when placing outgoing calls.
2021-05-28 17:02:02 +02:00
Evangelos Ribeiro Tzaras
7ad0f4cdd6 provider: Add API to query supported protocols
These are the protocols that the provider plugin may support. The origins
must be queried independently whether or not they support any given protocol.

Example: A SIP origin/account may or may not support the "tel" protocol.
2021-05-28 17:02:02 +02:00
Evangelos Ribeiro Tzaras
53f69b06dd call: Introduce protocol property 2021-05-28 13:18:24 +02:00
Evangelos Ribeiro Tzaras
1def4c3585 plugins: provider: Use CallsOrigin instead of derived types for GListStore
Otherwise we run into trouble when using `g_list_store_find()`
2021-05-28 13:18:24 +02:00
Evangelos Ribeiro Tzaras
fecdc1fff8 cleanup: Fix calls_origin_get_name() related memory leaks
Document calls_origin_get_name() correctly as transfer-full.
Additionaly fix related memory leaks.
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
95f16cb527 sip: provider: Implement CallsAccountProvider interface 2021-05-04 06:44:43 +02:00
Evangelos Ribeiro Tzaras
36cd9bd122 sip: provider: return origin in calls_sip_provider_add_origin() 2021-05-04 05:58:41 +02:00
Evangelos Ribeiro Tzaras
a6cb02a4c9 sip: provider: codestyle 2021-05-04 05:58:41 +02:00
Evangelos Ribeiro Tzaras
3edd6d002b sip: origin: Implement CallsAccountsInterface 2021-05-04 05:57:42 +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
3f72d34c49 Add CallsCredentials class and use it in CallsSipProvider
CallsCredentials is a dumb container to store account credentials.
This is done in preparation for the account management in the UI.
2021-05-04 05:57:06 +02:00
Evangelos Ribeiro Tzaras
d6916b3510 sip: media-pipeline: Do not set the stream properties prematurely 2021-05-04 05:57:06 +02:00
Evangelos Ribeiro Tzaras
06076a864a sip: media-pipeline: Fix memory leak in error path 2021-05-02 02:36:31 +02:00
Evangelos Ribeiro Tzaras
9cd13ca681 sip: media-pipeline: Fix memory leak 2021-05-02 02:36:25 +02:00
Evangelos Ribeiro Tzaras
21e72c9e12 sip: origin: Fix nua_authenticate call
nua_* calls need TAG_END or TAG_NULL as the final parameter.
2021-05-01 13:59:32 +02:00
Evangelos Ribeiro Tzaras
5ed24c4ed7 doc: Fix gtk-doc transfer annotations 2021-04-27 11:38:26 +02:00
Evangelos Ribeiro Tzaras
d7df1a4931 Revert "sip: build: depend on config.h"
This reverts commit 1a35d6544b.
This has not actually fixed the issue completely. See follow up commit
2021-04-27 01:51:05 +02:00
Evangelos Ribeiro Tzaras
70cb120951 sip: fix typos
Thanks to lintian for pointing it out!
2021-04-23 15:35:14 +02:00
Evangelos Ribeiro Tzaras
2ee6b23475 sip: media-pipeline: Allow overriding audio elements from environment
This is useful for tests where "pulsesrc" and "pulsesink" GstElements may not
be available (for example in CI).

Additionally only set the echo cancellation and buffer properties for the
pulse GstElements.
2021-04-20 09:47:16 +02:00
Evangelos Ribeiro Tzaras
e5dc3f06ce plugins: make plugins shared modules again
This reverts the main part of commit 4a264252a7.

As plugins are the prime use case for `shared_module`
getting rid of the warning from meson about linking against shared modules
weighs less heavy.
2021-04-16 16:41:18 +00:00
Evangelos Ribeiro Tzaras
367ca081a2 sip: call: Don't fail when hanging up on an incoming call 2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
f178b3546b sip: provider: document public functions 2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
7ed1ee2502 sip: codestyle changes
Shuffle the code around and make use of docstrings to conform to
the newly introduced coding style as described in `HACKING.md`

This commit also introduces docstrings describing each source file.
2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
765cd2ebb9 sip: pipeline: Only inform of unhandled bus massages when debugging
These messages are mainly useful for development. This part will be rewritten
once we introduce structured logging. For the moment this will just add noise.
2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
166ea8b21a sip: origin: Allow using a local port of 0
Using a port of 0 let's the operating system decide to which port to bind to.
Additionally refuse to use priviliged ports and print a warning.
2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
f7626e532f sip: provider: use g_clear_pointer pattern instead of emulating it 2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
6e6873432b sip: provider: Allow overriding SIP account config via environment
This will make it easier for testing down the line.
2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
b3cd378704 sip: origin: Remove unnecessary code
Remove a remnant from early development which has no use anymore
since "direct-connection" is now a property.
2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
db63efa29f sip: origin: Remove hardcoded display name from contact header
We might want to set it from the configuration later.
2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
b88d432401 sip: origin: make create_inbound a private function
and shuffle the functions around so that we don't need forward declarations
2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
1a35d6544b sip: build: depend on config.h
Closes #257
2021-04-15 18:50:39 +02:00
Evangelos Ribeiro Tzaras
63cc6507e7 sip: media-manager: fix SDP message when there is no supported codec 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro Tzaras
7d8be1d68d sip: media-manager: fix G_LOG_DOMAIN 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro Tzaras
d253870509 sip: gst-rfc3551: Add docstrings for public functions 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro Tzaras
2cb8139094 sip: gst-rfc3551: query for plugin availability 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro Tzaras
a5a9f728ae sip: media-pipeline: only create pipeline after codec negotiation 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro Tzaras
c2bd6e9344 sip: media: rework codec negotiation
introduce `calls_sip_media_manager_get_capabilities ()` which takes
a GList of MediaCodecInfo's as input to generate a SDP message.
If using in an SDP answer we simply feed it a list of the common codecs
as gathered from the SDP offer.
2021-04-12 08:38:24 +00:00
Evangelos Ribeiro Tzaras
4eb07148cc sip: call: rename setup local/remote connection functions
Avoid ambiguity by renaming the functions. `setup_local_media ()`
could give the impression that we're setting up media codecs which
is not the case.
2021-04-12 08:38:24 +00:00
Evangelos Ribeiro Tzaras
157dc1fffb sip: media: use number types for payload id and clock rate
This is needed for the next commits where we check the received SDP
offers/answers.
2021-04-12 08:38:24 +00:00
Evangelos Ribeiro Tzaras
7d113d4180 media: manager: support multiple codecs SDP wise
static capabilities are now supporting multiple codecs and generate correct SDP
messages. This only relates to SDP offers. When we are answering an offer we
must take the offer from the other party into account when creating the answer.

Hence why we differentiate between "static" and "dynamic" (not implemented yet)
capability strings.
2021-04-12 08:38:24 +00:00
Evangelos Ribeiro Tzaras
9fd43eaca8 sip: media-manager: remove unused function prototypes 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro Tzaras
af3cda9c5c media-manager: codestyle
move public function `get_best_codec ()` to the bottom
2021-04-12 08:38:24 +00:00
Evangelos Ribeiro Tzaras
a44c265903 sip: remove FOR_TESTING ifdef 2021-04-06 16:55:33 +00:00
Evangelos Ribeiro Tzaras
4a264252a7 plugins: build as shared library instead of shared module 2021-04-06 16:55:33 +00:00
Evangelos Ribeiro Tzaras
7d69d78b70 origin: Add country-code property
And add a binding in CallsManager for the default origin
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras
75d32d0924 sip: Allow controlling automatic account loading via environment 2021-04-05 06:13:44 +00:00
Mohammed Sadiq
c30a41ffa9 Let calls-call be an abstract class
And adapt to changes.

A calls-mm-call IS-A calls-call (and so on)
2021-04-05 09:38:03 +05:30
Evangelos Ribeiro Tzaras
e6b730b805 sip: pipeline: clean up in finalize () 2021-04-03 00:46:29 +02:00
Evangelos Ribeiro Tzaras
71cbc5c636 sip: provider: Fall back to reasonable values for local-port property 2021-04-03 00:46:29 +02:00
Evangelos Ribeiro Tzaras
5a7c22c80f sip: provider: use g_get_user_config_dir () for account config 2021-04-03 00:46:29 +02:00
Evangelos Ribeiro Tzaras
840ffa4653 sip: do not auto load accounts when running tests
because `calls_sip_provider_load_accounts ()` looks at the home folder
for a configuration file.
2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
19e7f8f119 sip-media: enable echo cancellation
by setting "filter.want" to "echo-cancel" for the pulsesink and pulsesrc
GStElement's.
2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
8a6f1bb203 sip: fix infinite ringtone loop
by making sure the call-added signal is emitted early enough
so that all consumers (display, ringer, etc) have a chance of getting
notified when the call state changes from f.e. DIALING to DISCONNECTED
similar to how its done in 03d960ccaf
for the dummy provider.
2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
17ac56fe44 sip: slightly improved authentication
* removed nua_callstate_authenticating as it was never hit
* move debug statement further up, because we might not reach it if no
  corresponding call is found
* handle 401 and 407 the same way
  note: we should record which realm we're authenticating against during
  REGISTER so we can prompt the user for additional credentials when
  challenged for a different realm - still happens when calling from
  a sip.linphone.org account to a jmp.bwapp.bwsip.io account.
2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
cadaa6a3e0 sip: use g_return_if_fail and friends only for public functions 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
45285062ca sip: improve connection handling by using relevant sofia tags
NUTAG_SUPPORTED and SIPTAG_EXPIRES_STR for instance

sip: include expire, urn uuid

sip.linphone.org accounts seems to be working!
2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
de44a17fe5 sip: use ipv4 exclusively for now
IPv6 should work, but sofia's outbound engine keep printing
errors involving the outbound engine. Working theory:
Failing ICMPv6 (pings) can make sofia think we don't have connectivity.
Note that we also don't get any answers from the SIP servers we tried so far.
2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
dcff7538f2 sip: media: improve SDP offer/answer handling 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
97a925ee39 sip: handle i_outbound 404 errors 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
7b54855f5e sip: media: change default codec to PCMA 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
c33fd53829 sip: Use app name in the user agent 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
1836c7c915 sip: allow specifying local port and use IPv6 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
37b9fe1c30 sip: rework setting SDP 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
afd5b5d6a8 sip: go offline when disposing CallsSipOrigin 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
4521033127 sip: origin: register with SIP server 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
017af5ec8b sip: pipeline: bind sockets for RTP
Add debugging information for used sockets
2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
a53f07dfd3 sip: origin: do not use hardcoded ports for RTP 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
6681077886 sip: origin: emit message on DNS error 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
3133f25c6b sip: call: rework call state changes 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
706a667547 sip: origin: fix direct connection case 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
c9949a5f9f sip: origin: get address on incoming call 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
588f70f78a sip: origin: fix CallsSipHandles reference in sip_callback 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
e0482fc6e6 sip: initial call handling
* implement answering and hangup
 * (de)activate media pipeline
2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
967f30d688 sip: Add media manager and sipify origin
* pipeline: we should bind the used socket of our udpsink to the socket udpsrc
2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
2dfa42d48d sip: sipify provider with sofia 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
7971fb5afb sip: Origin needs account credentials
Credentials can be set through a config file. The config file is parsed
by CallsSipProvider in order to add origins for each SIP account.
2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
71e7a33626 sip: Initial provider
based on dummy provider
2021-04-03 00:08:31 +02:00