Commit Graph

796 Commits

Author SHA1 Message Date
Tobias Blomberg a33e1ae545 Fix dangerous and probably faulty DNS lookup code 2022-04-24 11:45:49 +02:00
Tobias Blomberg f5267f4c8a Fix assertion when connecting to RemoteTrx 2022-04-14 20:02:43 +02:00
Tobias Blomberg 45b2bd4bfb Fix bad error message in DNS lookup code 2022-04-13 18:25:10 +02:00
Tobias Blomberg 6345dad203 Many smaller networking code fixes
A number of smaller networking code fixes have been applied to both the
Async code and the Echolib code.
2022-04-12 12:57:52 +02:00
Tobias Blomberg 1114ac3cec Host lookups did not work for hosts file 2022-04-03 20:50:16 +02:00
Tobias Blomberg 1ae3b521fb Fix Echolink DNS lookup bug 2022-03-31 22:42:18 +02:00
Tobias Blomberg b47fcfb0fb ReflectorLogic: Client side redundancy added
ReflectorLogic: Client side redundancy added by using DNS SRV records or
a locally specified list of hosts. Renamed configuration variables:
HOST -> HOSTS, PORT -> HOST_PORT. New configuration variables:
DNS_DOMAIN, HOST_PRIO, HOST_PRIO_INC, HOST_WEIGHT.

Rewritten the DNS resolver with support for more resource record types.
Specifically SRV record support were needed to implement the reflector
client side redundancy.

New class Async::TcpPrioClient for handling pools of servers to connect to.
The pool members can be specified using DNS SRV records or locally using the
HOSTS configuration variable.

New class Async::StateMachine used to build Hierarchial Finate State
Machines.

Add a new method, Async::TcpClientBase::remoteHostName(), so that we can
find out what hostname we used in the connect call.

Rename Async::TcpClientBase bind to setBindIp. Also add a bindIP()
method to access the bind address.
2022-03-27 21:20:46 +02:00
Tobias Blomberg 0ad64767a4 isTalker node info bugfix
Don't show when SHOW_ACTIVITY=0
2022-03-26 14:07:55 +01:00
Tobias Blomberg 5f8aa8b967 Add dynamic node info restrictedTG
The JSON restrictedTG boolean node info variable is set to true if the
talk group have an ALLOW specification.
2022-03-26 13:03:31 +01:00
Tobias Blomberg 6f65df27bc New reflector server TG config: SHOW_ACTIVITY 2022-03-25 23:27:10 +01:00
Tobias Blomberg 2b6e20e688 Fix SvxLink crash introduced in recent commit 2022-03-18 12:03:58 +01:00
Tobias Blomberg 4d35cb364b New TCL functions for handling remote events in linked logics
The TCL event handler functions remote_cmd_received and
remote_received_tg_updated can now be used in a logic core to act on
commands and talkgroup activations from another logic core.
2022-03-18 00:14:51 +01:00
Tobias Blomberg 6ca35154ac Fix possible memory leaks 2022-03-17 23:21:48 +01:00
Tobias Blomberg 8c50d40f93 Update copyright year for binaries 2022-02-06 14:12:57 +01:00
Tobias Blomberg 449537598b ReflectorLogic: Don't allow empty config variables
The following configuration variables are not allowed to be set to an
empty string: HOST, CALLSIGN, AUTH_KEY and EVENT_HANDLER.
2022-01-27 19:47:50 +01:00
Tobias Blomberg 4c4218df51 Reflector: Set TG#0 on selection of restricted TG 2022-01-22 18:19:43 +01:00
Tobias Blomberg 4ce8e7893d ReflectorLogic: New config variable VERBOSE
Add new configuration variable VERBOSE to the ReflectorLogic that
choose if printouts from the reflector logic should be verbose or not.
At the moment the only difference is that reflector join/leave messages
will be suppressed if VERBOSE=0.
2022-01-14 18:17:04 +01:00
Tobias Blomberg d5cd8ce81b Implement support for multitone CTCSS SNR offset
New CTCSS configuration variable CTCSS_SNR_OFFSETS (note the plural S) which
replace the old variable with a similar name. The new variable take a comma
separated list of frequency:offset pairs to support the use of multiple
CTCSS tone frequencies. The siglevdetcal utility has also been modified to
output the new variable format. If you are using just one CTCSS frequency
with a previously calibrated offet value you can keep using that. The older
configuration variable will not be removed and it still work in the same
way.
2022-01-09 11:00:18 +01:00
Tobias Blomberg 2512939aff CTCSS and tone detector improvments
- New CTCSS tone detector, mode 4, added. This detector is faster and more
  selective. It probably also is more resilient to interference. Have a look
  at the svxlink.conf (5) manual page under CTCSS_MODE for more information.
