Commit Graph

700 Commits

Author SHA1 Message Date
Brad Smith b0992fb771 main/utils: Simplify the FreeBSD ast_get_tid() handling
FreeBSD has had kernel threads for 20+ years.
2024-01-30 19:00:10 +00:00
George Joseph 36f8490901 codec_ilbc: Disable system ilbc if version >= 3.0.0
Fedora 37 started shipping ilbc 3.0.4 which we don't yet support.
configure.ac now checks the system for "libilbc < 3" instead of
just "libilbc".  If true, the system version of ilbc will be used.
If not, the version included at codecs/ilbc will be used.

Resolves: #84
2023-11-08 16:37:35 +00:00
George Joseph 15ef050d0a Add libjwt to third-party
The current STIR/SHAKEN implementation is not currently usable due
to encryption issues. Rather than trying to futz with OpenSSL and
the the current code, we can take advantage of the existing
capabilities of libjwt but we first need to add it to the
third-party infrastructure already in place for jansson and
pjproject.

A few tweaks were also made to the third-party infrastructure as
a whole.  The jansson "dest" install directory was renamed "dist"
to better match convention, and the third-party Makefile was updated
to clean all product directories not just the ones currently in
use.

Resolves: #349
2023-10-05 10:34:46 -06:00
Sean Bright c52b4ce11c res_pjsip: Enable TLS v1.3 if present.
Fixes #221

UserNote: res_pjsip now allows TLS v1.3 to be enabled if supported by
the underlying PJSIP library. The bundled version of PJSIP supports
TLS v1.3.
2023-08-04 14:20:56 +00:00
Sean Bright e75c69b59e apply_patches: Use globbing instead of file/sort.
This accomplishes the same thing as a `find ... | sort` but with the
added benefit of clarity and avoiding a call to a subshell.

Additionally drop the -s option from call to patch as it is not POSIX.
2023-07-07 15:12:12 +00:00
George Joseph 05bdaab643 apply_patches: Sort patch list before applying
The apply_patches script wasn't sorting the list of patches in
the "patches" directory before applying them. This left the list
in an indeterminate order. In most cases, the list is actually
sorted but rarely, they can be out of order and cause dependent
patches to fail to apply.

We now sort the list but the "sort" program wasn't in the
configure scripts so we needed to add that and regenerate
the scripts as well.

Resolves: #193
2023-07-06 14:04:13 +00:00
Sean Bright baa4a0669e configure: Remove obsolete and deprecated constructs.
These were uncovered when trying to run `bootstrap.sh` with Autoconf
2.71:

* AC_CONFIG_HEADER() is deprecated in favor of AC_CONFIG_HEADERS().
* AC_HEADER_TIME is obsolete.
* $as_echo is deprecated in favor of AS_ECHO() which requires an update
  to ax_pthread.m4.

Note that the generated artifacts in this commit are from Autoconf 2.69.

Resolves #139
2023-06-12 17:19:58 +00:00
Miguel Angel Nubla 1bf6d02f13 configure: Makefile downloader enable follow redirects.
If curl is used for building, any download such as a sounds package
will fail to follow HTTP redirects and will download wrong data.

