Commit Graph
100 Commits
Author SHA1 Message Date
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 e798d61b83 ci: disable testing in flatpak
Because it is very flaky currently.
2021-04-15 18:50:39 +02:00
Evangelos Ribeiro Tzaras 1a35d6544b sip: build: depend on config.h
Closes #257
2021-04-15 18:50:39 +02:00
Evangelos Ribeiro Tzaras 436be15f5a build: doc: deduplicate sources
This is a follow up to 443d23dd56
2021-04-13 10:53:48 +02:00
Evangelos Ribeiro Tzaras 51a41b249d meson: Fix project name in license header 2021-04-13 10:25:54 +02:00
Evangelos Ribeiro Tzaras 21666fc7d4 best-match: Don't set NULL phone numbers when updating country code
Also related to #255
2021-04-12 14:02:26 +02:00
Evangelos Ribeiro Tzaras a072d8c7e3 best-match: avoid using NULL phone number
Fixes #255
2021-04-12 14:02:19 +02:00
Evangelos Ribeiro TzarasandGuido Gunther 63cc6507e7 sip: media-manager: fix SDP message when there is no supported codec 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro TzarasandGuido Gunther 7d8be1d68d sip: media-manager: fix G_LOG_DOMAIN 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro TzarasandGuido Gunther 9502d10970 tests: Test SDP messages 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro TzarasandGuido Gunther 2506827c17 tests: Update year in SPDX header 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro TzarasandGuido Gunther d253870509 sip: gst-rfc3551: Add docstrings for public functions 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro TzarasandGuido Gunther 2cb8139094 sip: gst-rfc3551: query for plugin availability 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro TzarasandGuido Gunther a5a9f728ae sip: media-pipeline: only create pipeline after codec negotiation 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro TzarasandGuido Gunther 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 TzarasandGuido Gunther 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 TzarasandGuido Gunther 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 TzarasandGuido Gunther 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 TzarasandGuido Gunther 9fd43eaca8 sip: media-manager: remove unused function prototypes 2021-04-12 08:38:24 +00:00
Evangelos Ribeiro TzarasandGuido Gunther af3cda9c5c media-manager: codestyle
move public function `get_best_codec ()` to the bottom
2021-04-12 08:38:24 +00:00
Evangelos Ribeiro Tzaras aebd8ff683 Introduce HACKING.md
To facilitate using phoshs/libhandys code style for newly written code
and to provide some guidelines if anyone wanted to change the style in
the existing codebase.
2021-04-09 10:20:03 +02:00
Evangelos Ribeiro Tzaras b1add894be mm-origin: fix memory leak 2021-04-07 18:25:09 +02:00
Evangelos Ribeiro Tzaras e92ccb4f8b mm-origin: codestyle
be consistent in the naming of callback functions
2021-04-07 18:22:56 +02: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 4a264252a7 plugins: build as shared library instead of shared module 2021-04-06 16:55:33 +00:00
Evangelos Ribeiro Tzaras 9703b1e43e best-match: disconnect old signal handlers 2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 0bd6d7f2a5 best-match: Lookup contact if country code changed
Closes #217
2021-04-06 14:27:26 +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
Evangelos Ribeiro Tzaras a559587a19 mm: Implement country-code property
Closes #167
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 463344c52b Add API to get SIM country code
This is a copy of Mohammed Sadiq's code in purple-mm-sms
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 622827d293 best-match: Use the country code 2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras e5832bbad3 application: Use the country code 2021-04-06 14:27:26 +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 69b170ecfe best-match: g_return_if_fail if not GeeCollection
Closes #254
Closes #227
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras f8a57edc6d contacts-provider: fix docstring
The caller takes ownership of the returned `CallsBestMatch`, so
this should be reflected in the docstring
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras f84d3c0adf call: g_return_if_fail: type check calls_call_get_contact () 2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 26c8bad9cc ci: add -noreset to xvfb-run invocation
Fixes issues in CI `cannot open display`. Similar to 8cd90523
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 32c89ca9dd contact-provider: remove trailing whitespaces 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
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 9e92fb88af provider: Add API for loading and unloading provider plugins
This is also used for our tests. In order to avoid code duplication
this is being moved to calls-provider.{c,h}.
2021-04-05 06:13:44 +00:00
Evangelos Ribeiro Tzaras d67e690f33 new-call-box: Connect signals only if origins non-NULL
Fixes #252
2021-04-03 06:41:54 +00:00
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 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 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 685aa1950e application: open sip uri 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
Evangelos Ribeiro Tzaras a32f6e4dc4 ofono: use g_bus_watch_name
Otherwise the load plugins test fails in CI.
2021-04-02 07:24:51 +00:00
Evangelos Ribeiro Tzaras 649da75a2f test: Test loading provider plugins 2021-04-02 07:24:51 +00:00
Evangelos Ribeiro Tzaras 52424ee927 ofono: Derive from CallsProvider
This was missed 5684d54 when CallsProvider switched from
an interface to an abstract class.

Closes #243
2021-03-24 10:00:00 +00:00
Evangelos Ribeiro Tzaras b60680f645 plugins: fix memory leaks with respect to items in GListStore
This was probably missed by accident in eda460ac where oFono's origin
did get the g_autoptr treatment.
2021-03-23 09:58:15 +01:00
Evangelos Ribeiro Tzaras 8cd9052378 ci: add -noreset to xvfb-run invocation for flatpak builds 2021-03-15 18:44:26 +00:00
Evangelos Ribeiro TzarasandGuido Gunther 94345e0916 manager: hang up secondary calls 2021-03-15 09:24:46 +00:00
Evangelos Ribeiro TzarasandGuido Gunther 24f53cd927 manager: remove unused function 2021-03-15 09:24:46 +00:00
Evangelos Ribeiro TzarasandGuido Gunther 78c0fb1ed7 ringer: use quiet profile for non-primary calls 2021-03-15 09:24:46 +00:00
Evangelos Ribeiro Tzaras 03d960ccaf dummy: fix infinite ringtone
Fixes #238 by making sure the call-added signal is emitted earlier.
2021-03-11 23:36:41 +01:00
Evangelos Ribeiro Tzaras 3aebfcc6d1 contact-row: remove deprecated function
Fixes #234
2021-03-09 22:45:01 +01:00
Evangelos Ribeiro Tzaras 35f45d8373 meson: bump required libhandy-1 version >1.1.90 2021-03-09 16:50:13 +01:00
Evangelos Ribeiro Tzaras 45dd165c23 flatpak: remove libhandy as it is part of the SDK 2021-03-09 16:50:13 +01:00
Evangelos Ribeiro Tzaras 7a6b702a31 plugins: use g_autoptr for GError 2021-03-03 00:17:49 +00:00
Evangelos Ribeiro Tzaras 3f197149a8 codestyle: remove whitespaces 2021-03-03 00:17:49 +00:00
Evangelos Ribeiro Tzaras 5b34342134 new-call-box: make sure to call origin_count_changed_cb
Otherwise the model changes happening before hooking up will be missed
(which results in the model not being bound to HdyComboRow).
2021-02-27 09:45:06 +01:00
Evangelos Ribeiro Tzaras 29ad37150b d/gbp.conf: automatically bump project version
this makes sure we don't forget to bump the version in meson.build
2021-02-26 12:32:13 +01:00