- Tone detectors for 1750 Hz tone burst, CTCSS repeater activation,
  CTCSS_TO_TG etc now use frequency estimation in addition to energy detection
  for better selectivity.
- Improved squelch state logging with more details about the detection.
- All configured CTCSS fqs are now used in siglevdetcal (=average among
  all for noise level compensation).
- Bugfix for CTCSS_OPEN_THRESH/CTCSS_CLOSE_THRESH handling
- CTCSS_DEBUG is now time controlled, prining 10 times per second
2022-01-07 15:21:45 +01:00
Tobias Blomberg e06b87de3d Fix bug in SvxReflector causing crash on restricted TG monitoring
The SvxReflector would sometimes crash when a node tried to set up a
monitor on a restricted talkgroup.
2021-08-13 18:48:50 +02:00
Tobias Blomberg 0bc9506f3a Add support for PTT and squelch via the gpiod library
Accessing GPIO pins via the sysfs interface is deprecated.  When
PTT_TYPE is set to GPIOD there are two new configuration variables
available to set GPIOD up, PTT_GPIOD_CHIP and PTT_GPIOD_LINE.  When
SQL_DET is set to GPIOD there are two new configuration variables
available to set GPIOD up, SQL_GPIOD_CHIP, SQL_GPIOD_LINE. If SvxLink is
built with libgpiod >= 1.5 SQL_GPIOD_BIAS will also be available to set
PULLUP/PULLDOWN for a GPIO input (squelch) pin.

Closes #538
2021-08-13 14:14:53 +02:00
Tobias Blomberg 4d2ebbd5ab Zerofill for AudioDeviceUDP
AudioDeviceUDP can now write zeros to the UDP connection on underflow.
That is, when the "audio device" is open but there is no audio to write
zeros will be written instead. Enable this behavior by setting the
environment variable ASYNC_AUDIO_UDP_ZEROFILL=1.
2021-08-04 08:00:41 +02:00
Tobias Blomberg f1cdc7536f Qtel bugfix with the bind address configuration
Bugfix: When a faulty bind address had been set up, Qtel just exited with a
bit cryptic error message. Now it starts up with the possibility to use the
configuration dialog to fix the problem.
2021-06-27 11:19:55 +02:00
Tobias Blomberg a40c7cadf2 ReflectorLogic bugfix: Temporary TG monitor could remove a permanent one
It was possible to activate a temporary TG monitor on a TG that was
configured to be permanent. When the temporary monitor timed out the
permananent TG was also removed from the monitoring list.
2021-06-19 12:35:08 +02:00
Tobias Blomberg 4ee98eb7e2 Fix error message typo in GPIO setup script
Closes #539
2021-03-27 20:26:04 +01:00
Tobias Blomberg b8c077d838 Runtime settable Echolink drop/reject/accept regexes
It is now possible to set the Echolink module drop/reject/accept
configuration variables at runtime. This can for example be used from
TCL, using the setConfigValue function, to change behavior at runtime.
See example in ReflectorLogic.tcl.
2021-03-21 15:12:38 +01:00
Tobias Blomberg 16ef22ba5f The Async::Serial class now support all extended baudrates
Implemented on request in issue #537.
2021-03-13 08:26:53 +01:00
Tobias Blomberg bc8cb606b5 Bugfix in reflector authentication 2021-03-09 23:49:57 +01:00
Tobias Blomberg df3d99d9db Rename AUTOACTIVATE_ON_SQL to ACTIVATE_ON_ACTIVITY
The AUTOACTIVATE_ON_SQL logic linking configuration variable has been
renamed to ACTIVATE_ON_ACTIVITY. That name is more descriptive since not
only squelch activity trigger the functionality.
2021-03-06 18:04:14 +01:00
Tobias Blomberg a0cc5d5a8d AUTOACTIVATE_ON_SQL did not work for ReflectorLogic
Bugfix in ReflectorLogic: The AUTOACTIVATE_ON_SQL logic linking
functionality did not work for the ReflectorLogic.
2021-03-06 18:04:14 +01:00
Tobias Blomberg 796318d5dc Correct Qt version for switching from deprecated functions
The Qt version previously given (5.11) for switching from deprecated
functions was wrong. It should be 5.14.
2021-02-01 23:27:11 +01:00
Tobias Blomberg b22e9511b9 Fix warnings
- Improper buffer initialization in demo application
- Don't use deprecated functions for Qt >= 5.11
2021-01-31 20:23:29 +01:00
Tobias Blomberg d02cc013bc Replace deprecated functions in qtel
Mostly use "tr" instead of "trUtf8".
2021-01-31 19:42:53 +01:00
Tobias Blomberg de35979b14 Fix CodeQL complaints in devcal
- "Multiplication result converted to larger type"
2021-01-31 18:57:39 +01:00
Tobias Blomberg 3de0a4f56c Fix CodeQL complaints
- Multiplication result converted to larger type
- Convert a lot of size variables from int to size_t
2021-01-31 18:19:39 +01:00
Tobias Blomberg 1aae84a195 Replace potentially dangerous function calls
- localtime -> localtime_r
- gmtime -> gmtime_r
- asctime -> asctime_r
2021-01-30 01:24:36 +01:00
Tobias Blomberg 4be904fe25 Update ChangeLog and module metarinfo version 2021-01-27 21:29:29 +01:00
Tobias Blomberg 59872d2e01 Voter COMMAND_PTY MUTE command added
The voter COMMAND_PTY now accept a new command MUTE that will keep the
receiver active but block all content.
2021-01-17 13:28:32 +01:00
Tobias Blomberg 1d74bca0cb Bugfix: Do not emit tone detected events from muted receivers
If a receiver is muted it should block tone detected events in the same
manner that it blocks DTMF and selcall reception
2021-01-17 13:24:42 +01:00
Tobias Blomberg 1f48de9d52 Restricted talk group fixes
- Not allowed to monitor unallowed talk group
- Not receiving metadata (e.g. talker start/stop etc) from unallowed
  talk groups

