asterisk: bump to 18.15.1

This is a manual cherry-pick of commit
aa3bc352e7 as well as commit
b71770db41. The latter is currently in a
pull request to update asterisk to 18.15.1 in the openwrt-22.03 branch.

- add new modules
- res-geolocation depends on asterisk being built with libxlt support,
  but to make libxslt a general dependency is probably not a good idea
  for small devices, so this adds a config option
  ASTERISK_LIBXSLT_SUPPORT that is off by default except on x86_64
  builds
- refresh patches
- 180_build-fix-bininstall-launchd-issue-on-cross-platfrom.patch removed
  as included in upstream release
- added 170-menuselect-force-use-of-xml2-config.patch as upstream
  switched to use pkg-config for libxml2 detection, which would be fine,
  except OpenWrt's host libxml2 is static and Asterisk can't handle that
- the bump to 18.15.1 contains fixes for AST-2022-007, AST-2022-008 and
  AST-2022-009

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper
2022-12-03 15:53:38 +01:00
parent f5120a4637
commit 4f4e681c20
7 changed files with 48 additions and 66 deletions

View File

@@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=asterisk
PKG_VERSION:=18.11.2
PKG_VERSION:=18.15.1
PKG_RELEASE:=1
PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.asterisk.org/pub/telephony/asterisk/releases
PKG_HASH:=b456d19610e53789446e097bb9773a82a04088922de0cfaff2b818326b67296b
PKG_HASH:=7594b045e1979a6e80f07ecfff634204830917fd2a7686b161cf4849454f4531
PKG_BUILD_DEPENDS:=libxml2/host
@@ -184,6 +184,7 @@ MODULES_AVAILABLE:= \
func-dialplan \
func-enum \
func-env \
func-evalexten \
func-extstate \
func-frame-drop \
func-frame-trace \
@@ -227,6 +228,7 @@ MODULES_AVAILABLE:= \
pgsql \
pjsip \
res-adsi \
res-aeap \
res-ael-share \
res-agi \
res-ari \
@@ -250,6 +252,7 @@ MODULES_AVAILABLE:= \
res-calendar-icalendar \
res-chan-stats \
res-clialiases \
res-cliexec \
res-clioriginate \
res-config-ldap \
res-config-mysql \
@@ -271,6 +274,7 @@ MODULES_AVAILABLE:= \
res-format-attr-siren14 \
res-format-attr-siren7 \
res-format-attr-vp8 \
res-geolocation \
res-http-media-cache \
res-http-websocket \
res-limit \
@@ -284,6 +288,7 @@ MODULES_AVAILABLE:= \
res-mwi-external-ami \
res-parking \
res-phoneprov \
res-pjsip-geolocation \
res-pjsip-phoneprov \
res-pjsip-stir-shaken \
res-pjproject \
@@ -300,6 +305,7 @@ MODULES_AVAILABLE:= \
res-sorcery \
res-sorcery-memory-cache \
res-speech \
res-speech-aeap \
res-srtp \
res-stasis \
res-stasis-answer \
@@ -334,6 +340,7 @@ AST_ENABLE:=
PKG_CONFIG_DEPENDS:= \
$(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-%,$(MODULES_AVAILABLE)) \
$(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-util-%,$(subst _,-,$(UTILS_AVAILABLE))) \
CONFIG_ASTERISK_LIBXSLT_SUPPORT \
CONFIG_ASTERISK_LOW_MEMORY
include $(INCLUDE_DIR)/uclibc++.mk
@@ -376,6 +383,13 @@ define Package/$(PKG_NAME)/config
menu "Advanced configuration"
depends on PACKAGE_asterisk
config ASTERISK_LIBXSLT_SUPPORT
bool "Link Asterisk against libxslt"
default y if x86_64
help
Build Asterisk with libxslt support. This is required for
res-geolocation.
config ASTERISK_LOW_MEMORY
bool "Optimize Asterisk for low memory usage"
default n
@@ -458,7 +472,7 @@ define Package/$(PKG_NAME)
$(call Package/$(PKG_NAME)/Default)
TITLE:=Complete open source PBX, v$(PKG_VERSION)
MENU:=1
DEPENDS:=$(CXX_DEPENDS) +jansson +libcap +libedit +libopenssl +libsqlite3 +libuuid +libxml2 +zlib
DEPENDS:=+ASTERISK_LIBXSLT_SUPPORT:libxslt $(CXX_DEPENDS) +jansson +libcap +libedit +libopenssl +libsqlite3 +libuuid +libxml2 +zlib
USERID:=asterisk=385:asterisk=385
endef
@@ -574,7 +588,7 @@ CONFIGURE_ARGS+= \
--without-pjproject-bundled \
--with-libedit="$(STAGING_DIR)/usr" \
--with-libxml2 \
--without-libxslt \
$(if $(CONFIG_ASTERISK_LIBXSLT_SUPPORT),--with-libxslt,--without-libxslt) \
$(if $(CONFIG_PACKAGE_$(PKG_NAME)-res-snmp),--with-netsnmp="$(STAGING_DIR)/usr",--without-netsnmp) \
--without-newt \
--without-osptk \
@@ -886,7 +900,7 @@ $(eval $(call BuildAsteriskModule,codec-lpc10,Linear to LPC10 translation,LPC10
$(eval $(call BuildAsteriskModule,codec-resample,resample sLinear audio,SLIN resampling codec.,,,codec_resample,,))
$(eval $(call BuildAsteriskModule,codec-speex,Speex Coder/Decoder,Speex coder/decoder.,@!SOFT_FLOAT +libspeex +libspeexdsp,,codec_speex,,))
$(eval $(call BuildAsteriskModule,codec-ulaw,Signed linear to ulaw translation,Ulaw coder/decoder.,,,codec_ulaw,,))
$(eval $(call BuildAsteriskModule,curl,CURL,cURL support,+libcurl,,func_curl res_config_curl res_curl,,))
$(eval $(call BuildAsteriskModule,curl,CURL,cURL,+libcurl,,func_curl res_config_curl res_curl,,))
$(eval $(call BuildAsteriskModule,format-g719,G.719,ITU G.719.,,,format_g719,,))
$(eval $(call BuildAsteriskModule,format-g723,G.723.1,G.723.1 simple timestamp file format.,,,format_g723,,))
$(eval $(call BuildAsteriskModule,format-g726,G.726,Raw G.726 data.,,,format_g726,,))
@@ -906,7 +920,7 @@ $(eval $(call BuildAsteriskModule,format-vox,VOX format,Dialogic VOX file format
$(eval $(call BuildAsteriskModule,format-wav,WAV format (8000hz Signed Linear),Microsoft WAV/WAV16 format.,,,format_wav,,))
$(eval $(call BuildAsteriskModule,format-wav-gsm,WAV format (Proprietary GSM),Microsoft WAV format.,,,format_wav_gsm,,))
$(eval $(call BuildAsteriskModule,func-aes,AES dialplan functions,AES dialplan functions.,,,func_aes,,))
$(eval $(call BuildAsteriskModule,func-base64,base64 support,Base64 encode/decode dialplan functions.,,,func_base64,,))
$(eval $(call BuildAsteriskModule,func-base64,base64,Base64 encode/decode dialplan functions.,,,func_base64,,))
$(eval $(call BuildAsteriskModule,func-blacklist,Blacklist on callerid,Look up Caller ID name/number from blacklist database.,,,func_blacklist,,))
$(eval $(call BuildAsteriskModule,func-callcompletion,Call control configuration function,Call control configuration function.,,,func_callcompletion,,))
$(eval $(call BuildAsteriskModule,func-channel,Channel info,Channel information dialplan functions.,,,func_channel,,))
@@ -918,6 +932,7 @@ $(eval $(call BuildAsteriskModule,func-dialgroup,Dialgroup dialplan function,Dia
$(eval $(call BuildAsteriskModule,func-dialplan,Dialplan context/extension/priority checking functions,Dialplan context/extension/priority checking functions.,,,func_dialplan,,))
$(eval $(call BuildAsteriskModule,func-enum,ENUM,ENUM related dialplan functions.,,enum.conf,func_enum,,))
$(eval $(call BuildAsteriskModule,func-env,Environment functions,Environment/filesystem dialplan functions.,,,func_env,,))
$(eval $(call BuildAsteriskModule,func-evalexten,Extension evaluation,Extension evaluation functions.,,,func_evalexten,,))
$(eval $(call BuildAsteriskModule,func-extstate,Hinted extension state,Gets the state of an extension in the dialplan.,,,func_extstate,,))
$(eval $(call BuildAsteriskModule,func-frame-drop,Frame drop,Function to drop frames on a channel.,,,func_frame_drop,,))
$(eval $(call BuildAsteriskModule,func-frame-trace,Frame trace for internal ast_frame debugging,Frame trace for internal ast_frame debugging.,,,func_frame_trace,,))
@@ -961,6 +976,7 @@ $(eval $(call BuildAsteriskModule,pbx-spool,Call Spool,Outgoing spool support.,,
$(eval $(call BuildAsteriskModule,pgsql,PostgreSQL,PostgreSQL support.,+libpq,cel_pgsql.conf cdr_pgsql.conf res_pgsql.conf,cel_pgsql cdr_pgsql res_config_pgsql,,))
$(eval $(call BuildAsteriskModule,pjsip,pjsip channel,PJSIP SIP stack.,+$(PKG_NAME)-res-http-websocket +$(PKG_NAME)-res-pjproject +$(PKG_NAME)-res-sorcery +libpjsip +libpjmedia +libpjnath +libpjsip-simple +libpjsip-ua +libpjsua +libpjsua2,pjsip.conf pjsip_notify.conf pjsip_wizard.conf,chan_pjsip func_pjsip_aor func_pjsip_contact func_pjsip_endpoint res_pjsip res_pjsip_acl res_pjsip_authenticator_digest res_pjsip_caller_id res_pjsip_config_wizard res_pjsip_dialog_info_body_generator res_pjsip_diversion res_pjsip_dlg_options res_pjsip_dtmf_info res_pjsip_empty_info res_pjsip_endpoint_identifier_anonymous res_pjsip_endpoint_identifier_ip res_pjsip_endpoint_identifier_user res_pjsip_exten_state res_pjsip_header_funcs res_pjsip_history res_pjsip_logger res_pjsip_messaging res_pjsip_mwi res_pjsip_mwi_body_generator res_pjsip_nat res_pjsip_notify res_pjsip_one_touch_record_info res_pjsip_outbound_authenticator_digest res_pjsip_outbound_publish res_pjsip_outbound_registration res_pjsip_path res_pjsip_pidf_body_generator res_pjsip_pidf_digium_body_supplement res_pjsip_pidf_eyebeam_body_supplement res_pjsip_publish_asterisk res_pjsip_pubsub res_pjsip_refer res_pjsip_registrar res_pjsip_rfc3326 res_pjsip_sdp_rtp res_pjsip_send_to_voicemail res_pjsip_session res_pjsip_sips_contact res_pjsip_t38 res_pjsip_transport_websocket res_pjsip_xpidf_body_generator,,))
$(eval $(call BuildAsteriskModule,res-adsi,Provide ADSI,ADSI resource.,,,res_adsi,,))
$(eval $(call BuildAsteriskModule,res-aeap,Provide AEAP,AEAP resource.,+asterisk-res-http-websocket,aeap.conf,res_aeap,,))
$(eval $(call BuildAsteriskModule,res-ael-share,Shareable AEL code,Shareable code for AEL.,,,res_ael_share,,))
$(eval $(call BuildAsteriskModule,res-agi,Asterisk Gateway Interface,Asterisk Gateway Interface.,+$(PKG_NAME)-res-speech,,res_agi,,))
$(eval $(call BuildAsteriskModule,res-ari,Asterisk RESTful interface,Asterisk RESTful Interface.,+$(PKG_NAME)-res-http-websocket,ari.conf,res_ari,,))
@@ -984,6 +1000,7 @@ $(eval $(call BuildAsteriskModule,res-calendar-exchange,Exchange calendar,Asteri
$(eval $(call BuildAsteriskModule,res-calendar-icalendar,iCalendar calendar,Asterisk iCalendar .ics file integration.,+$(PKG_NAME)-res-calendar +libical +libneon,,res_calendar_icalendar,,))
$(eval $(call BuildAsteriskModule,res-chan-stats,statsd channel stats,Example of how to use Stasis.,+$(PKG_NAME)-res-statsd,,res_chan_stats,,))
$(eval $(call BuildAsteriskModule,res-clialiases,CLI aliases,CLI aliases.,,cli_aliases.conf,res_clialiases,,))
$(eval $(call BuildAsteriskModule,res-cliexec,Execute from CLI,Simple dialplan execution from the CLI.,,,res_cliexec,,))
$(eval $(call BuildAsteriskModule,res-clioriginate,Calls via CLI,Call origination and redirection from the CLI.,,,res_clioriginate,,))
$(eval $(call BuildAsteriskModule,res-config-ldap,LDAP realtime interface,LDAP realtime interface.,+libopenldap,res_ldap.conf,res_config_ldap,,))
$(eval $(call BuildAsteriskModule,res-config-mysql,MySQL CDR backend,MySQL realtime configuration driver.,+libmysqlclient,,res_config_mysql,,))
@@ -1005,8 +1022,9 @@ $(eval $(call BuildAsteriskModule,res-format-attr-silk,SILK format attribute mod
$(eval $(call BuildAsteriskModule,res-format-attr-siren14,Siren14 format attribute module,Siren14 format attribute module.,,,res_format_attr_siren14,,))
$(eval $(call BuildAsteriskModule,res-format-attr-siren7,Siren7 format attribute module,Siren7 format attribute module.,,,res_format_attr_siren7,,))
$(eval $(call BuildAsteriskModule,res-format-attr-vp8,VP8 format attribute module,VP8 format attribute module.,,,res_format_attr_vp8,,))
$(eval $(call BuildAsteriskModule,res-geolocation,Geolocation,Geolocation support.,@ASTERISK_LIBXSLT_SUPPORT,geolocation.conf,res_geolocation,,))
$(eval $(call BuildAsteriskModule,res-http-media-cache,HTTP media cache backend,HTTP media cache backend.,+$(PKG_NAME)-curl,,res_http_media_cache,,))
$(eval $(call BuildAsteriskModule,res-http-websocket,HTTP websocket support,HTTP WebSocket support.,,,res_http_websocket,,))
$(eval $(call BuildAsteriskModule,res-http-websocket,HTTP websocket,HTTP WebSocket support.,,,res_http_websocket,,))
$(eval $(call BuildAsteriskModule,res-limit,Resource limits,Resource limits.,,,res_limit,,))
$(eval $(call BuildAsteriskModule,res-manager-devicestate,Device state topic forwarder,Manager device state topic forwarder.,,,res_manager_devicestate,,))
$(eval $(call BuildAsteriskModule,res-manager-presencestate,Presence state topic forwarder,Manager presence state topic forwarder.,,,res_manager_presencestate,,))
@@ -1018,6 +1036,7 @@ $(eval $(call BuildAsteriskModule,res-mwi-external,Core external MWI resource,Co
$(eval $(call BuildAsteriskModule,res-mwi-external-ami,AMI for external MWI,AMI support for external MWI.,+$(PKG_NAME)-res-mwi-external,,res_mwi_external_ami,,))
$(eval $(call BuildAsteriskModule,res-parking,Phone Parking,Call parking resource.,+$(PKG_NAME)-bridge-holding,res_parking.conf,res_parking,,))
$(eval $(call BuildAsteriskModule,res-phoneprov,Phone Provisioning,HTTP phone provisioning.,,phoneprov.conf,res_phoneprov,,))
$(eval $(call BuildAsteriskModule,res-pjsip-geolocation,PJSIP Geolocation,PJSIP Geolocation support.,+asterisk-pjsip +asterisk-res-geolocation,,res_pjsip_geolocation,,))
$(eval $(call BuildAsteriskModule,res-pjsip-phoneprov,PJSIP Phone Provisioning,PJSIP phone provisioning.,+$(PKG_NAME)-pjsip +$(PKG_NAME)-res-phoneprov,,res_pjsip_phoneprov_provider,,))
$(eval $(call BuildAsteriskModule,res-pjsip-stir-shaken,PJSIP STIR/SHAKEN resource module,PJSIP STIR/SHAKEN resource module.,+$(PKG_NAME)-pjsip +$(PKG_NAME)-res-stir-shaken,,res_pjsip_stir_shaken,,))
$(eval $(call BuildAsteriskModule,res-pjproject,Bridge PJPROJECT to Asterisk logging,PJProject log and utility support.,+asterisk-res-sorcery +libpj +libpjlib-util +libpjmedia +libpjmedia +libpjnath +libpjsip-simple +libpjsip-ua +libpjsip +libpjsua +libpjsua2 +libsrtp2,pjproject.conf,res_pjproject,,))
@@ -1034,6 +1053,7 @@ $(eval $(call BuildAsteriskModule,res-snmp,SNMP [Sub]Agent for Asterisk,SNMP age
$(eval $(call BuildAsteriskModule,res-sorcery,Sorcery data layer,Sorcery backend modules for data access intended for using realtime as\nbackend.,,sorcery.conf,res_sorcery_astdb res_sorcery_config res_sorcery_memory res_sorcery_realtime,,))
$(eval $(call BuildAsteriskModule,res-sorcery-memory-cache,Sorcery memory cache object wizard,Sorcery memory cache object wizard.,,,res_sorcery_memory_cache,,))
$(eval $(call BuildAsteriskModule,res-speech,Speech Recognition API,Generic speech recognition API.,,,res_speech,,))
$(eval $(call BuildAsteriskModule,res-speech-aeap,AEAP Speech Engine,AEAP Speech Engine support.,+asterisk-res-aeap +asterisk-res-speech,,res_speech_aeap,,))
$(eval $(call BuildAsteriskModule,res-srtp,SRTP Support,Secure RTP.,+libsrtp2,,res_srtp,,))
$(eval $(call BuildAsteriskModule,res-stasis,Stasis application,Stasis application support.,,,res_stasis,,))
$(eval $(call BuildAsteriskModule,res-stasis-answer,Stasis application answer,Stasis application answer support.,+$(PKG_NAME)-res-stasis,,res_stasis_answer,,))

View File

@@ -1,6 +1,6 @@
--- a/configure.ac
+++ b/configure.ac
@@ -1090,15 +1090,18 @@ AC_LINK_IFELSE(
@@ -1092,15 +1092,18 @@ AC_LINK_IFELSE(
# Some platforms define sem_init(), but only support sem_open(). joyous.
AC_MSG_CHECKING(for working unnamed semaphores)

View File

@@ -18,7 +18,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
--- a/configure.ac
+++ b/configure.ac
@@ -1484,7 +1484,11 @@ AC_LINK_IFELSE(
@@ -1496,7 +1496,11 @@ AC_LINK_IFELSE(
#include <arpa/nameser.h>
#endif
#include <resolv.h>],

View File

@@ -1,6 +1,6 @@
--- a/configure.ac
+++ b/configure.ac
@@ -1263,7 +1263,7 @@ if test "${ac_cv_have_variable_fdset}x"
@@ -1265,7 +1265,7 @@ if test "${ac_cv_have_variable_fdset}x"
fi
AC_MSG_CHECKING([if we have usable eventfd support])

View File

@@ -1,6 +1,6 @@
--- a/configure.ac
+++ b/configure.ac
@@ -2619,7 +2619,7 @@ if test -z "$__opus_include" -o x"$__opu
@@ -2632,7 +2632,7 @@ if test -z "$__opus_include" -o x"$__opu
fi
AST_EXT_LIB_CHECK([OPUSFILE], [opusfile], [op_open_callbacks], [opus/opusfile.h], [], [$__opus_include])

View File

@@ -0,0 +1,17 @@
Since commit dc701d6 in the OpenWrt packages repo the host libxml2 package
provides a static lib only. But Asterisk does not check that and calls
pkg-config without "--static". The result is that menuselect doesn't build.
So don't use pkg-config for the libxml2 detection. Asterisk will resort to
use xml2-config, which outputs all the flags needed.
--- a/menuselect/configure.ac
+++ b/menuselect/configure.ac
@@ -91,7 +91,6 @@ else
AST_EXT_LIB_CHECK([TINFO], [tinfo], [keypad], [curses.h])
fi
-AST_PKG_CONFIG_CHECK([LIBXML2], [libxml-2.0])
AST_EXT_TOOL_CHECK([LIBXML2], [xml2-config], , ,
[#include <libxml/tree.h>
#include <libxml/parser.h>],

View File

@@ -1,55 +0,0 @@
From: https://issues.asterisk.org/jira/browse/ASTERISK-29905
From d27d75ad8058f6ed35197737b949bac57202dd54 Mon Sep 17 00:00:00 2001
From: "Sergey V. Lobanov" <sergey@lobanov.in>
Date: Wed, 9 Feb 2022 01:29:46 +0300
Subject: [PATCH] build: fix bininstall launchd issue on cross-platfrom build
configure script detects /sbin/launchd, but the result of this
check is not used in Makefile (bininstall). Makefile also detects
/sbin/launchd file to decide if it is required to install
safe_asterisk.
configure script correctly detects cross compile build and sets
PBX_LAUNCHD=0
In case of building asterisk on MacOS host for Linux target using
external toolchain (e.g. OpenWrt toolchain), bininstall does not
install safe_asterisk (due to /sbin/launchd detection in Makefile),
but it is required on target (Linux).
This patch adds HAVE_SBIN_LAUNCHD=@PBX_LAUNCHD@ to makeopts.in to
use the result of /sbin/launchd detection from configure script in
Makefile.
Also this patch uses HAVE_SBIN_LAUNCHD in Makefile (bininstall) to
decide if it is required to install safe_asterisk.
Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
---
Makefile | 6 +++---
makeopts.in | 2 ++
2 files changed, 5 insertions(+), 3 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -558,9 +558,9 @@ bininstall: _all installdirs $(SUBDIRS_I
$(INSTALL) -m 755 contrib/scripts/astversion "$(DESTDIR)$(ASTSBINDIR)/"
$(INSTALL) -m 755 contrib/scripts/astgenkey "$(DESTDIR)$(ASTSBINDIR)/"
$(INSTALL) -m 755 contrib/scripts/autosupport "$(DESTDIR)$(ASTSBINDIR)/"
- if [ ! -f /sbin/launchd ]; then \
- ./build_tools/install_subst contrib/scripts/safe_asterisk "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk"; \
- fi
+ifneq ($(HAVE_SBIN_LAUNCHD),1)
+ ./build_tools/install_subst contrib/scripts/safe_asterisk "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk";
+endif
ifneq ($(DISABLE_XMLDOC),yes)
$(INSTALL) -m 644 doc/core-*.xml "$(DESTDIR)$(ASTDATADIR)/documentation"
--- a/makeopts.in
+++ b/makeopts.in
@@ -373,3 +373,5 @@ SNDFILE_LIB=@SNDFILE_LIB@
BEANSTALK_INCLUDE=@BEANSTALK_INCLUDE@
BEANSTALK_LIB=@BEANSTALK_LIB@
+
+HAVE_SBIN_LAUNCHD=@PBX_LAUNCHD@