Resolves: #136
2023-06-05 12:37:06 -06:00
Jaco Kroon 0e6295128c
configure: fix test code to match gethostbyname_r prototype. (#75)
This enables the test to work with CC=clang.

Without this the test for 6 args would fail with:

utils.c:99:12: error: static declaration of 'gethostbyname_r' follows non-static declaration
static int gethostbyname_r (const char *name, struct hostent *ret, char *buf,
           ^
/usr/include/netdb.h:177:12: note: previous declaration is here
extern int gethostbyname_r (const char *__restrict __name,
           ^

Fixing the expected return type to int sorts this out.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2023-05-15 06:50:36 -06:00
Sean Bright ae6b56e357
res_pjsip_pubsub.c: Use pjsip version for pending NOTIFY check. (#47)
The functionality we are interested in is present only in pjsip 2.13
and newer.

Resolves: #45
2023-05-11 14:23:49 -06:00
Sean Bright 0d6b271831
core: Cleanup gerrit and JIRA references. (#58)
* Remove .gitreview and switch to pulling the main asterisk branch
  version from configure.ac instead.

* Replace references to JIRA with GitHub.

* Other minor cleanup found along the way.

Resolves: #39
2023-05-03 09:37:57 -06:00
Fabrice Fontaine faf58ccc70 configure: fix detection of re-entrant resolver functions
uClibc does not provide res_nsearch:
asterisk-16.0.0/main/dns.c:506: undefined reference to `res_nsearch'

Patch coded by Yann E. MORIN:
http://lists.busybox.net/pipermail/buildroot/2018-October/232630.html

ASTERISK-21795 #close

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
[Retrieved from:
https: //git.buildroot.net/buildroot/tree/package/asterisk/0005-configure-fix-detection-of-re-entrant-resolver-funct.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Change-Id: I79296f19e28ec764bbd1e991bf11c416d0b10563
2023-03-16 10:20:19 -05:00
Mike Bradeen 62a64686e2 res_pjsip: Upgraded bundled pjsip to 2.13
Removed multiple patches.

Code chages in res_pjsip_pubsub due to changes in evsub.

Pjsip now calls on_evsub_state() before on_rx_refresh(),
so the sub tree deletion that used to take place in
on_evsub_state() now must take place in on_rx_refresh().

Additionally, pjsip now requires that you send the NOTIFY
from within on_rx_refresh(), otherwise it will assert
when going to send the 200 OK. The idea is that it will
look for this NOTIFY and cache it until after sending the
response in order to deal with the self-imposed message
mis-order. Asterisk previously dealt with this by pushing
the NOTIFY in on_rx_refresh(), but pjsip now forces us
to use it's method.

Changes were required to configure in order to detect
which way pjsip handles this as the two are not
compatible for the reasons mentioned above.

A corresponding change in testsuite is required in order
to deal with the small interal timing changes caused by
moving the NOTIFY send.

ASTERISK-30325

Change-Id: I50b00cac89d950d3511d7b250a1c641965d9fe7f
2023-02-06 18:21:58 -07:00
Mike Bradeen de3ce178ab chan_alsa: Remove deprecated module.
ASTERISK-30298

Change-Id: I5c8afb781528afdf55d237e3bffa5e4a862ae8c7
2022-12-09 08:26:42 -07:00
Mike Bradeen 89a7d30a97 chan_mgcp: Remove deprecated module.
Also removes res_pktcops to avoid merge conflicts
with ASTERISK~30301.

ASTERISK-30299

Change-Id: I41a316d327646a197b6f112f7f637aceb5111b41
2022-12-09 08:59:04 -06:00
Mike Bradeen d0140fc7fe app_osplookup: Remove deprecated module.
ASTERISK-30302

Change-Id: I2268189646fa0b587675d8619322818143172474
2022-12-08 08:11:30 -06:00
Philip Prindeville 945193cc5a test: Add test coverage for capture child process output
ASTERISK-30037 #close

Change-Id: I0273e85eeeb6b8e46703f24cd74d84f3daf0a69a
2022-09-12 11:22:44 -05:00
Joshua C. Colp cffaf12d19 pjsip: Add TLS transport reload support for certificate and key.
This change adds support using the pjsip_tls_transport_restart
function for reloading the TLS certificate and key, if the filenames
remain unchanged. This is useful for Let's Encrypt and other
situations. Note that no restart of the transport will occur if
the certificate and key remain unchanged.

ASTERISK-30186

Change-Id: I9bc95a6bf791830a9491ad9fa43c17d4010028d0
2022-09-09 18:41:05 -05:00
Hugh McMaster 64f11e0d18 configure.ac: Use pkg-config to detect libxml2
Use pkg-config to detect libxml2, falling back to xml2-config if the
former is not available.

This patch ensures Asterisk continues to build on systems without
xml2-config installed.

The patch also updates the associated 'configure' files.

ASTERISK-29970 #close

Change-Id: I3c90dfe0b0590486cbb8e6d426a7c5c4199410c0
2022-03-25 14:25:31 -05:00
George Joseph b40c4d59b1 xml.c, config,c: Add stylesheets and variable list string parsing
Added functions to open, close, and apply XML Stylesheets
to XML documents.  Although the presence of libxslt was already
being checked by configure, it was only happening if xmldoc was
enabled.  Now it's checked regardless.

Added ability to parse a string consisting of comma separated
name/value pairs into an ast_variable list.  The reverse of
ast_variable_list_join().

Change-Id: I1e1d149be22165a1fb8e88e2903a36bba1a6cf2e
2022-03-03 05:45:20 -06:00
Michał Górny 6a879eea31 BuildSystem: Fix misdetection of gethostbyname_r() on NetBSD
Fix the configure script not to detect the presence of gethostbyname_r()
on NetBSD incorrectly.  NetBSD includes it as an internal libc symbol
that is not exposed in system headers and that is incompatible with
other implementations.  In order to avoid misdetecting it, perform
the symbol check only if the declaration is found in the public header
first.

ASTERISK-29817

Change-Id: Iafa359b09908251bcd299ff54be003ea129b9eda
2022-01-19 10:35:57 -06:00
George Joseph bc59b66de3 bundled_pjproject: Make it easier to hack
There are times when you need to troubleshoot issues with bundled
pjproject or add new features that need to be pushed upstream
but...

* The source directory created by extracting the pjproject tarball
  is not scanned for code changes so you have to keep forcing
  rebuilds.
* The source directory isn't a git repo so you can't easily create
  patches, do git bisects, etc.
* Accidentally doing a make distclean will ruin your day by wiping
  out the source directory, and your changes.
* etc.

This commit makes that easier.
See third-party/pjproject/README-hacking.md for the details.

ASTERISK-29824

Change-Id: Idb1251040affdab31d27cd272dda68676da9b268
2022-01-07 08:45:02 -06:00
Alexander Traud 5d8e0a6542 BuildSystem: Consistently allow 'ye' even for Jansson.
Furthermore, consistently use not 'No' but ':' for non-existent file
paths. Finally, use the same pattern for checking file paths:
  a)  = ":"
  b) != "x:"

Change-Id: I0c80c76d2cc98b0e5c859131290f4e3141a1a544
2021-11-18 14:53:12 -06:00
Alexander Traud b8db1daec6 BuildSystem: In POSIX sh, == in place of = is undefined.
ASTERISK-29724

Change-Id: I59aa0e52effdc16992f3a736ccf73430a6ef135b
2021-11-08 13:20:58 -06:00
Alexander Traud d1163653d1 res_snmp: As build tool, prefer pkg-config over net-snmp-config.
ASTERISK-29709

Change-Id: Ie169df878bdfc3a06b3097c5c38d185b480f54d4
2021-11-04 17:04:41 -05:00
George Joseph 0adcdbd118 BuildSystem: Check for alternate openssl packages
OpenSSL is one of those packages that often have alternatives
with later versions.  For instance, CentOS/EL 7 has an
openssl package at version 1.0.2 but there's an openssl11
package from the epel repository that has 1.1.1.  This gets
installed to /usr/include/openssl11 and /usr/lib64/openssl11.
Unfortunately, the existing --with-ssl and --with-crypto
./configure options expect to point to a source tree and
don't work in this situation.  Also unfortunately, the
checks in ./configure don't use pkg-config.

In order to make this work with the existing situation, you'd
have to run...
./configure --with-ssl=/usr/lib64/openssl11 \
    --with-crypto=/usr/lib64/openssl11 \
    CFLAGS=-I/usr/include/openssl11

BUT...  those options don't get passed down to bundled pjproject
so when you run make, you have to include the CFLAGS again
which is a big pain.

Oh...  To make matters worse, although you can specify
PJPROJECT_CONFIGURE_OPTS on the ./configure command line,
they don't get saved so if you do a make clean, which will
force a re-configure of bundled pjproject, those options
don't get used.

So...

* In configure.ac... Since pkg-config is installed by install_prereq
  anyway, we now use it to check for the system openssl >= 1.1.0.
  If that works, great.  If not, we check for the openssl11
  package. If that works, great.  If not, we fall back to just
  checking for any openssl.  If pkg-config isn't installed for some
  reason, or --with-ssl=<dir> or --with-crypto=<dir> were specified
  on the ./configure command line, we fall back to the existing
  logic that uses AST_EXT_LIB_CHECK().

* The whole OpenSSL check process has been moved up before
  THIRD_PARTY_CONFIGURE(), which does the initial pjproject
  bundled configure, is run.  This way the results of the above
  checks, which may result in new include or library directories,
  is included.

* Although not strictly needed for openssl, We now save the value of
  PJPROJECT_CONFIGURE_OPTS in the makeopts file so it can be used
  again if a re-configure is triggered.

ASTERISK-29693

Change-Id: I341ab7603e6b156aa15a66f43675ac5029d5fbde
2021-10-20 13:24:19 -05:00
Sean Bright 44fd75fae2 configure: Remove unused OpenSSL SRTP check.
Discovered while looking at ASTERISK~29684. Usage was removed in change
I3c77c7b00b2ffa2e935632097fa057b9fdf480c0.

Change-Id: Iaf2f7a16ea5a7eee6375319347e4b40b8e7b10e3
2021-10-15 10:51:05 -05:00
Sean Bright 695fc3dbd7 dns.c: Load IPv6 DNS resolvers if configured.
IPv6 nameserver addresses are stored in different part of the
__res_state structure, so look there if we appear to have support for
it.

ASTERISK-28004 #close

Change-Id: I67067077d8a406ee996664518d9c8fbf11f6977d
2021-09-08 18:18:28 -05:00
Joshua C. Colp 800fd84af6 res_config_sqlite: Remove deprecated module.
ASTERISK-29598

Change-Id: I8ef17023f55bf01f2e309b06f4778a8ca7252c91
2021-08-17 10:38:34 -03:00
Joshua C. Colp 20b2741232 chan_vpb: Remove deprecated module.
ASTERISK-29597

Change-Id: I19bb39eed0257ddfef453eb2df5646d073d50fe1
2021-08-17 10:38:05 -03:00
Joshua C. Colp 1eb2d85c99 chan_misdn: Remove deprecated module.
ASTERISK-29596

Change-Id: Ibae9490c1b35cadbf7028d24610f745277c8535e
2021-08-17 10:37:40 -03:00
Joshua C. Colp 6ecc48086c chan_nbs: Remove deprecated module.
ASTERISK-29595

Change-Id: Ib5c7d43a780f2fb94cee90738e4c1af211ae4a33
2021-08-17 10:36:19 -03:00
Joshua C. Colp 6cc948f94e chan_phone: Remove deprecated module.
ASTERISK-29594

Change-Id: I79a9961cb5062fadbccb0ea93f087bdd32685316
2021-08-17 10:36:11 -03:00
Joshua C. Colp 95f3a4a9ad chan_oss: Remove deprecated module.
ASTERISK-29593

Change-Id: Ib53a42ad974c63871344b95078c61c188e43da99
2021-08-17 10:35:43 -03:00
Jaco Kroon 060ce10163 AC_HEADER_STDC causes a compile failure with autoconf 2.70
From https://www.mail-archive.com/bug-autoconf@gnu.org/msg04408.html

> ... the long-obsolete AC_HEADER_STDC, previously used internally by
> AC_INCLUDES_DEFAULT, used AC_EGREP_HEADER.  The AC_HEADER_STDC macro
> is now a no-op (and is not used at all within Autoconf anymore), so
> that change is likely what made the first use of AC_EGREP_HEADER the
> one inside the if condition, causing the observed results.

The implication is that the test does nothing anyway, and due to it
being a no-op from 2.70 onwards, results in the required not being set
to yes, resulting in ./configure to fail.

Change-Id: Ic1ff38d87f791fbf1f2a80512f81bb7110392460
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2021-01-18 10:38:00 -06:00
Jaco Kroon 4e038c1eaa pbx_lua: Add LUA_VERSIONS environment variable to ./configure.
On Gentoo it's possible to have multiple lua versions installed, all
with a path of /usr, so it's not possible to use the current --with-lua
option to determisticly pin to a specific version as is required by the
Gentoo PMS standards.

This environment variable allows to lock to specific versions,
unversioned check will be skipped if this variable is supplied.

Change-Id: I8c403eda05df25ee0193960262ce849c7d2fd088
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2021-01-06 11:59:04 -06:00
lvl b08427134f Introduce astcachedir, to be used for temporary bucket files
As described in the issue, /tmp is not a suitable location for a
large amount of cached media files, since most distributions make
/tmp a RAM-based tmpfs mount with limited capacity.

I opted for a location that can be configured separately, as opposed
to using a subdirectory of spooldir, given the different storage
profile (transient files vs files that might stay there indefinitely).

This commit just makes the cache directory configurable, and changes
the default location from /tmp to /var/cache/asterisk.

ASTERISK-29143

Change-Id: Ic54e95199405abacd9e509cef5f08fa14c510b5d
2020-12-09 11:17:27 -06:00
Alexander Traud db4320a6a0 BuildSystem: Enable Lua 5.4.
Note to maintainers: Lua 5.4, Lua 5.3, and Lua 5.2 have not been tested
at runtime with pbx_lua. Until then, use the lowest available version
of Lua, if you enabled the module pbx_lua at all.

Change-Id: Ie5270448b11fcb4e2a53d899e4fe7fea793ce7e0
2020-10-28 08:49:39 -05:00
Alexander Traud 0a4dffe6f8 pjproject_bundled: Honor --without-pjproject.
The previous change missed that 'make' uses 'PJPROJECT_BUNDLED' anyway.

ASTERISK-28929

Change-Id: I7ef0e78a06ea391b59d95b99d46bbed3fec4fed9
2020-06-05 10:05:54 -05:00
Alexander Traud 4ef5ba58f5 BuildSystem: Only if found LibPRI, check its optional parts.
Change-Id: If8445f899ee4ce0c606c484943d4ce0c8e43b5da
2020-04-16 09:53:29 -05:00
Alexander Traud ef580f96e7 BuildSystem: Only if found external PJProject, check its optional parts.
Change-Id: I11d5693d25c166c99d8cebffc16184d58f6362de
2020-04-15 11:26:57 -05:00
Alexander Traud 610e058189 BuildSystem: Search for Python/C API when possibly needed only.
The Python/C API is used only if the Test Framework was enabled in Asterisk
'make menuselect'. The Test Framework is available only if the Developer Mode
was enabled in Asterisk './configure --enable-dev-mode'. And that Python/C API
is used only if the PJProject was found and not disabled in Asterisk; the user
did not go for './configure --without-pjproject'.

Furthermore, because version 2 of that Python/C API is required (currently) and
because some platforms do not offer a generic version 2, the script searches
for 2.7 explicitly as well.

To avoid version mismatch between the Python/C API and the Python environment,
the script searches for the latter in the same versions, in the same the order
as well. Because this Python/C API is just for (some) Asterisk contributors,
the script also goes for the Python 3 environment as a last resort for all
other Asterisk users. This allows 'make full' even on minimal installations of
Ubuntu 18.04 LTS and newer.

Because the Python/C API is Asterisk contributor specific, the Python packages
are removed from the script './contrib/scripts/install_prereq' as this script
is intended for Asterisk users. Asterisk contributors have to install much more
packages in any case, like:
sudo apt install autoconf automake git git-review python2.7-dev

ASTERISK-28824
ASTERISK-27717

Change-Id: Id46d357e18869f64dcc217b8fdba821b63eeb876
2020-04-13 17:21:46 -05:00
traud 7cdb493a1e BuildSystem: Remove doc/tex and doc/pdf leftovers.
Furthermore, the nowhere used compress is removed.

ASTERISK-28816

Change-Id: I77daab80cfabb56d51c3ea6b1d14bd9b9fbc577c
2020-04-13 10:24:18 -05:00
Alexander Traud 7a04947abd
BuildSystem: Allow space in path.
ASTERISK-28818

Change-Id: Ib7f246896457d9e3b14d7f5199136d6545ce0b6f
2020-04-09 14:05:54 +02:00
Jaco Kroon f824cd6a13 build: search from newest to oldest for gmime.
We (Gentoo distribution) reckon that in the case of multiple versions of
gmime installed we should prefer the newest one.

Change-Id: Idf7be613230232eb1d573d93c4a5a8297f4ecd2d
2020-03-25 06:41:32 -05:00
Sebastian Kemper b7fbb9c41f check_expr2: fix cross-compile/hardening issues
When building check_expr2 with ASLR PIE hardening enabled the linker
fails. This is resolved by adding the regular compiler flags when
building the object files from ast_expr2f.c and ast_expr2.c.

Note: The STANDALONE define is removed because it is already defined in
_ASTCFLAGS. YY_NO_INPUT is defined so that the compile survives
'--enable-dev-mode'.

Also, a Makefile variable "CROSS_COMPILING" is added so that the
build system doesn't try to run check_expr2 when cross-compiling,
because that will fail the build as will.

ASTERISK-28685 #close

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
Change-Id: If435b7db9f9ad8266245bda51c81c220f9658915
2020-02-26 19:52:17 +01:00
Ben Ford 168637cc0c RTP/ICE: Send on first valid pair.
When handling ICE negotiations, it's possible that there can be a delay
between STUN binding requests which in turn will cause a delay in ICE
completion, preventing media from flowing. It should be possible to send
media when there is at least one valid pair, preventing this scenario
from occurring.

A change was added to PJPROJECT that adds an optional callback
(on_valid_pair) that will be called when the first valid pair is found
during ICE negotiation. Asterisk uses this to start the DTLS handshake,
allowing media to flow. It will only be called once, either on the first
valid pair, or when ICE negotiation is complete.

ASTERISK-28716

Change-Id: Ia7b68c34f06d2a1d91c5ed51627b66fd0363d867
2020-02-18 09:55:12 -06:00
Joshua C. Colp ed394ce5b1 configure: Add check for MySQL client bool and my_bool type usage.
Instead of trying to use the defined MySQL client version from the
header use a configure check to determine whether the bool or my_bool
type should be used for defining a boolean.

ASTERISK-28604

Change-Id: Id2225b3785115de074c50c123ff1a68005b4a9c7
2019-12-16 10:36:25 -06:00
Joshua Colp a8e5cf557d res_rtp_asterisk: Add support for DTLS packet fragmentation.
This change adds support for larger TLS certificates by allowing
OpenSSL to fragment the DTLS packets according to the configured
MTU. By default this is set to 1200.

This is accomplished by implementing our own BIO method that
supports MTU querying. The configured MTU is returned to OpenSSL
which fragments the packet accordingly. When a packet is to be
sent it is done directly out the RTP instance.

ASTERISK-28018

Change-Id: If2d5032019a28ffd48f43e9e93ed71dbdbf39c06
2019-06-13 07:51:57 -06:00
Sebastian Kemper ccac55b894
loader: support for permanent dlopen()
Asterisk assumes that dlopen() will always run the constructor of a
shared library and every dlclose() will run its destructor. But dlopen()
may be permanent, meaning the constructor will only be run once, as is
the case with musl libc.

With a permanent dlopen() the Asterisk module loader does not work
correctly, because it's expectations regarding when the constructors and
destructors are run are not met. In fact a segmentation fault will occur
when the first module is "re-opened" that has AST_MODFLAG_GLOBAL_SYMBOLS
set (the dlopen() does not call the constructor, resource_being_loaded
is not set to NULL, then strlen is called with NULL instead of a string,
see issue ASTERISK-28319).

This commit adds code to the loader that will manually run the
constructors/destructors of the (non-builtin) modules where needed. To
achieve this a new ao2 container (linked list) is started and filled
with objects that contain the names of the modules and the pointers to
their respective info structs.

This behavior can be activated when configuring Asterisk
(--enable-permanent-dlopen). By default this is disabled, of course.

ASTERISK-28319 #close

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
Change-Id: I86693a0ecf25d5ba81c73773a03df4abc3426875
2019-04-04 15:14:21 -04:00