Also now not allowed to request QSY from TG #0.
2021-01-16 23:31:38 +01:00
Tobias Blomberg 846baaba82 Use SvxReflector config to create restricted talk groups
The new configuration variable ALLOW can now be used in a TG#xyz
configuration section to choose which callsigns that are allowed to
select the talk group.
2021-01-16 18:29:52 +01:00
Tobias Blomberg 6130407e6c Remove siglev fractions in Voter close printout 2021-01-13 21:30:27 +01:00
Tobias Blomberg 1716a935bc Rename SIGLEV squelch releated configuration variables
Rename configuration variables to make it more clear that they are for
squelch configuration. An "SQL_" prefix have been added to the following
configuration variables: SIGLEV_RX_NAME, SIGLEV_OPEN_THRESH,
SIGLEV_CLOSE_THRESH.
2021-01-10 21:44:27 +01:00
Tobias Blomberg c99730e332 New voter configuration variable VERBOSE
A new voter configuration variable VERBOSE has been added which cause
the voter to print the squelch state events of the satellite receivers.
This can be used while fine tuning voter timing for example.
2021-01-10 19:30:17 +01:00
Tobias Blomberg 01374dbce7 Apply combiner SQL_XYZ config variables to the combiner
In the previous implementation of the squelch combiner the squelch
timing configuration variables, like SQL_DELAY, SQL_HANGTIME etc, was
applied to all subsquelches. This caused a strange behavior where the
top-level setting would "win" over the squelch specific settings. The
implementation have now been changed so that the squelch timing
configuration variables are applied on the combiner squelch itself.

Have a look at the SQL_COMBINER configuration variable description in
the svxlink.conf(5) manual page for more information.
2021-01-10 19:09:09 +01:00
Tobias Blomberg 5b526377f2 Rework squelch core code
The core squelch handling code was not fully correct causing problems in
some configurations.
2021-01-10 18:49:35 +01:00
Tobias Blomberg 26af258dd0 Fix crash when no logic linking was used
Fixes #529.
2021-01-09 22:51:34 +01:00
Tobias Blomberg 7bce1b648f Bugfix in the receiver muting
Fix receiver muting bug introduced with the AUDIO_DEV_KEEP_OPEN feature.
Receivers were not completely muted which caused events, like tone
detection, to be emitted even though there should no events emitted from
a fully muted receiver.
2021-01-09 09:53:16 +01:00
Tobias Blomberg 043f137ae0 Bugfix in COMBINE squelch
After the previous commit, the COMBINE squelch could get in a state
where the squelch did not open until it had closed and opened one more
time.
2021-01-08 21:26:21 +01:00
Tobias Blomberg 3e3fb69959 More informative squelch open/close printouts
The information that is printed within the parenthesis after the squelch
open/close message is now specific for each squelch type so that
meaningful information can be printed for that squelch type. For example
the CTCSS tone frequency and SNR is printed for CTCSS squelch. The value
printed for SIGLEV squelch is now the actual value that is used by the
squelch. Previously there was no connection between the value used by
the squelch and the printed signal level.
2021-01-08 12:35:28 +01:00