summaryrefslogtreecommitdiff
path: root/comms
diff options
context:
space:
mode:
authorjnemeth <jnemeth@pkgsrc.org>2021-06-27 08:53:55 +0000
committerjnemeth <jnemeth@pkgsrc.org>2021-06-27 08:53:55 +0000
commit2d6040abe47aafcbaf9ce50bb056a54643d46326 (patch)
tree26b1458cf4e17c3c8b92acbbb7f62cc415c8e7fb /comms
parent3265e074283f342aeca4e0673a0a1872321f2e72 (diff)
downloadpkgsrc-2d6040abe47aafcbaf9ce50bb056a54643d46326.tar.gz
Removed comms/asterisk15 as mentioned on pkgsrc-users.
Diffstat (limited to 'comms')
-rw-r--r--comms/asterisk15/files/smf/manifest.xml34
-rw-r--r--comms/asterisk15/patches/patch-Makefile125
-rw-r--r--comms/asterisk15/patches/patch-addons_chan__ooh323.c13
-rw-r--r--comms/asterisk15/patches/patch-apps_app__adsiprog.c22
-rw-r--r--comms/asterisk15/patches/patch-apps_app__chanspy.c13
-rw-r--r--comms/asterisk15/patches/patch-apps_app__directory.c13
-rw-r--r--comms/asterisk15/patches/patch-apps_app__dumpchan.c22
-rw-r--r--comms/asterisk15/patches/patch-apps_app__followme.c22
-rw-r--r--comms/asterisk15/patches/patch-apps_app__minivm.c13
-rw-r--r--comms/asterisk15/patches/patch-apps_app__queue.c163
-rw-r--r--comms/asterisk15/patches/patch-apps_app__sms.c102
-rw-r--r--comms/asterisk15/patches/patch-apps_app__voicemail.c76
-rw-r--r--comms/asterisk15/patches/patch-build__tools_mkpkgconfig19
-rw-r--r--comms/asterisk15/patches/patch-cdr_cdr__pgsql.c31
-rw-r--r--comms/asterisk15/patches/patch-cel_cel__pgsql.c13
-rw-r--r--comms/asterisk15/patches/patch-channels_chan__pjsip.c32
-rw-r--r--comms/asterisk15/patches/patch-channels_chan__sip.c40
-rw-r--r--comms/asterisk15/patches/patch-channels_pjsip_cli__commands.c33
-rw-r--r--comms/asterisk15/patches/patch-channels_pjsip_dialplan__functions.c32
-rw-r--r--comms/asterisk15/patches/patch-configure204
-rw-r--r--comms/asterisk15/patches/patch-configure.ac44
-rw-r--r--comms/asterisk15/patches/patch-contrib_scripts_vmail.cgi181
-rw-r--r--comms/asterisk15/patches/patch-funcs_func__cdr.c13
-rw-r--r--comms/asterisk15/patches/patch-funcs_func__channel.c13
-rw-r--r--comms/asterisk15/patches/patch-funcs_func__env.c49
-rw-r--r--comms/asterisk15/patches/patch-funcs_func__pjsip__aor.c22
-rw-r--r--comms/asterisk15/patches/patch-funcs_func__pjsip__contact.c22
-rw-r--r--comms/asterisk15/patches/patch-funcs_func__pjsip__endpoint.c23
-rw-r--r--comms/asterisk15/patches/patch-funcs_func__strings.c40
-rw-r--r--comms/asterisk15/patches/patch-include_asterisk_autoconfig.h.in27
-rw-r--r--comms/asterisk15/patches/patch-include_asterisk_lock.h76
-rw-r--r--comms/asterisk15/patches/patch-include_asterisk_sha1.h131
-rw-r--r--comms/asterisk15/patches/patch-include_asterisk_strings.h40
-rw-r--r--comms/asterisk15/patches/patch-main_Makefile38
-rw-r--r--comms/asterisk15/patches/patch-main_acl.c40
-rw-r--r--comms/asterisk15/patches/patch-main_app.c13
-rw-r--r--comms/asterisk15/patches/patch-main_ast__expr2.c16
-rw-r--r--comms/asterisk15/patches/patch-main_ast__expr2.y16
-rw-r--r--comms/asterisk15/patches/patch-main_asterisk.c40
-rw-r--r--comms/asterisk15/patches/patch-main_astmm.c13
-rw-r--r--comms/asterisk15/patches/patch-main_bridge__basic.c13
-rw-r--r--comms/asterisk15/patches/patch-main_callerid.c28
-rw-r--r--comms/asterisk15/patches/patch-main_cdr.c25
-rw-r--r--comms/asterisk15/patches/patch-main_cel.c13
-rw-r--r--comms/asterisk15/patches/patch-main_cli.c22
-rw-r--r--comms/asterisk15/patches/patch-main_conversions.c13
-rw-r--r--comms/asterisk15/patches/patch-main_dns__naptr.c40
-rw-r--r--comms/asterisk15/patches/patch-main_enum.c76
-rw-r--r--comms/asterisk15/patches/patch-main_features.c20
-rw-r--r--comms/asterisk15/patches/patch-main_http.c13
-rw-r--r--comms/asterisk15/patches/patch-main_indications.c13
-rw-r--r--comms/asterisk15/patches/patch-main_logger.c22
-rw-r--r--comms/asterisk15/patches/patch-main_manager.c83
-rw-r--r--comms/asterisk15/patches/patch-main_netsock.c13
-rw-r--r--comms/asterisk15/patches/patch-main_pbx.c13
-rw-r--r--comms/asterisk15/patches/patch-main_pbx__builtins.c33
-rw-r--r--comms/asterisk15/patches/patch-main_pbx__timing.c13
-rw-r--r--comms/asterisk15/patches/patch-main_sched.c27
-rw-r--r--comms/asterisk15/patches/patch-main_stdtime_localtime.c147
-rw-r--r--comms/asterisk15/patches/patch-main_tdd.c13
-rw-r--r--comms/asterisk15/patches/patch-main_test.c13
-rw-r--r--comms/asterisk15/patches/patch-main_utils.c60
-rw-r--r--comms/asterisk15/patches/patch-menuselect_menuselect.c22
-rw-r--r--comms/asterisk15/patches/patch-pbx_pbx__config.c22
-rw-r--r--comms/asterisk15/patches/patch-pbx_pbx__dundi.c40
-rw-r--r--comms/asterisk15/patches/patch-res_ael_pval.c41
-rw-r--r--comms/asterisk15/patches/patch-res_res__calendar.c37
-rw-r--r--comms/asterisk15/patches/patch-res_res__calendar__caldav.c13
-rw-r--r--comms/asterisk15/patches/patch-res_res__calendar__icalendar.c13
-rw-r--r--comms/asterisk15/patches/patch-res_res__hep__pjsip.c23
-rw-r--r--comms/asterisk15/patches/patch-res_res__limit.c13
-rw-r--r--comms/asterisk15/patches/patch-res_res__musiconhold.c22
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjproject.c31
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip.c42
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__acl.c23
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__authenticator__digest.c22
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__caller__id.c23
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__config__wizard.c25
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__dialog__info__body__generator.c18
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__diversion.c34
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__dlg__options.c18
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__dtmf__info.c19
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__empty__info.c19
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__endpoint__identifier__anonymous.c17
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__endpoint__identifier__ip.c22
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__endpoint__identifier__user.c17
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__exten__state.c31
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__header__funcs.c28
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__history.c26
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__logger.c23
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__messaging.c22
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__mwi.c33
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__mwi__body__generator.c23
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__nat.c21
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__notify.c27
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__one__touch__record__info.c23
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__outbound__authenticator__digest.c22
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__outbound__publish.c26
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__outbound__registration.c29
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__path.c21
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__phoneprov__provider.c21
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__pidf__body__generator.c18
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__pidf__digium__body__supplement.c20
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__pidf__eyebeam__body__supplement.c18
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__publish__asterisk.c24
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__pubsub.c36
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__refer.c29
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__registrar.c26
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__rfc3326.c23
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__sdp__rtp.c28
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__send__to__voicemail.c21
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__session.c37
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__sips__contact.c17
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__t38.c28
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__transport__websocket.c23
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip__xpidf__body__generator.c18
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_config__auth.c22
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_config__domain__aliases.c21
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_config__global.c25
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_config__system.c23
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_config__transport.c31
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_location.c33
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_pjsip__cli.c31
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_pjsip__configuration.c40
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_pjsip__distributor.c22
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_pjsip__global__headers.c19
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_pjsip__message__filter.c13
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_pjsip__options.c34
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_pjsip__resolver.c33
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_pjsip__scheduler.c18
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_pjsip__session.c25
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_pjsip__transport__events.c20
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_pjsip__transport__management.c20
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_presence__xml.c20
-rw-r--r--comms/asterisk15/patches/patch-res_res__pjsip_security__events.c17
-rw-r--r--comms/asterisk15/patches/patch-res_res__rtp__asterisk.c44
-rw-r--r--comms/asterisk15/patches/patch-res_res__xmpp.c13
-rw-r--r--comms/asterisk15/patches/patch-sounds_Makefile25
-rw-r--r--comms/asterisk15/patches/patch-tests_test__locale.c13
-rw-r--r--comms/asterisk15/patches/patch-tests_test__voicemail__api.c13
-rw-r--r--comms/asterisk15/patches/patch-utils_Makefile24
-rw-r--r--comms/asterisk15/patches/patch-utils_db1-ast_include_db.h13
-rw-r--r--comms/asterisk15/patches/patch-utils_extconf.c67
-rw-r--r--comms/asterisk15/patches/patch-utils_smsq.c13
144 files changed, 0 insertions, 4602 deletions
diff --git a/comms/asterisk15/files/smf/manifest.xml b/comms/asterisk15/files/smf/manifest.xml
deleted file mode 100644
index d68dff50919..00000000000
--- a/comms/asterisk15/files/smf/manifest.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
-<service_bundle type="manifest" name="export">
- <service name="@SMF_PREFIX@/@SMF_NAME@" type="service" version="1">
- <create_default_instance enabled="false" />
- <single_instance />
- <dependency name='network' grouping='require_all' restart_on='error' type='service'>
- <service_fmri value='svc:/milestone/network:default' />
- </dependency>
- <dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'>
- <service_fmri value='svc:/system/filesystem/local:default' />
- </dependency>
- <method_context>
- <method_environment>
- <envvar name="LD_PRELOAD_32" value="/usr/lib/extendedFILE.so.1" />
- </method_environment>
- </method_context>
- <exec_method type="method" name="start" exec="@PREFIX@/sbin/asterisk" timeout_seconds="60" />
- <exec_method type="method" name="stop" exec="@PREFIX@/sbin/asterisk -nr -x 'core stop gracefully' >/dev/null" timeout_seconds="60" />
- <exec_method type="method" name="refresh" exec="@PREFIX@/sbin/asterisk -nr -x 'core reload' >/dev/null" timeout_seconds="60" />
- <property_group name="startd" type="framework">
- <propval name="duration" type="astring" value="contract" />
- <propval name="ignore_error" type="astring" value="core,signal" />
- </property_group>
- <property_group name="application" type="application">
- <propval name="config_file" type="astring" value="@PKG_SYSCONFDIR@/asterisk.conf" />
- </property_group>
- <template>
- <common_name>
- <loctext xml:lang="C">Asterisk PBX</loctext>
- </common_name>
- </template>
- </service>
-</service_bundle>
diff --git a/comms/asterisk15/patches/patch-Makefile b/comms/asterisk15/patches/patch-Makefile
deleted file mode 100644
index 1fcd8c13ba0..00000000000
--- a/comms/asterisk15/patches/patch-Makefile
+++ /dev/null
@@ -1,125 +0,0 @@
-$NetBSD: patch-Makefile,v 1.2 2021/01/17 08:32:40 jnemeth Exp $
-
---- Makefile.orig 2019-09-05 13:09:20.000000000 +0000
-+++ Makefile
-@@ -145,7 +145,7 @@ DEBUG=-g3
-
- # Asterisk.conf is located in ASTETCDIR or by using the -C flag
- # when starting Asterisk
--ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
-+ASTCONFPATH=$(ASTEXAMPLEDIR)/asterisk.conf
- AGI_DIR=$(ASTDATADIR)/agi-bin
-
- # If you use Apache, you may determine by a grep 'DocumentRoot' of your httpd.conf file
-@@ -217,12 +217,6 @@ ifeq ($(AST_DEVMODE),yes)
- endif
- endif
-
--ifeq ($(OSARCH),NetBSD)
-- _ASTCFLAGS+=-isystem /usr/pkg/include
--else ifneq ($(findstring BSD,$(OSARCH)),)
-- _ASTCFLAGS+=-isystem /usr/local/include
--endif
--
- ifeq ($(OSARCH),FreeBSD)
- # -V is understood by BSD Make, not by GNU make.
- BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
-@@ -433,7 +427,6 @@ dist-clean: distclean
-
- distclean: $(SUBDIRS_DIST_CLEAN) _clean
- @$(MAKE) -C menuselect dist-clean
-- @$(MAKE) -C sounds dist-clean
- rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
- rm -f config.log config.status config.cache
- rm -rf autom4te.cache
-@@ -554,7 +547,7 @@ update:
-
- NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h))
- OLDHEADERS=$(filter-out $(NEWHEADERS) $(notdir $(DESTDIR)$(ASTHEADERDIR)),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
--INSTALLDIRS="$(ASTLIBDIR)" "$(ASTMODDIR)" "$(ASTSBINDIR)" "$(ASTETCDIR)" "$(ASTVARRUNDIR)" \
-+INSTALLDIRS="$(ASTLIBDIR)" "$(ASTMODDIR)" "$(ASTSBINDIR)" "$(ASTEXAMPLEDIR)" "$(ASTVARRUNDIR)" \
- "$(ASTSPOOLDIR)" "$(ASTSPOOLDIR)/dictate" "$(ASTSPOOLDIR)/meetme" \
- "$(ASTSPOOLDIR)/monitor" "$(ASTSPOOLDIR)/system" "$(ASTSPOOLDIR)/tmp" \
- "$(ASTSPOOLDIR)/voicemail" "$(ASTSPOOLDIR)/recording" \
-@@ -767,7 +760,7 @@ upgrade: bininstall
- # (2) the extension to strip off
- define INSTALL_CONFIGS
- @for x in $(1)/*$(2); do \
-- dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x $(2)`"; \
-+ dst="$(DESTDIR)$(ASTEXAMPLEDIR)/`$(BASENAME) $$x $(2)`"; \
- if [ -f "$${dst}" ]; then \
- if [ "$(OVERWRITE)" = "y" ]; then \
- if cmp -s "$${dst}" "$$x" ; then \
-@@ -796,9 +789,9 @@ define INSTALL_CONFIGS
- -e 's|^astrundir.*$$|astrundir => $(ASTVARRUNDIR)|' \
- -e 's|^astlogdir.*$$|astlogdir => $(ASTLOGDIR)|' \
- -e 's|^astsbindir.*$$|astsbindir => $(ASTSBINDIR)|' \
-- "$(DESTDIR)$(ASTCONFPATH)" > "$(DESTDIR)$(ASTCONFPATH).tmp" ; \
-- $(INSTALL) -m 644 "$(DESTDIR)$(ASTCONFPATH).tmp" "$(DESTDIR)$(ASTCONFPATH)" ; \
-- rm -f "$(DESTDIR)$(ASTCONFPATH).tmp" ; \
-+ "$(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf" > "$(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf.tmp" ; \
-+ $(INSTALL) -m 644 "$(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf.tmp" "$(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf" ; \
-+ rm -f "$(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf.tmp" ; \
- fi
- endef
-
-@@ -813,15 +806,15 @@ install-configs:
- # XXX why *.adsi is installed first ?
- adsi:
- @echo Installing adsi config files...
-- $(INSTALL) -d "$(DESTDIR)$(ASTETCDIR)"
-+ $(INSTALL) -d "$(DESTDIR)$(ASTEXAMPLEDIR)"
- @for x in configs/samples/*.adsi; do \
-- dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \
-+ dst="$(DESTDIR)$(ASTEXAMPLEDIR)/`$(BASENAME) $$x`" ; \
- if [ -f "$${dst}" ] ; then \
- echo "Overwriting $$x" ; \
- else \
- echo "Installing $$x" ; \
- fi ; \
-- $(INSTALL) -m 644 "$$x" "$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \
-+ $(INSTALL) -m 644 "$$x" "$(DESTDIR)$(ASTEXAMPLEDIR)/`$(BASENAME) $$x`" ; \
- done
-
- samples: adsi
-@@ -854,7 +847,7 @@ basic-pbx:
- webvmail:
- @[ -d "$(DESTDIR)$(HTTP_DOCSDIR)/" ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
- @[ -d "$(DESTDIR)$(HTTP_CGIDIR)" ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
-- $(INSTALL) -m 4755 contrib/scripts/vmail.cgi "$(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi"
-+ $(INSTALL) contrib/scripts/vmail.cgi "$(DESTDIR)$(HTTP_CGIDIR)/vmail"
- $(INSTALL) -d "$(DESTDIR)$(HTTP_DOCSDIR)/_asterisk"
- for x in images/*.gif; do \
- $(INSTALL) -m 644 $$x "$(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/"; \
-@@ -904,11 +897,11 @@ endif
- endif
-
- install-logrotate:
-- if [ ! -d "$(DESTDIR)$(ASTETCDIR)/../logrotate.d" ]; then \
-- $(INSTALL) -d "$(DESTDIR)$(ASTETCDIR)/../logrotate.d" ; \
-+ if [ ! -d "$(DESTDIR)$(ASTEXAMPLEDIR)/../logrotate.d" ]; then \
-+ $(INSTALL) -d "$(DESTDIR)$(ASTEXAMPLEDIR)/../logrotate.d" ; \
- fi
- sed 's#__LOGDIR__#$(ASTLOGDIR)#g' < contrib/scripts/asterisk.logrotate | sed 's#__SBINDIR__#$(ASTSBINDIR)#g' > contrib/scripts/asterisk.logrotate.tmp
-- $(INSTALL) -m 0644 contrib/scripts/asterisk.logrotate.tmp "$(DESTDIR)$(ASTETCDIR)/../logrotate.d/asterisk"
-+ $(INSTALL) -m 0644 contrib/scripts/asterisk.logrotate.tmp "$(DESTDIR)$(ASTEXAMPLEDIR)/../logrotate.d/asterisk"
- rm -f contrib/scripts/asterisk.logrotate.tmp
-
- config:
-@@ -1032,7 +1025,7 @@ uninstall-all: _uninstall
- rm -rf "$(DESTDIR)$(ASTVARLIBDIR)"
- rm -rf "$(DESTDIR)$(ASTDATADIR)"
- rm -rf "$(DESTDIR)$(ASTSPOOLDIR)"
-- rm -rf "$(DESTDIR)$(ASTETCDIR)"
-+ rm -rf "$(DESTDIR)$(ASTEXAMPLEDIR)"
- rm -rf "$(DESTDIR)$(ASTLOGDIR)"
-
- menuconfig: menuselect
-@@ -1121,6 +1114,7 @@ check-alembic: makeopts
-
- .PHONY: install-configs
- .PHONY: menuselect
-+.PHONY: menuselect.makeopts
- .PHONY: main
- .PHONY: sounds
- .PHONY: clean
diff --git a/comms/asterisk15/patches/patch-addons_chan__ooh323.c b/comms/asterisk15/patches/patch-addons_chan__ooh323.c
deleted file mode 100644
index 3d7bfca91d6..00000000000
--- a/comms/asterisk15/patches/patch-addons_chan__ooh323.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-addons_chan__ooh323.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- addons/chan_ooh323.c.orig 2018-05-01 20:12:26.000000000 +0000
-+++ addons/chan_ooh323.c
-@@ -4035,7 +4035,7 @@ static void *do_monitor(void *data)
- h323->lastrtprx + h323->rtptimeout < t) {
- if (!ast_channel_trylock(h323->owner)) {
- ast_softhangup_nolock(h323->owner, AST_SOFTHANGUP_DEV);
-- ast_log(LOG_NOTICE, "Disconnecting call '%s' for lack of RTP activity in %ld seconds\n", ast_channel_name(h323->owner), (long) (t - h323->lastrtprx));
-+ ast_log(LOG_NOTICE, "Disconnecting call '%s' for lack of RTP activity in %jd seconds\n", ast_channel_name(h323->owner), (intmax_t) (t - h323->lastrtprx));
- ast_channel_unlock(h323->owner);
- }
-
diff --git a/comms/asterisk15/patches/patch-apps_app__adsiprog.c b/comms/asterisk15/patches/patch-apps_app__adsiprog.c
deleted file mode 100644
index 1ef0397ce2f..00000000000
--- a/comms/asterisk15/patches/patch-apps_app__adsiprog.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-apps_app__adsiprog.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- apps/app_adsiprog.c.orig 2018-05-07 17:17:45.731153122 +0000
-+++ apps/app_adsiprog.c
-@@ -215,7 +215,7 @@ static int process_token(void *out, char
- /* Convert */
- *((unsigned int *)out) = htonl(*((unsigned int *)out));
- }
-- } else if ((strlen(src) > 2) && (src[0] == '0') && (tolower(src[1]) == 'x')) {
-+ } else if ((strlen(src) > 2) && (src[0] == '0') && (tolower((unsigned char)src[1]) == 'x')) {
- if (!(argtype & ARG_NUMBER))
- return -1;
- /* Hex value */
-@@ -225,7 +225,7 @@ static int process_token(void *out, char
- /* Convert */
- *((unsigned int *)out) = htonl(*((unsigned int *)out));
- }
-- } else if ((!ast_strlen_zero(src) && isdigit(src[0]))) {
-+ } else if ((!ast_strlen_zero(src) && isdigit((unsigned char)src[0]))) {
- if (!(argtype & ARG_NUMBER))
- return -1;
- /* Hex value */
diff --git a/comms/asterisk15/patches/patch-apps_app__chanspy.c b/comms/asterisk15/patches/patch-apps_app__chanspy.c
deleted file mode 100644
index cbff4704c3c..00000000000
--- a/comms/asterisk15/patches/patch-apps_app__chanspy.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-apps_app__chanspy.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- apps/app_chanspy.c.orig 2018-05-07 17:20:13.916423247 +0000
-+++ apps/app_chanspy.c
-@@ -1105,7 +1105,7 @@ static int common_exec(struct ast_channe
- if ((ptr = strchr(peer_name, '/'))) {
- *ptr++ = '\0';
- for (s = peer_name; s < ptr; s++) {
-- *s = tolower(*s);
-+ *s = tolower((unsigned char)*s);
- }
- if ((s = strchr(ptr, '-'))) {
- *s = '\0';
diff --git a/comms/asterisk15/patches/patch-apps_app__directory.c b/comms/asterisk15/patches/patch-apps_app__directory.c
deleted file mode 100644
index d2855bb946e..00000000000
--- a/comms/asterisk15/patches/patch-apps_app__directory.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-apps_app__directory.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- apps/app_directory.c.orig 2018-05-07 17:19:54.317128994 +0000
-+++ apps/app_directory.c
-@@ -194,7 +194,7 @@ static int compare(const char *text, con
- }
-
- while (*template) {
-- digit = toupper(*text++);
-+ digit = toupper((unsigned char)*text++);
- switch (digit) {
- case 0:
- return -1;
diff --git a/comms/asterisk15/patches/patch-apps_app__dumpchan.c b/comms/asterisk15/patches/patch-apps_app__dumpchan.c
deleted file mode 100644
index c5a8e0e8711..00000000000
--- a/comms/asterisk15/patches/patch-apps_app__dumpchan.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-apps_app__dumpchan.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- apps/app_dumpchan.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ apps/app_dumpchan.c
-@@ -117,7 +117,7 @@ static int serialize_showchan(struct ast
- "1stFileDescriptor= %d\n"
- "Framesin= %u %s\n"
- "Framesout= %u %s\n"
-- "TimetoHangup= %ld\n"
-+ "TimetoHangup= %jd\n"
- "ElapsedTime= %dh%dm%ds\n"
- "BridgeID= %s\n"
- "Context= %s\n"
-@@ -155,7 +155,7 @@ static int serialize_showchan(struct ast
- ast_channel_fd(c, 0),
- ast_channel_fin(c) & ~DEBUGCHAN_FLAG, (ast_channel_fin(c) & DEBUGCHAN_FLAG) ? " (DEBUGGED)" : "",
- ast_channel_fout(c) & ~DEBUGCHAN_FLAG, (ast_channel_fout(c) & DEBUGCHAN_FLAG) ? " (DEBUGGED)" : "",
-- (long)ast_channel_whentohangup(c)->tv_sec,
-+ (intmax_t)ast_channel_whentohangup(c)->tv_sec,
- hour,
- min,
- sec,
diff --git a/comms/asterisk15/patches/patch-apps_app__followme.c b/comms/asterisk15/patches/patch-apps_app__followme.c
deleted file mode 100644
index fa9d2524246..00000000000
--- a/comms/asterisk15/patches/patch-apps_app__followme.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-apps_app__followme.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- apps/app_followme.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ apps/app_followme.c
-@@ -380,7 +380,7 @@ static struct number *create_followme_nu
- *tmp = '\0';
- ast_copy_string(cur->number, buf, sizeof(cur->number));
- cur->order = numorder;
-- ast_debug(1, "Created a number, %s, order of , %d, with a timeout of %ld.\n", cur->number, cur->order, cur->timeout);
-+ ast_debug(1, "Created a number, %s, order of , %d, with a timeout of %jd.\n", cur->number, cur->order, (intmax_t)cur->timeout);
-
- return cur;
- }
-@@ -1010,7 +1010,7 @@ static struct ast_channel *findmeexec(st
- break;
- }
-
-- ast_debug(2, "Number(s) %s timeout %ld\n", nm->number, nm->timeout);
-+ ast_debug(2, "Number(s) %s timeout %jd\n", nm->number, (intmax_t)nm->timeout);
-
- /*
- * Put all active outgoing channels into autoservice.
diff --git a/comms/asterisk15/patches/patch-apps_app__minivm.c b/comms/asterisk15/patches/patch-apps_app__minivm.c
deleted file mode 100644
index 0c3a51e992b..00000000000
--- a/comms/asterisk15/patches/patch-apps_app__minivm.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-apps_app__minivm.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- apps/app_minivm.c.orig 2018-05-07 17:45:03.072823223 +0000
-+++ apps/app_minivm.c
-@@ -1593,7 +1593,7 @@ static int invent_message(struct ast_cha
-
- while (*i) {
- ast_debug(2, "Numeric? Checking %c\n", *i);
-- if (!isdigit(*i)) {
-+ if (!isdigit((unsigned char)*i)) {
- numericusername = FALSE;
- break;
- }
diff --git a/comms/asterisk15/patches/patch-apps_app__queue.c b/comms/asterisk15/patches/patch-apps_app__queue.c
deleted file mode 100644
index f6012f6453f..00000000000
--- a/comms/asterisk15/patches/patch-apps_app__queue.c
+++ /dev/null
@@ -1,163 +0,0 @@
-$NetBSD: patch-apps_app__queue.c,v 1.2 2021/01/17 08:32:40 jnemeth Exp $
-
---- apps/app_queue.c.orig 2019-09-05 13:09:20.000000000 +0000
-+++ apps/app_queue.c
-@@ -2308,7 +2308,7 @@ static int get_member_status(struct call
- ast_debug(4, "%s is unavailable because he is paused'\n", member->membername);
- break;
- } else if ((conditions & QUEUE_EMPTY_WRAPUP) && member->lastcall && q->wrapuptime && (time(NULL) - q->wrapuptime < member->lastcall)) {
-- ast_debug(4, "%s is unavailable because it has only been %d seconds since his last call (wrapup time is %d)\n", member->membername, (int) (time(NULL) - member->lastcall), q->wrapuptime);
-+ ast_debug(4, "%s is unavailable because it has only been %jd seconds since his last call (wrapup time is %jd)\n", member->membername, (intmax_t) (time(NULL) - member->lastcall), (intmax_t)q->wrapuptime);
- break;
- } else {
- ao2_ref(member, -1);
-@@ -5550,7 +5550,7 @@ static int wait_our_turn(struct queue_en
-
- if ((status = get_member_status(qe->parent, qe->max_penalty, qe->min_penalty, qe->raise_penalty, qe->parent->leavewhenempty, 0))) {
- *reason = QUEUE_LEAVEEMPTY;
-- ast_queue_log(qe->parent->name, ast_channel_uniqueid(qe->chan), "NONE", "EXITEMPTY", "%d|%d|%ld", qe->pos, qe->opos, (long) (time(NULL) - qe->start));
-+ ast_queue_log(qe->parent->name, ast_channel_uniqueid(qe->chan), "NONE", "EXITEMPTY", "%d|%d|%jd", qe->pos, qe->opos, (intmax_t) (time(NULL) - qe->start));
- res = -1;
- qe->handled = -1;
- break;
-@@ -5810,8 +5810,8 @@ static void queue_agent_cb(void *userdat
- } else if (ast_channel_agent_logoff_type() == stasis_message_type(msg)) {
- ast_queue_log("NONE", agent_blob->snapshot->uniqueid,
- ast_json_string_get(ast_json_object_get(agent_blob->blob, "agent")),
-- "AGENTLOGOFF", "%s|%ld", agent_blob->snapshot->name,
-- (long) ast_json_integer_get(ast_json_object_get(agent_blob->blob, "logintime")));
-+ "AGENTLOGOFF", "%s|%jd", agent_blob->snapshot->name,
-+ (intmax_t) ast_json_integer_get(ast_json_object_get(agent_blob->blob, "logintime")));
- }
- }
-
-@@ -6938,8 +6938,8 @@ static int try_calling(struct queue_ent
- /* if setinterfacevar is defined, make member variables available to the channel */
- /* use pbx_builtin_setvar to set a load of variables with one call */
- if (qe->parent->setinterfacevar && interfacevar) {
-- ast_str_set(&interfacevar, 0, "MEMBERINTERFACE=%s,MEMBERNAME=%s,MEMBERCALLS=%d,MEMBERLASTCALL=%ld,MEMBERPENALTY=%d,MEMBERDYNAMIC=%d,MEMBERREALTIME=%d",
-- member->interface, member->membername, member->calls, (long)member->lastcall, member->penalty, member->dynamic, member->realtime);
-+ ast_str_set(&interfacevar, 0, "MEMBERINTERFACE=%s,MEMBERNAME=%s,MEMBERCALLS=%d,MEMBERLASTCALL=%jd,MEMBERPENALTY=%d,MEMBERDYNAMIC=%d,MEMBERREALTIME=%d",
-+ member->interface, member->membername, member->calls, (intmax_t)member->lastcall, member->penalty, member->dynamic, member->realtime);
- pbx_builtin_setvar_multiple(qe->chan, ast_str_buffer(interfacevar));
- pbx_builtin_setvar_multiple(peer, ast_str_buffer(interfacevar));
- }
-@@ -6947,8 +6947,8 @@ static int try_calling(struct queue_ent
- /* if setqueueentryvar is defined, make queue entry (i.e. the caller) variables available to the channel */
- /* use pbx_builtin_setvar to set a load of variables with one call */
- if (qe->parent->setqueueentryvar && interfacevar) {
-- ast_str_set(&interfacevar, 0, "QEHOLDTIME=%ld,QEORIGINALPOS=%d",
-- (long) (time(NULL) - qe->start), qe->opos);
-+ ast_str_set(&interfacevar, 0, "QEHOLDTIME=%jd,QEORIGINALPOS=%d",
-+ (intmax_t) (time(NULL) - qe->start), qe->opos);
- pbx_builtin_setvar_multiple(qe->chan, ast_str_buffer(interfacevar));
- pbx_builtin_setvar_multiple(peer, ast_str_buffer(interfacevar));
- }
-@@ -8209,8 +8209,8 @@ static int queue_exec(struct ast_channel
- }
- }
-
-- ast_debug(1, "queue: %s, expires: %ld, priority: %d\n",
-- args.queuename, (long)qe.expire, prio);
-+ ast_debug(1, "queue: %s, expires: %jd, priority: %d\n",
-+ args.queuename, (intmax_t)qe.expire, prio);
-
- qe.chan = chan;
- qe.prio = prio;
-@@ -8261,8 +8261,8 @@ check_turns:
- record_abandoned(&qe);
- reason = QUEUE_TIMEOUT;
- res = 0;
-- ast_queue_log(args.queuename, ast_channel_uniqueid(chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld",
-- qe.pos, qe.opos, (long) (time(NULL) - qe.start));
-+ ast_queue_log(args.queuename, ast_channel_uniqueid(chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%jd",
-+ qe.pos, qe.opos, (intmax_t) (time(NULL) - qe.start));
- break;
- }
-
-@@ -8332,7 +8332,7 @@ check_turns:
- record_abandoned(&qe);
- reason = QUEUE_TIMEOUT;
- res = 0;
-- ast_queue_log(qe.parent->name, ast_channel_uniqueid(qe.chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", qe.pos, qe.opos, (long) (time(NULL) - qe.start));
-+ ast_queue_log(qe.parent->name, ast_channel_uniqueid(qe.chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%jd", qe.pos, qe.opos, (intmax_t) (time(NULL) - qe.start));
- break;
- }
-
-@@ -8373,7 +8373,7 @@ stop:
- }
- } else if (qe.valid_digits) {
- ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITWITHKEY",
-- "%s|%d|%d|%ld", qe.digits, qe.pos, qe.opos, (long) (time(NULL) - qe.start));
-+ "%s|%d|%d|%jd", qe.digits, qe.pos, qe.opos, (intmax_t) (time(NULL) - qe.start));
- }
- }
-
-@@ -9636,9 +9636,9 @@ static char *__queues_show(struct manses
-
- do_print(s, fd, " Callers: ");
- for (qe = q->head; qe; qe = qe->next) {
-- ast_str_set(&out, 0, " %d. %s (wait: %ld:%2.2ld, prio: %d)",
-- pos++, ast_channel_name(qe->chan), (long) (now - qe->start) / 60,
-- (long) (now - qe->start) % 60, qe->prio);
-+ ast_str_set(&out, 0, " %d. %s (wait: %jd:%2.2jd, prio: %d)",
-+ pos++, ast_channel_name(qe->chan), (intmax_t) (now - qe->start) / 60,
-+ (intmax_t) (now - qe->start) % 60, qe->prio);
- do_print(s, fd, ast_str_buffer(out));
- }
- }
-@@ -9677,7 +9677,7 @@ static int word_in_list(const char *list
- const char *find, *end_find, *end_list;
-
- /* strip whitespace from front */
-- while(isspace(*list)) {
-+ while(isspace((unsigned char)*list)) {
- list++;
- }
-
-@@ -9686,11 +9686,11 @@ static int word_in_list(const char *list
- if (find != list && *(find - 1) != ' ') {
- list = find;
- /* strip word from front */
-- while(!isspace(*list) && *list != '\0') {
-+ while(!isspace((unsigned char)*list) && *list != '\0') {
- list++;
- }
- /* strip whitespace from front */
-- while(isspace(*list)) {
-+ while(isspace((unsigned char)*list)) {
- list++;
- }
- continue;
-@@ -9703,11 +9703,11 @@ static int word_in_list(const char *list
- if (end_find == end_list || *end_find != ' ') {
- list = find;
- /* strip word from front */
-- while(!isspace(*list) && *list != '\0') {
-+ while(!isspace((unsigned char)*list) && *list != '\0') {
- list++;
- }
- /* strip whitespace from front */
-- while(isspace(*list)) {
-+ while(isspace((unsigned char)*list)) {
- list++;
- }
- continue;
-@@ -9999,7 +9999,7 @@ static int manager_queues_status(struct
- "CallerIDName: %s\r\n"
- "ConnectedLineNum: %s\r\n"
- "ConnectedLineName: %s\r\n"
-- "Wait: %ld\r\n"
-+ "Wait: %jd\r\n"
- "Priority: %d\r\n"
- "%s"
- "\r\n",
-@@ -10008,7 +10008,7 @@ static int manager_queues_status(struct
- S_COR(ast_channel_caller(qe->chan)->id.name.valid, ast_channel_caller(qe->chan)->id.name.str, "unknown"),
- S_COR(ast_channel_connected(qe->chan)->id.number.valid, ast_channel_connected(qe->chan)->id.number.str, "unknown"),
- S_COR(ast_channel_connected(qe->chan)->id.name.valid, ast_channel_connected(qe->chan)->id.name.str, "unknown"),
-- (long) (now - qe->start), qe->prio, idText);
-+ (intmax_t) (now - qe->start), qe->prio, idText);
- ++q_items;
- }
- }
diff --git a/comms/asterisk15/patches/patch-apps_app__sms.c b/comms/asterisk15/patches/patch-apps_app__sms.c
deleted file mode 100644
index 3e886f91d23..00000000000
--- a/comms/asterisk15/patches/patch-apps_app__sms.c
+++ /dev/null
@@ -1,102 +0,0 @@
-$NetBSD: patch-apps_app__sms.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- apps/app_sms.c.orig 2018-05-01 20:12:26.000000000 +0000
-+++ apps/app_sms.c
-@@ -291,7 +291,7 @@ static void numcpy(char *d, char *s)
- *d++ = *s++;
- }
- while (*s) {
-- if (isdigit(*s)) {
-+ if (isdigit((unsigned char)*s)) {
- *d++ = *s;
- }
- s++;
-@@ -557,7 +557,7 @@ static void packdate(unsigned char *o, t
- int z;
-
- ast_localtime(&topack, &t, NULL);
--#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) || defined(__CYGWIN__)
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__DragonFly__)
- z = -t.tm_gmtoff / 60 / 15;
- #else
- z = timezone / 60 / 15;
-@@ -754,7 +754,7 @@ static unsigned char packaddress(unsigne
- o[1] = 0x81;
- }
- for ( ; *i ; i++) {
-- if (!isdigit(*i)) { /* ignore non-digits */
-+ if (!isdigit((unsigned char)*i)) { /* ignore non-digits */
- continue;
- }
- if (o[0] & 1) {
-@@ -849,11 +849,11 @@ static void sms_readfile(sms_t * h, char
- if (!*p || *p == ';') {
- continue; /* blank line or comment, ignore */
- }
-- while (isalnum(*p)) {
-- *p = tolower (*p);
-+ while (isalnum((unsigned char)*p)) {
-+ *p = tolower ((unsigned char)*p);
- p++;
- }
-- while (isspace (*p)) {
-+ while (isspace ((unsigned char)*p)) {
- *p++ = 0;
- }
- if (*p == '=') {
-@@ -869,7 +869,7 @@ static void sms_readfile(sms_t * h, char
- ast_log(LOG_WARNING, "UD too long in %s\n", fn);
- }
- } else {
-- while (isspace (*p)) {
-+ while (isspace ((unsigned char)*p)) {
- p++;
- }
- if (!strcmp(line, "oa") && strlen(p) < sizeof(h->oa)) {
-@@ -917,11 +917,11 @@ static void sms_readfile(sms_t * h, char
- if (!strcmp(line, "ud")) { /* user data */
- int o = 0;
- while (*p && o < SMSLEN) {
-- if (isxdigit(*p) && isxdigit(p[1]) && isxdigit(p[2]) && isxdigit(p[3])) {
-+ if (isxdigit((unsigned char)*p) && isxdigit((unsigned char)p[1]) && isxdigit((unsigned char)p[2]) && isxdigit((unsigned char)p[3])) {
- h->ud[o++] =
-- (((isalpha(*p) ? 9 : 0) + (*p & 0xF)) << 12) +
-- (((isalpha(p[1]) ? 9 : 0) + (p[1] & 0xF)) << 8) +
-- (((isalpha(p[2]) ? 9 : 0) + (p[2] & 0xF)) << 4) + ((isalpha(p[3]) ? 9 : 0) + (p[3] & 0xF));
-+ (((isalpha((unsigned char)*p) ? 9 : 0) + (*p & 0xF)) << 12) +
-+ (((isalpha((unsigned char)p[1]) ? 9 : 0) + (p[1] & 0xF)) << 8) +
-+ (((isalpha((unsigned char)p[2]) ? 9 : 0) + (p[2] & 0xF)) << 4) + ((isalpha((unsigned char)p[3]) ? 9 : 0) + (p[3] & 0xF));
- p += 4;
- } else
- break;
-@@ -934,8 +934,8 @@ static void sms_readfile(sms_t * h, char
- } else if (!strcmp(line, "ud")) { /* user data */
- int o = 0;
- while (*p && o < SMSLEN) {
-- if (isxdigit(*p) && isxdigit(p[1])) {
-- h->ud[o++] = (((isalpha(*p) ? 9 : 0) + (*p & 0xF)) << 4) + ((isalpha(p[1]) ? 9 : 0) + (p[1] & 0xF));
-+ if (isxdigit((unsigned char)*p) && isxdigit((unsigned char)p[1])) {
-+ h->ud[o++] = (((isalpha((unsigned char)*p) ? 9 : 0) + (*p & 0xF)) << 4) + ((isalpha((unsigned char)p[1]) ? 9 : 0) + (p[1] & 0xF));
- p += 2;
- } else {
- break;
-@@ -949,8 +949,8 @@ static void sms_readfile(sms_t * h, char
- unsigned char o = 0;
- h->udhi = 1;
- while (*p && o < SMSLEN) {
-- if (isxdigit(*p) && isxdigit(p[1])) {
-- h->udh[o] = (((isalpha(*p) ? 9 : 0) + (*p & 0xF)) << 4) + ((isalpha(p[1]) ? 9 : 0) + (p[1] & 0xF));
-+ if (isxdigit((unsigned char)*p) && isxdigit((unsigned char)p[1])) {
-+ h->udh[o] = (((isalpha((unsigned char)*p) ? 9 : 0) + (*p & 0xF)) << 4) + ((isalpha((unsigned char)p[1]) ? 9 : 0) + (p[1] & 0xF));
- o++;
- p += 2;
- } else {
-@@ -1928,7 +1928,7 @@ static int sms_exec(struct ast_channel *
- ast_copy_string(h.queue, sms_args.queue, sizeof(h.queue));
-
- for (p = h.queue; *p; p++) {
-- if (!isalnum(*p)) {
-+ if (!isalnum((unsigned char)*p)) {
- *p = '-'; /* make very safe for filenames */
- }
- }
diff --git a/comms/asterisk15/patches/patch-apps_app__voicemail.c b/comms/asterisk15/patches/patch-apps_app__voicemail.c
deleted file mode 100644
index b69b77c03e2..00000000000
--- a/comms/asterisk15/patches/patch-apps_app__voicemail.c
+++ /dev/null
@@ -1,76 +0,0 @@
-$NetBSD: patch-apps_app__voicemail.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- apps/app_voicemail.c.orig 2018-05-01 20:12:26.000000000 +0000
-+++ apps/app_voicemail.c
-@@ -5251,7 +5251,7 @@ static void make_email_file(FILE *p,
- }
- fprintf(p, "X-Asterisk-VM-Message-Type: %s" ENDL, msgnum > -1 ? "Message" : greeting_attachment);
- fprintf(p, "X-Asterisk-VM-Orig-date: %s" ENDL, date);
-- fprintf(p, "X-Asterisk-VM-Orig-time: %ld" ENDL, (long) time(NULL));
-+ fprintf(p, "X-Asterisk-VM-Orig-time: %jd" ENDL, (intmax_t) time(NULL));
- fprintf(p, "X-Asterisk-VM-Message-ID: %s" ENDL, msg_id);
- }
- if (!ast_strlen_zero(cidnum)) {
-@@ -6202,7 +6202,7 @@ static void generate_msg_id(char *dst)
- * but only in single system solutions.
- */
- unsigned int unique_counter = ast_atomic_fetchadd_int(&msg_id_incrementor, +1);
-- snprintf(dst, MSG_ID_LEN, "%ld-%08x", (long) time(NULL), unique_counter);
-+ snprintf(dst, MSG_ID_LEN, "%jd-%08x", (intmax_t) time(NULL), unique_counter);
- }
-
- /*!
-@@ -6324,7 +6324,7 @@ static int msg_create_from_file(struct a
- "callerchan=%s\n"
- "callerid=%s\n"
- "origdate=%s\n"
-- "origtime=%ld\n"
-+ "origtime=%jd\n"
- "category=%s\n"
- "msg_id=%s\n"
- "flag=\n" /* flags not supported in copy from file yet */
-@@ -6337,7 +6337,7 @@ static int msg_create_from_file(struct a
- recdata->call_priority,
- S_OR(recdata->call_callerchan, "Unknown"),
- S_OR(recdata->call_callerid, "Unknown"),
-- date, (long) time(NULL),
-+ date, (intmax_t) time(NULL),
- S_OR(category, ""),
- msg_id,
- duration);
-@@ -6859,7 +6859,7 @@ static int leave_voicemail(struct ast_ch
- /* Store information in real-time storage */
- if (ast_check_realtime("voicemail_data")) {
- snprintf(priority, sizeof(priority), "%d", ast_channel_priority(chan));
-- snprintf(origtime, sizeof(origtime), "%ld", (long) time(NULL));
-+ snprintf(origtime, sizeof(origtime), "%jd", (intmax_t) time(NULL));
- get_date(date, sizeof(date));
- ast_callerid_merge(callerid, sizeof(callerid),
- S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, NULL),
-@@ -6903,7 +6903,7 @@ static int leave_voicemail(struct ast_ch
- "callerchan=%s\n"
- "callerid=%s\n"
- "origdate=%s\n"
-- "origtime=%ld\n"
-+ "origtime=%jd\n"
- "category=%s\n"
- "msg_id=%s\n",
- ext,
-@@ -6915,7 +6915,7 @@ static int leave_voicemail(struct ast_ch
- ast_channel_priority(chan),
- ast_channel_name(chan),
- callerid,
-- date, (long) time(NULL),
-+ date, (intmax_t) time(NULL),
- category ? category : "",
- msg_id);
- } else {
-@@ -11456,7 +11456,7 @@ static int vm_execmain(struct ast_channe
- play_auto = 1;
- if (!ast_strlen_zero(opts[OPT_ARG_PLAYFOLDER])) {
- /* See if it is a folder name first */
-- if (isdigit(opts[OPT_ARG_PLAYFOLDER][0])) {
-+ if (isdigit((unsigned char)opts[OPT_ARG_PLAYFOLDER][0])) {
- if (sscanf(opts[OPT_ARG_PLAYFOLDER], "%30d", &play_folder) != 1) {
- play_folder = -1;
- }
diff --git a/comms/asterisk15/patches/patch-build__tools_mkpkgconfig b/comms/asterisk15/patches/patch-build__tools_mkpkgconfig
deleted file mode 100644
index 49e1e31bae4..00000000000
--- a/comms/asterisk15/patches/patch-build__tools_mkpkgconfig
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-build__tools_mkpkgconfig,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- build_tools/mkpkgconfig.orig 2015-10-09 21:48:48.000000000 +0000
-+++ build_tools/mkpkgconfig
-@@ -22,11 +22,14 @@ else
- fi
-
- ## Clean out CFLAGS for the spec file.
-+## pkgsrc -- the regex below isn't sed compatible, so always use perl
-+EXTREGEX="perl -pe"
- LOCAL_CFLAGS=`echo $CFLAGS | ${EXTREGEX} 's/-pipe\s*//g' | ${EXTREGEX} 's/-[Wmp]\S*\s*//g' | \
- ${EXTREGEX} 's/\s+-I(include|\.\.\/include)\s+/ /g' | \
- ${EXTREGEX} 's/-DINSTALL_PREFIX=\S* //g' | \
- ${EXTREGEX} 's/-DASTERISK_VERSION=\S* //g' | \
- ${EXTREGEX} 's/-DAST(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR)=\S* //g' | \
-+ ${EXTREGEX} "s;${WRKSRC};${PREFIX};g" | \
- ${EXTREGEX} 's/^\s|\s$//g'`
-
- cat <<EOF > "$PPATH/asterisk.pc"
diff --git a/comms/asterisk15/patches/patch-cdr_cdr__pgsql.c b/comms/asterisk15/patches/patch-cdr_cdr__pgsql.c
deleted file mode 100644
index afe38ba2c3d..00000000000
--- a/comms/asterisk15/patches/patch-cdr_cdr__pgsql.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-cdr_cdr__pgsql.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- cdr/cdr_pgsql.c.orig 2016-09-30 20:36:17.000000000 +0000
-+++ cdr/cdr_pgsql.c
-@@ -270,7 +270,7 @@ static int pgsql_log(struct ast_cdr *cdr
- if (strcmp(cur->name, "start") == 0 || strcmp(cur->name, "calldate") == 0) {
- if (strncmp(cur->type, "int", 3) == 0) {
- LENGTHEN_BUF2(13);
-- ast_str_append(&sql2, 0, "%s%ld", separator, (long) cdr->start.tv_sec);
-+ ast_str_append(&sql2, 0, "%s%jd", separator, (intmax_t) cdr->start.tv_sec);
- } else if (strncmp(cur->type, "float", 5) == 0) {
- LENGTHEN_BUF2(31);
- ast_str_append(&sql2, 0, "%s%f", separator, (double)cdr->start.tv_sec + (double)cdr->start.tv_usec / 1000000.0);
-@@ -284,7 +284,7 @@ static int pgsql_log(struct ast_cdr *cdr
- } else if (strcmp(cur->name, "answer") == 0) {
- if (strncmp(cur->type, "int", 3) == 0) {
- LENGTHEN_BUF2(13);
-- ast_str_append(&sql2, 0, "%s%ld", separator, (long) cdr->answer.tv_sec);
-+ ast_str_append(&sql2, 0, "%s%jd", separator, (intmax_t) cdr->answer.tv_sec);
- } else if (strncmp(cur->type, "float", 5) == 0) {
- LENGTHEN_BUF2(31);
- ast_str_append(&sql2, 0, "%s%f", separator, (double)cdr->answer.tv_sec + (double)cdr->answer.tv_usec / 1000000.0);
-@@ -298,7 +298,7 @@ static int pgsql_log(struct ast_cdr *cdr
- } else if (strcmp(cur->name, "end") == 0) {
- if (strncmp(cur->type, "int", 3) == 0) {
- LENGTHEN_BUF2(13);
-- ast_str_append(&sql2, 0, "%s%ld", separator, (long) cdr->end.tv_sec);
-+ ast_str_append(&sql2, 0, "%s%jd", separator, (intmax_t) cdr->end.tv_sec);
- } else if (strncmp(cur->type, "float", 5) == 0) {
- LENGTHEN_BUF2(31);
- ast_str_append(&sql2, 0, "%s%f", separator, (double)cdr->end.tv_sec + (double)cdr->end.tv_usec / 1000000.0);
diff --git a/comms/asterisk15/patches/patch-cel_cel__pgsql.c b/comms/asterisk15/patches/patch-cel_cel__pgsql.c
deleted file mode 100644
index 201c96f6741..00000000000
--- a/comms/asterisk15/patches/patch-cel_cel__pgsql.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-cel_cel__pgsql.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- cel/cel_pgsql.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ cel/cel_pgsql.c
-@@ -205,7 +205,7 @@ static void pgsql_log(struct ast_event *
- if (strcmp(cur->name, "eventtime") == 0) {
- if (strncmp(cur->type, "int", 3) == 0) {
- LENGTHEN_BUF2(13);
-- ast_str_append(&sql2, 0, "%s%ld", SEP, (long) record.event_time.tv_sec);
-+ ast_str_append(&sql2, 0, "%s%jd", SEP, (intmax_t) record.event_time.tv_sec);
- } else if (strncmp(cur->type, "float", 5) == 0) {
- LENGTHEN_BUF2(31);
- ast_str_append(&sql2, 0, "%s%f",
diff --git a/comms/asterisk15/patches/patch-channels_chan__pjsip.c b/comms/asterisk15/patches/patch-channels_chan__pjsip.c
deleted file mode 100644
index 14fe08aeace..00000000000
--- a/comms/asterisk15/patches/patch-channels_chan__pjsip.c
+++ /dev/null
@@ -1,32 +0,0 @@
-$NetBSD: patch-channels_chan__pjsip.c,v 1.2 2021/01/17 08:32:40 jnemeth Exp $
-
---- channels/chan_pjsip.c.orig 2019-09-05 13:09:20.000000000 +0000
-+++ channels/chan_pjsip.c
-@@ -34,10 +34,6 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjsip_ua.h>
--#include <pjlib.h>
--
- #include "asterisk/lock.h"
- #include "asterisk/channel.h"
- #include "asterisk/module.h"
-@@ -63,10 +59,14 @@
- #include "asterisk/test.h"
- #include "asterisk/message.h"
-
--#include "asterisk/res_pjsip.h"
--#include "asterisk/res_pjsip_session.h"
- #include "asterisk/stream.h"
-
-+#include <pjsip.h>
-+#include <pjsip_ua.h>
-+#include <pjlib.h>
-+
-+#include "asterisk/res_pjsip.h"
-+#include "asterisk/res_pjsip_session.h"
- #include "pjsip/include/chan_pjsip.h"
- #include "pjsip/include/dialplan_functions.h"
- #include "pjsip/include/cli_functions.h"
diff --git a/comms/asterisk15/patches/patch-channels_chan__sip.c b/comms/asterisk15/patches/patch-channels_chan__sip.c
deleted file mode 100644
index e977c8e6d38..00000000000
--- a/comms/asterisk15/patches/patch-channels_chan__sip.c
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-channels_chan__sip.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- channels/chan_sip.c.orig 2018-05-01 20:12:26.000000000 +0000
-+++ channels/chan_sip.c
-@@ -2411,7 +2411,7 @@ static int sip_is_token(const char *str)
-
- is_token = 1;
- do {
-- if (!isalnum(*str)
-+ if (!isalnum((unsigned char)*str)
- && !strchr("-.!%*_+`'~", *str)) {
- /* The character is not allowed in a token. */
- is_token = 0;
-@@ -11624,7 +11624,7 @@ static int process_sdp_a_image(const cha
- * code reviews).
- */
- for (pos = attrib; *pos; ++pos) {
-- *pos = tolower(*pos);
-+ *pos = tolower((unsigned char)*pos);
- }
-
- if ((sscanf(attrib, "t38faxmaxbuffer:%30u", &x) == 1)) {
-@@ -20014,7 +20014,7 @@ static int manager_show_registry(struct
- "DomainPort: %d\r\n"
- "Refresh: %d\r\n"
- "State: %s\r\n"
-- "RegistrationTime: %ld\r\n"
-+ "RegistrationTime: %jd\r\n"
- "\r\n",
- idtext,
- iterator->hostname,
-@@ -20024,7 +20024,7 @@ static int manager_show_registry(struct
- iterator->regdomainport ? iterator->regdomainport : STANDARD_SIP_PORT,
- iterator->refresh,
- regstate2str(iterator->regstate),
-- (long) iterator->regtime.tv_sec);
-+ (intmax_t) iterator->regtime.tv_sec);
-
- ao2_unlock(iterator);
- ao2_t_ref(iterator, -1, "manager_show_registry iter");
diff --git a/comms/asterisk15/patches/patch-channels_pjsip_cli__commands.c b/comms/asterisk15/patches/patch-channels_pjsip_cli__commands.c
deleted file mode 100644
index 3a3fb965a3a..00000000000
--- a/comms/asterisk15/patches/patch-channels_pjsip_cli__commands.c
+++ /dev/null
@@ -1,33 +0,0 @@
-$NetBSD: patch-channels_pjsip_cli__commands.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- channels/pjsip/cli_commands.c.orig 2018-06-20 14:37:54.485779459 +0000
-+++ channels/pjsip/cli_commands.c
-@@ -26,20 +26,21 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/astobj2.h"
-+#include "asterisk/channel.h"
-+#include "asterisk/format.h"
-+#include "asterisk/stasis.h"
-+#include "asterisk/time.h"
-+#include "include/cli_functions.h"
-+
- #include <pjsip.h>
- #include <pjlib.h>
- #include <pjsip_ua.h>
-
--#include "asterisk/astobj2.h"
--#include "asterisk/channel.h"
--#include "asterisk/format.h"
-+#include "include/chan_pjsip.h"
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
- #include "asterisk/res_pjsip_cli.h"
--#include "asterisk/stasis.h"
--#include "asterisk/time.h"
--#include "include/chan_pjsip.h"
--#include "include/cli_functions.h"
-
-
- static int cli_channel_iterate(void *endpoint, ao2_callback_fn callback, void *arg)
diff --git a/comms/asterisk15/patches/patch-channels_pjsip_dialplan__functions.c b/comms/asterisk15/patches/patch-channels_pjsip_dialplan__functions.c
deleted file mode 100644
index 7af00d1633d..00000000000
--- a/comms/asterisk15/patches/patch-channels_pjsip_dialplan__functions.c
+++ /dev/null
@@ -1,32 +0,0 @@
-$NetBSD: patch-channels_pjsip_dialplan__functions.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- channels/pjsip/dialplan_functions.c.orig 2018-06-20 14:39:31.934736437 +0000
-+++ channels/pjsip/dialplan_functions.c
-@@ -450,10 +450,6 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjlib.h>
--#include <pjsip_ua.h>
--
- #include "asterisk/astobj2.h"
- #include "asterisk/module.h"
- #include "asterisk/acl.h"
-@@ -463,10 +459,15 @@
- #include "asterisk/format.h"
- #include "asterisk/dsp.h"
- #include "asterisk/pbx.h"
-+#include "include/dialplan_functions.h"
-+
-+#include <pjsip.h>
-+#include <pjlib.h>
-+#include <pjsip_ua.h>
-+
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
- #include "include/chan_pjsip.h"
--#include "include/dialplan_functions.h"
-
- /*!
- * \brief String representations of the T.38 state enum
diff --git a/comms/asterisk15/patches/patch-configure b/comms/asterisk15/patches/patch-configure
deleted file mode 100644
index 3a1c8d15a81..00000000000
--- a/comms/asterisk15/patches/patch-configure
+++ /dev/null
@@ -1,204 +0,0 @@
-$NetBSD: patch-configure,v 1.2 2021/01/17 08:32:40 jnemeth Exp $
-
---- configure.orig 2019-09-05 13:09:20.000000000 +0000
-+++ configure
-@@ -9127,12 +9127,12 @@ else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang -fblocks" >&5
- $as_echo_n "checking for clang -fblocks... " >&6; }
-- if test "`echo 'int main(){return ^{return 42;}();}' | ${CC} -o /dev/null -fblocks -x c - 2>&1`" = ""; then
-+ if test "`echo 'int main(){return ^{return 42;}();}' | ${CC} ${LDFLAGS} -o /dev/null -fblocks -x c - 2>&1`" = ""; then
- AST_CLANG_BLOCKS_LIBS=""
- AST_CLANG_BLOCKS="-Wno-unknown-warning-option -fblocks"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
- $as_echo "yes" >&6; }
-- elif test "`echo 'int main(){return ^{return 42;}();}' | ${CC} -o /dev/null -fblocks -x c -lBlocksRuntime - 2>&1`" = ""; then
-+ elif test "`echo 'int main(){return ^{return 42;}();}' | ${CC} ${LDFLAGS} -o /dev/null -fblocks -x c -lBlocksRuntime - 2>&1`" = ""; then
- AST_CLANG_BLOCKS_LIBS="-lBlocksRuntime"
- AST_CLANG_BLOCKS="-fblocks"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-@@ -15352,7 +15352,7 @@ fi
- done
-
-
--ac_fn_c_check_header_mongrel "$LINENO" "sys/poll.h" "ac_cv_header_sys_poll_h" "$ac_includes_default"
-+ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_sys_poll_h" "$ac_includes_default"
- if test "x$ac_cv_header_sys_poll_h" = xyes; then :
-
- else
-@@ -17367,7 +17367,7 @@ fi
- done
-
-
--for ac_func in asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv uselocale utime vasprintf getpeereid sysctl swapctl
-+for ac_func in asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strftime_l strlcat strlcpy strncasecmp strndup strnlen strptime_l strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv uselocale utime vasprintf getpeereid sysctl swapctl
- do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
- ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-@@ -17602,7 +17602,7 @@ rm -f core conftest.err conftest.$ac_obj
- LDFLAGS=${old_LDFLAGS}
- rm -f conftest.dynamics
-
--ac_fn_c_check_header_mongrel "$LINENO" "sys/poll.h" "ac_cv_header_sys_poll_h" "$ac_includes_default"
-+ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_sys_poll_h" "$ac_includes_default"
- if test "x$ac_cv_header_sys_poll_h" = xyes; then :
- HAS_POLL=1
-
-@@ -19813,6 +19813,148 @@ fi
-
-
-
-+if test "${ac_cv_header_sys_atomic_h+set}" = set; then
-+ { $as_echo "$as_me:$LINENO: checking for sys/atomic.h" >&5
-+$as_echo_n "checking for sys/atomic.h... " >&6; }
-+if test "${ac_cv_header_sys_atomic_h+set}" = set; then
-+ $as_echo_n "(cached) " >&6
-+fi
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_atomic_h" >&5
-+$as_echo "$ac_cv_header_sys_atomic_h" >&6; }
-+else
-+ # Is the header compilable?
-+{ $as_echo "$as_me:$LINENO: checking sys/atomic.h usability" >&5
-+$as_echo_n "checking sys/atomic.h usability... " >&6; }
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h. */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h. */
-+$ac_includes_default
-+#include <sys/atomic.h>
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (ac_try="$ac_compile"
-+case "(($ac_try" in
-+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+ *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+ (eval "$ac_compile") 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } && {
-+ test -z "$ac_c_werror_flag" ||
-+ test ! -s conftest.err
-+ } && test -s conftest.$ac_objext; then
-+ ac_header_compiler=yes
-+else
-+ $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ ac_header_compiler=no
-+fi
-+
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-+$as_echo "$ac_header_compiler" >&6; }
-+
-+# Is the header present?
-+{ $as_echo "$as_me:$LINENO: checking sys/atomic.h presence" >&5
-+$as_echo_n "checking sys/atomic.h presence... " >&6; }
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h. */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h. */
-+#include <sys/atomic.h>
-+_ACEOF
-+if { (ac_try="$ac_cpp conftest.$ac_ext"
-+case "(($ac_try" in
-+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+ *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } >/dev/null && {
-+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-+ test ! -s conftest.err
-+ }; then
-+ ac_header_preproc=yes
-+else
-+ $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ ac_header_preproc=no
-+fi
-+
-+rm -f conftest.err conftest.$ac_ext
-+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-+$as_echo "$ac_header_preproc" >&6; }
-+
-+# So? What about this header?
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+ yes:no: )
-+ { $as_echo "$as_me:$LINENO: WARNING: sys/atomic.h: accepted by the compiler, rejected by the preprocessor!" >&5
-+$as_echo "$as_me: WARNING: sys/atomic.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-+ { $as_echo "$as_me:$LINENO: WARNING: sys/atomic.h: proceeding with the compiler's result" >&5
-+$as_echo "$as_me: WARNING: sys/atomic.h: proceeding with the compiler's result" >&2;}
-+ ac_header_preproc=yes
-+ ;;
-+ no:yes:* )
-+ { $as_echo "$as_me:$LINENO: WARNING: sys/atomic.h: present but cannot be compiled" >&5
-+$as_echo "$as_me: WARNING: sys/atomic.h: present but cannot be compiled" >&2;}
-+ { $as_echo "$as_me:$LINENO: WARNING: sys/atomic.h: check for missing prerequisite headers?" >&5
-+$as_echo "$as_me: WARNING: sys/atomic.h: check for missing prerequisite headers?" >&2;}
-+ { $as_echo "$as_me:$LINENO: WARNING: sys/atomic.h: see the Autoconf documentation" >&5
-+$as_echo "$as_me: WARNING: sys/atomic.h: see the Autoconf documentation" >&2;}
-+ { $as_echo "$as_me:$LINENO: WARNING: sys/atomic.h: section \"Present But Cannot Be Compiled\"" >&5
-+$as_echo "$as_me: WARNING: sys/atomic.h: section \"Present But Cannot Be Compiled\"" >&2;}
-+ { $as_echo "$as_me:$LINENO: WARNING: sys/atomic.h: proceeding with the preprocessor's result" >&5
-+$as_echo "$as_me: WARNING: sys/atomic.h: proceeding with the preprocessor's result" >&2;}
-+ { $as_echo "$as_me:$LINENO: WARNING: sys/atomic.h: in the future, the compiler will take precedence" >&5
-+$as_echo "$as_me: WARNING: sys/atomic.h: in the future, the compiler will take precedence" >&2;}
-+ ( cat <<\_ASBOX
-+## ------------------------------------------ ##
-+## Report this to https://issues.asterisk.org ##
-+## ------------------------------------------ ##
-+_ASBOX
-+ ) | sed "s/^/$as_me: WARNING: /" >&2
-+ ;;
-+esac
-+{ $as_echo "$as_me:$LINENO: checking for sys/atomic.h" >&5
-+$as_echo_n "checking for sys/atomic.h... " >&6; }
-+if test "${ac_cv_header_sys_atomic_h+set}" = set; then
-+ $as_echo_n "(cached) " >&6
-+else
-+ ac_cv_header_sys_atomic_h=$ac_header_preproc
-+fi
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_atomic_h" >&5
-+$as_echo "$ac_cv_header_sys_atomic_h" >&6; }
-+
-+fi
-+if test "x$ac_cv_header_sys_atomic_h" = x""yes; then
-+
-+cat >>confdefs.h <<_ACEOF
-+#define HAVE_SYS_ATOMIC_H 1
-+_ACEOF
-+
-+fi
-+
-+
-+
- # The cast to long int works around a bug in the HP C Compiler
- # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
- # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-@@ -20917,6 +21059,8 @@ $as_echo_n "checking for getifaddrs() su
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-+ #include <sys/types.h>
-+ #include <sys/socket.h>
- #include <ifaddrs.h>
- int
- main ()
diff --git a/comms/asterisk15/patches/patch-configure.ac b/comms/asterisk15/patches/patch-configure.ac
deleted file mode 100644
index 80734a897f3..00000000000
--- a/comms/asterisk15/patches/patch-configure.ac
+++ /dev/null
@@ -1,44 +0,0 @@
-$NetBSD: patch-configure.ac,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- configure.ac.orig 2018-05-01 20:12:26.000000000 +0000
-+++ configure.ac
-@@ -745,7 +745,7 @@ AC_CHECK_HEADERS([xlocale.h])
-
- AC_CHECK_HEADERS([winsock.h winsock2.h])
-
--AC_CHECK_HEADER([sys/poll.h],
-+AC_CHECK_HEADER([poll.h],
- [],
- AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.]))
-
-@@ -797,7 +797,7 @@ AC_FUNC_STRNLEN
- AC_FUNC_STRTOD
- AC_FUNC_UTIME_NULL
- AC_FUNC_VPRINTF
--AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv uselocale utime vasprintf getpeereid sysctl swapctl])
-+AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strftime_l strlcat strlcpy strptime_l strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv uselocale utime vasprintf getpeereid sysctl swapctl])
-
- AC_MSG_CHECKING(for htonll)
- AC_LINK_IFELSE(
-@@ -866,9 +866,9 @@ AC_SUBST(PBX_DYNAMIC_LIST)
- LDFLAGS=${old_LDFLAGS}
- rm -f conftest.dynamics
-
--AC_CHECK_HEADER([sys/poll.h],
-+AC_CHECK_HEADER([poll.h],
- [HAS_POLL=1]
-- AC_DEFINE([HAVE_SYS_POLL_H], 1, [Define to 1 if your system has working sys/poll.h]),
-+ AC_DEFINE([HAVE_SYS_POLL_H], 1, [Define to 1 if your system has working poll.h]),
- )
-
- AC_ARG_ENABLE([internal-poll],
-@@ -1444,6 +1444,9 @@ AST_C_DEFINE_CHECK([IP_MTU_DISCOVER], [I
- AC_CHECK_HEADER([libkern/OSAtomic.h],
- [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
-
-+AC_CHECK_HEADER([sys/atomic.h],
-+ [AC_DEFINE_UNQUOTED([HAVE_SYS_ATOMIC_H], 1, [Define to 1 if sys/atomic.h atomic operations are supported.])])
-+
- AC_CHECK_SIZEOF([int])
- AC_CHECK_SIZEOF([long])
- AC_CHECK_SIZEOF([long long])
diff --git a/comms/asterisk15/patches/patch-contrib_scripts_vmail.cgi b/comms/asterisk15/patches/patch-contrib_scripts_vmail.cgi
deleted file mode 100644
index 3b9c7a0823f..00000000000
--- a/comms/asterisk15/patches/patch-contrib_scripts_vmail.cgi
+++ /dev/null
@@ -1,181 +0,0 @@
-$NetBSD: patch-contrib_scripts_vmail.cgi,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- contrib/scripts/vmail.cgi.orig 2015-10-09 21:48:48.000000000 +0000
-+++ contrib/scripts/vmail.cgi
-@@ -145,7 +145,7 @@ sub check_login($$)
- $context = "default";
- }
- if (!$filename) {
-- $filename = "/etc/asterisk/voicemail.conf";
-+ $filename = "@ASTETCDIR@/voicemail.conf";
- }
- # print header;
- # print "Including <h2>$filename</h2> while in <h2>$category</h2>...\n";
-@@ -153,7 +153,7 @@ sub check_login($$)
- while(<VMAIL>) {
- chomp;
- if (/include\s\"([^\"]+)\"$/) {
-- ($tmp, $category) = &check_login("/etc/asterisk/$1", $category);
-+ ($tmp, $category) = &check_login("@ASTETCDIR@/$1", $category);
- if (length($tmp)) {
- # print "Got '$tmp'\n";
- return ($tmp, $category);
-@@ -200,7 +200,7 @@ sub check_login_users {
- my ($mbox, $context) = split(/\@/, param('mailbox'));
- my $pass = param('password');
- my ($found, $fullname) = (0, "");
-- open VMAIL, "</etc/asterisk/users.conf";
-+ open VMAIL, "<@ASTETCDIR@/users.conf";
- while (<VMAIL>) {
- chomp;
- if (m/\[(.*)\]/) {
-@@ -242,7 +242,7 @@ sub validmailbox($$$$)
- $context = "default";
- }
- if (!$filename) {
-- $filename = "/etc/asterisk/voicemail.conf";
-+ $filename = "@ASTETCDIR@/voicemail.conf";
- }
- if (!$category) {
- $category = "general";
-@@ -251,7 +251,7 @@ sub validmailbox($$$$)
- while (<VMAIL>) {
- chomp;
- if (/include\s\"([^\"]+)\"$/) {
-- ($tmp, $category) = &validmailbox($mbox, $context, "/etc/asterisk/$1");
-+ ($tmp, $category) = &validmailbox($mbox, $context, "@ASTETCDIR@/$1");
- if ($tmp) {
- return ($tmp, $category);
- }
-@@ -298,7 +298,7 @@ sub mailbox_options()
- local $tmp2;
- local $tmp;
- if (!$filename) {
-- $filename = "/etc/asterisk/voicemail.conf";
-+ $filename = "@ASTETCDIR@/voicemail.conf";
- }
- if (!$category) {
- $category = "general";
-@@ -386,7 +386,7 @@ sub mailbox_list()
- sub msgcount()
- {
- my ($context, $mailbox, $folder) = @_;
-- my $path = "/var/spool/asterisk/voicemail/$context/$mailbox/$folder";
-+ my $path = "@ASTSPOOLDIR@/voicemail/$context/$mailbox/$folder";
- if (opendir(DIR, $path)) {
- my @msgs = grep(/^msg....\.txt$/, readdir(DIR));
- closedir(DIR);
-@@ -410,7 +410,7 @@ sub msgcountstr()
- sub messages()
- {
- my ($context, $mailbox, $folder) = @_;
-- my $path = "/var/spool/asterisk/voicemail/$context/$mailbox/$folder";
-+ my $path = "@ASTSPOOLDIR@/voicemail/$context/$mailbox/$folder";
- if (opendir(DIR, $path)) {
- my @msgs = sort grep(/^msg....\.txt$/, readdir(DIR));
- closedir(DIR);
-@@ -435,7 +435,7 @@ sub getfields()
- {
- my ($context, $mailbox, $folder, $msg) = @_;
- my $fields;
-- if (open(MSG, "</var/spool/asterisk/voicemail/$context/$mailbox/$folder/msg${msg}.txt")) {
-+ if (open(MSG, "<@ASTSPOOLDIR@/voicemail/$context/$mailbox/$folder/msg${msg}.txt")) {
- while(<MSG>) {
- s/\#.*$//g;
- if (/^(\w+)\s*\=\s*(.*)$/) {
-@@ -560,7 +560,7 @@ _EOH
- <input name="action" type=submit value="download">
- </td></tr>
- <tr><td colspan=2 align=center>
--<embed width=400 height=40 src="vmail.cgi?action=audio&folder=$folder&mailbox=$mbox&context=$context&password=$passwd&msgid=$msgid&format=$format&dontcasheme=$$.$format" autostart=yes loop=false></embed>
-+<embed width=400 height=40 src="vmail?action=audio&folder=$folder&mailbox=$mbox&context=$context&password=$passwd&msgid=$msgid&format=$format&dontcasheme=$$.$format" autostart=yes loop=false></embed>
- </td></tr></table>
- </td></tr>
- </table>
-@@ -588,7 +588,7 @@ sub message_audio()
- }
- &untaint($format);
-
-- my $path = "/var/spool/asterisk/voicemail/$context/$mailbox/$folder/msg${msgid}.$format";
-+ my $path = "@ASTSPOOLDIR@/voicemail/$context/$mailbox/$folder/msg${msgid}.$format";
-
- $msgid =~ /^\d\d\d\d$/ || die("Msgid Liar ($msgid)!");
- grep(/^${format}$/, keys %formats) || die("Format Liar ($format)!");
-@@ -809,11 +809,11 @@ sub message_rename()
- die("Invalid old Message<BR>\n");
- }
-
-- my $path = "/var/spool/asterisk/voicemail/$context/$mbox/$newfolder";
-+ my $path = "@ASTSPOOLDIR@/voicemail/$context/$mbox/$newfolder";
- $path =~ /^(.*)$/;
- $path = $1;
- mkdir $path, 0770;
-- $path = "/var/spool/asterisk/voicemail/$context/$mbox/$oldfolder";
-+ $path = "@ASTSPOOLDIR@/voicemail/$context/$mbox/$oldfolder";
- opendir(DIR, $path) || die("Unable to open directory\n");
- my @files = grep /^msg${old}\.\w+$/, readdir(DIR);
- closedir(DIR);
-@@ -823,7 +823,7 @@ sub message_rename()
- $tmp = $1;
- $oldfile = $path . "/$tmp";
- $tmp =~ s/msg${old}/msg${new}/;
-- $newfile = "/var/spool/asterisk/voicemail/$context/$mbox/$newfolder/$tmp";
-+ $newfile = "@ASTSPOOLDIR@/voicemail/$context/$mbox/$newfolder/$tmp";
- # print "Renaming $oldfile to $newfile<BR>\n";
- rename($oldfile, $newfile);
- }
-@@ -884,15 +884,15 @@ sub message_copy()
- die("Invalid old Message<BR>\n");
- }
-
-- my $path = "/var/spool/asterisk/voicemail/$context/$newmbox";
-+ my $path = "@ASTSPOOLDIR@/voicemail/$context/$newmbox";
- $path =~ /^(.*)$/;
- $path = $1;
- mkdir $path, 0770;
-- $path = "/var/spool/asterisk/voicemail/$context/$newmbox/INBOX";
-+ $path = "@ASTSPOOLDIR@/voicemail/$context/$newmbox/INBOX";
- $path =~ /^(.*)$/;
- $path = $1;
- mkdir $path, 0770;
-- $path = "/var/spool/asterisk/voicemail/$context/$mbox/$oldfolder";
-+ $path = "@ASTSPOOLDIR@/voicemail/$context/$mbox/$oldfolder";
- opendir(DIR, $path) || die("Unable to open directory\n");
- my @files = grep /^msg${old}\.\w+$/, readdir(DIR);
- closedir(DIR);
-@@ -902,7 +902,7 @@ sub message_copy()
- $tmp = $1;
- $oldfile = $path . "/$tmp";
- $tmp =~ s/msg${old}/msg${new}/;
-- $newfile = "/var/spool/asterisk/voicemail/$context/$newmbox/INBOX/$tmp";
-+ $newfile = "@ASTSPOOLDIR@/voicemail/$context/$newmbox/INBOX/$tmp";
- # print "Copying $oldfile to $newfile<BR>\n";
- &file_copy($oldfile, $newfile);
- }
-@@ -932,7 +932,7 @@ sub message_delete()
- } else {
- die("Invalid Message<BR>\n");
- }
-- my $path = "/var/spool/asterisk/voicemail/$context/$mbox/$folder";
-+ my $path = "@ASTSPOOLDIR@/voicemail/$context/$mbox/$folder";
- opendir(DIR, $path) || die("Unable to open directory\n");
- my @files = grep /^msg${msg}\.\w+$/, readdir(DIR);
- closedir(DIR);
-@@ -968,7 +968,7 @@ sub message_forward()
- my $txt;
- $context = &untaint($context);
- $newmbox = &untaint($newmbox);
-- my $path = "/var/spool/asterisk/voicemail/$context/$newmbox/INBOX";
-+ my $path = "@ASTSPOOLDIR@/voicemail/$context/$newmbox/INBOX";
- if ($msgs[0]) {
- if (&lock_path($path) == 0) {
- $msgcount = &msgcount($context, $newmbox, "INBOX");
-@@ -1018,7 +1018,7 @@ sub message_delete_or_move()
- $context = &untaint($context);
- $mbox = &untaint($mbox);
- $folder = &untaint($folder);
-- $path = "/var/spool/asterisk/voicemail/$context/$mbox/$folder";
-+ $path = "@ASTSPOOLDIR@/voicemail/$context/$mbox/$folder";
- if ($msgs[0]) {
- if (&lock_path($path) == 0) {
- my $msgcount = &msgcount($context, $mbox, $folder);
diff --git a/comms/asterisk15/patches/patch-funcs_func__cdr.c b/comms/asterisk15/patches/patch-funcs_func__cdr.c
deleted file mode 100644
index 348caf0bcca..00000000000
--- a/comms/asterisk15/patches/patch-funcs_func__cdr.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-funcs_func__cdr.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- funcs/func_cdr.c.orig 2018-05-07 17:23:06.705808560 +0000
-+++ funcs/func_cdr.c
-@@ -547,7 +547,7 @@ static int cdr_write(struct ast_channel
-
- ast_log(LOG_WARNING, "Using the %s function to set 'amaflags' is deprecated. Please use the CHANNEL function instead.\n",
- cmd);
-- if (isdigit(*value)) {
-+ if (isdigit((unsigned char)*value)) {
- if (sscanf(value, "%30d", &amaflags) != 1) {
- amaflags = AST_AMA_NONE;
- }
diff --git a/comms/asterisk15/patches/patch-funcs_func__channel.c b/comms/asterisk15/patches/patch-funcs_func__channel.c
deleted file mode 100644
index 0454425c9ca..00000000000
--- a/comms/asterisk15/patches/patch-funcs_func__channel.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-funcs_func__channel.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- funcs/func_channel.c.orig 2018-05-07 17:22:10.785599288 +0000
-+++ funcs/func_channel.c
-@@ -492,7 +492,7 @@ static int func_channel_write_real(struc
- } else if (!strcasecmp(data, "amaflags")) {
- int amaflags;
-
-- if (isdigit(*value)) {
-+ if (isdigit((unsigned char)*value)) {
- if (sscanf(value, "%30d", &amaflags) != 1) {
- amaflags = AST_AMA_NONE;
- }
diff --git a/comms/asterisk15/patches/patch-funcs_func__env.c b/comms/asterisk15/patches/patch-funcs_func__env.c
deleted file mode 100644
index b5c99e6ac3d..00000000000
--- a/comms/asterisk15/patches/patch-funcs_func__env.c
+++ /dev/null
@@ -1,49 +0,0 @@
-$NetBSD: patch-funcs_func__env.c,v 1.2 2021/01/17 08:32:40 jnemeth Exp $
-
---- funcs/func_env.c.orig 2019-09-05 13:09:20.000000000 +0000
-+++ funcs/func_env.c
-@@ -408,11 +408,11 @@ static int file_count_line(struct ast_ch
-
- AST_STANDARD_APP_ARGS(args, data);
- if (args.argc > 1) {
-- if (tolower(args.format[0]) == 'd') {
-+ if (tolower((unsigned char)args.format[0]) == 'd') {
- newline_format = FF_DOS;
-- } else if (tolower(args.format[0]) == 'm') {
-+ } else if (tolower((unsigned char)args.format[0]) == 'm') {
- newline_format = FF_MAC;
-- } else if (tolower(args.format[0]) == 'u') {
-+ } else if (tolower((unsigned char)args.format[0]) == 'u') {
- newline_format = FF_UNIX;
- }
- }
-@@ -570,11 +570,11 @@ static int file_read(struct ast_channel
-
- /* Line-based read */
- if (args.argc == 5) {
-- if (tolower(args.fileformat[0]) == 'd') {
-+ if (tolower((unsigned char)args.fileformat[0]) == 'd') {
- format = FF_DOS;
-- } else if (tolower(args.fileformat[0]) == 'm') {
-+ } else if (tolower((unsigned char)args.fileformat[0]) == 'm') {
- format = FF_MAC;
-- } else if (tolower(args.fileformat[0]) == 'u') {
-+ } else if (tolower((unsigned char)args.fileformat[0]) == 'u') {
- format = FF_UNIX;
- }
- }
-@@ -935,11 +935,11 @@ static int file_write(struct ast_channel
-
- /* Line mode */
- if (args.argc == 5) {
-- if (tolower(args.format[0]) == 'u') {
-+ if (tolower((unsigned char)args.format[0]) == 'u') {
- newline_format = FF_UNIX;
-- } else if (tolower(args.format[0]) == 'm') {
-+ } else if (tolower((unsigned char)args.format[0]) == 'm') {
- newline_format = FF_MAC;
-- } else if (tolower(args.format[0]) == 'd') {
-+ } else if (tolower((unsigned char)args.format[0]) == 'd') {
- newline_format = FF_DOS;
- }
- }
diff --git a/comms/asterisk15/patches/patch-funcs_func__pjsip__aor.c b/comms/asterisk15/patches/patch-funcs_func__pjsip__aor.c
deleted file mode 100644
index 339be81dd98..00000000000
--- a/comms/asterisk15/patches/patch-funcs_func__pjsip__aor.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-funcs_func__pjsip__aor.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- funcs/func_pjsip_aor.c.orig 2018-06-20 14:41:48.304859278 +0000
-+++ funcs/func_pjsip_aor.c
-@@ -34,13 +34,14 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjlib.h>
--
- #include "asterisk/app.h"
- #include "asterisk/pbx.h"
- #include "asterisk/module.h"
- #include "asterisk/sorcery.h"
-+
-+#include <pjsip.h>
-+#include <pjlib.h>
-+
- #include "asterisk/res_pjsip.h"
-
- /*** DOCUMENTATION
diff --git a/comms/asterisk15/patches/patch-funcs_func__pjsip__contact.c b/comms/asterisk15/patches/patch-funcs_func__pjsip__contact.c
deleted file mode 100644
index 9d99d90ec20..00000000000
--- a/comms/asterisk15/patches/patch-funcs_func__pjsip__contact.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-funcs_func__pjsip__contact.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- funcs/func_pjsip_contact.c.orig 2018-06-20 14:41:26.963425573 +0000
-+++ funcs/func_pjsip_contact.c
-@@ -34,13 +34,14 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjlib.h>
--
- #include "asterisk/app.h"
- #include "asterisk/pbx.h"
- #include "asterisk/module.h"
- #include "asterisk/sorcery.h"
-+
-+#include <pjsip.h>
-+#include <pjlib.h>
-+
- #include "asterisk/res_pjsip.h"
-
- /*** DOCUMENTATION
diff --git a/comms/asterisk15/patches/patch-funcs_func__pjsip__endpoint.c b/comms/asterisk15/patches/patch-funcs_func__pjsip__endpoint.c
deleted file mode 100644
index 8e0e531a7c1..00000000000
--- a/comms/asterisk15/patches/patch-funcs_func__pjsip__endpoint.c
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-funcs_func__pjsip__endpoint.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- funcs/func_pjsip_endpoint.c.orig 2018-06-20 14:41:38.307201390 +0000
-+++ funcs/func_pjsip_endpoint.c
-@@ -34,14 +34,15 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjlib.h>
--
- #include "asterisk/app.h"
- #include "asterisk/pbx.h"
- #include "asterisk/module.h"
- #include "asterisk/channel.h"
- #include "asterisk/sorcery.h"
-+
-+#include <pjsip.h>
-+#include <pjlib.h>
-+
- #include "asterisk/res_pjsip.h"
-
- /*** DOCUMENTATION
diff --git a/comms/asterisk15/patches/patch-funcs_func__strings.c b/comms/asterisk15/patches/patch-funcs_func__strings.c
deleted file mode 100644
index f4a64129125..00000000000
--- a/comms/asterisk15/patches/patch-funcs_func__strings.c
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-funcs_func__strings.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- funcs/func_strings.c.orig 2018-05-07 17:21:13.413282206 +0000
-+++ funcs/func_strings.c
-@@ -1483,7 +1483,7 @@ static int string_toupper(struct ast_cha
- {
- char *bufptr = buf, *dataptr = data;
-
-- while ((bufptr < buf + buflen - 1) && (*bufptr++ = toupper(*dataptr++)));
-+ while ((bufptr < buf + buflen - 1) && (*bufptr++ = toupper((unsigned char)*dataptr++)));
-
- return 0;
- }
-@@ -1496,7 +1496,7 @@ static int string_toupper2(struct ast_ch
- ast_str_make_space(buf, buflen > 0 ? buflen : strlen(data) + 1);
- }
- bufptr = ast_str_buffer(*buf);
-- while ((bufptr < ast_str_buffer(*buf) + ast_str_size(*buf) - 1) && (*bufptr++ = toupper(*dataptr++)));
-+ while ((bufptr < ast_str_buffer(*buf) + ast_str_size(*buf) - 1) && (*bufptr++ = toupper((unsigned char)*dataptr++)));
- ast_str_update(*buf);
-
- return 0;
-@@ -1512,7 +1512,7 @@ static int string_tolower(struct ast_cha
- {
- char *bufptr = buf, *dataptr = data;
-
-- while ((bufptr < buf + buflen - 1) && (*bufptr++ = tolower(*dataptr++)));
-+ while ((bufptr < buf + buflen - 1) && (*bufptr++ = tolower((unsigned char)*dataptr++)));
-
- return 0;
- }
-@@ -1525,7 +1525,7 @@ static int string_tolower2(struct ast_ch
- ast_str_make_space(buf, buflen > 0 ? buflen : strlen(data) + 1);
- }
- bufptr = ast_str_buffer(*buf);
-- while ((bufptr < ast_str_buffer(*buf) + ast_str_size(*buf) - 1) && (*bufptr++ = tolower(*dataptr++)));
-+ while ((bufptr < ast_str_buffer(*buf) + ast_str_size(*buf) - 1) && (*bufptr++ = tolower((unsigned char)*dataptr++)));
- ast_str_update(*buf);
-
- return 0;
diff --git a/comms/asterisk15/patches/patch-include_asterisk_autoconfig.h.in b/comms/asterisk15/patches/patch-include_asterisk_autoconfig.h.in
deleted file mode 100644
index a4cfd87fce5..00000000000
--- a/comms/asterisk15/patches/patch-include_asterisk_autoconfig.h.in
+++ /dev/null
@@ -1,27 +0,0 @@
-$NetBSD: patch-include_asterisk_autoconfig.h.in,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- include/asterisk/autoconfig.h.in.orig 2016-10-25 19:27:49.000000000 +0000
-+++ include/asterisk/autoconfig.h.in
-@@ -945,6 +945,12 @@
- /* Define to 1 if you have the `strstr' function. */
- #undef HAVE_STRSTR
-
-+/* Define to 1 if you have the `strftime_l' function. */
-+#undef HAVE_STRFTIME_L
-+
-+/* Define to 1 if you have the `strptime_l' function. */
-+#undef HAVE_STRPTIME_L
-+
- /* Define to 1 if you have the `strtod' function. */
- #undef HAVE_STRTOD
-
-@@ -1032,6 +1038,9 @@
- /* Define if your system has the SYSTEMD libraries. */
- #undef HAVE_SYSTEMD
-
-+/* Define to 1 if sys/atomic.h atomic operations are supported. */
-+#undef HAVE_SYS_ATOMIC_H
-+
- /* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
- */
- #undef HAVE_SYS_DIR_H
diff --git a/comms/asterisk15/patches/patch-include_asterisk_lock.h b/comms/asterisk15/patches/patch-include_asterisk_lock.h
deleted file mode 100644
index 84274590173..00000000000
--- a/comms/asterisk15/patches/patch-include_asterisk_lock.h
+++ /dev/null
@@ -1,76 +0,0 @@
-$NetBSD: patch-include_asterisk_lock.h,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- include/asterisk/lock.h.orig 2015-10-09 21:48:48.000000000 +0000
-+++ include/asterisk/lock.h
-@@ -634,6 +634,17 @@ static void __attribute__((destructor))
- */
- #define SCOPED_CHANNELLOCK(varname, chan) SCOPED_LOCK(varname, (chan), ast_channel_lock, ast_channel_unlock)
-
-+#undef pthread_mutex_lock
-+#undef pthread_mutex_unlock
-+#undef pthread_mutex_trylock
-+#undef pthread_mutex_init
-+#undef pthread_mutex_destroy
-+#undef pthread_cond_init
-+#undef pthread_cond_destroy
-+#undef pthread_cond_signal
-+#undef pthread_cond_broadcast
-+#undef pthread_cond_wait
-+#undef pthread_cond_timedwait
- #ifndef __CYGWIN__ /* temporary disabled for cygwin */
- #define pthread_mutex_t use_ast_mutex_t_instead_of_pthread_mutex_t
- #define pthread_cond_t use_ast_cond_t_instead_of_pthread_cond_t
-@@ -654,7 +665,7 @@ static void __attribute__((destructor))
-
- #define gethostbyname __gethostbyname__is__not__reentrant__use__ast_gethostbyname__instead__
-
--#ifndef __linux__
-+#if !defined(__linux__) && !defined(__DragonFly__)
- #define pthread_create __use_ast_pthread_create_instead__
- #endif
-
-@@ -676,6 +687,10 @@ int ast_atomic_fetchadd_int_slow(volatil
- #include "libkern/OSAtomic.h"
- #endif
-
-+#if defined(HAVE_SYS_ATOMIC_H)
-+#include <sys/atomic.h>
-+#endif
-+
- /*! \brief Atomically add v to *p and return * the previous value of *p.
- * This can be used to handle reference counts, and the return value
- * can be used to generate unique identifiers.
-@@ -696,6 +711,16 @@ AST_INLINE_API(int ast_atomic_fetchadd_i
- {
- return OSAtomicAdd64(v, (int64_t *) p) - v;
- })
-+#elif defined(HAVE_SYS_ATOMIC_H) && (SIZEOF_INT == 4)
-+AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
-+{
-+ return atomic_add_32_nv((uint32_t *)p, v) - v;
-+})
-+#elif defined(HAVE_SYS_ATOMIC_H) && (SIZEOF_INT == 8)
-+AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
-+{
-+ return atomic_add_64_nv((uint64_t *)p, v) - v;
-+})
- #elif defined (__i386__) || defined(__x86_64__)
- #ifdef sun
- AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
-@@ -743,6 +768,16 @@ AST_INLINE_API(int ast_atomic_dec_and_te
- {
- return OSAtomicAdd64( -1, (int64_t *) p) == 0;
- })
-+#elif defined(HAVE_SYS_ATOMIC_H) && (SIZEOF_INT == 4)
-+AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
-+{
-+ return atomic_dec_32_nv((uint32_t *)p) == 0;
-+})
-+#elif defined(HAVE_SYS_ATOMIC_H) && (SIZEOF_INT == 8)
-+AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
-+{
-+ return atomic_dec_64_nv((uint64_t *)p) == 0;
-+})
- #else
- AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
- {
diff --git a/comms/asterisk15/patches/patch-include_asterisk_sha1.h b/comms/asterisk15/patches/patch-include_asterisk_sha1.h
deleted file mode 100644
index 4b8da94b0fc..00000000000
--- a/comms/asterisk15/patches/patch-include_asterisk_sha1.h
+++ /dev/null
@@ -1,131 +0,0 @@
-$NetBSD: patch-include_asterisk_sha1.h,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- include/asterisk/sha1.h.orig 2016-09-09 16:14:37.000000000 +0000
-+++ include/asterisk/sha1.h
-@@ -191,49 +191,6 @@ typedef struct SHA256Context SHA224Conte
- typedef struct SHA512Context SHA384Context;
-
- /*
-- * This structure holds context information for all SHA
-- * hashing operations.
-- */
--typedef struct USHAContext {
-- int whichSha; /* which SHA is being used */
-- union {
-- SHA1Context sha1Context;
-- SHA224Context sha224Context; SHA256Context sha256Context;
-- SHA384Context sha384Context; SHA512Context sha512Context;
-- } ctx;
--} USHAContext;
--
--/*
-- * This structure will hold context information for the HMAC
-- * keyed-hashing operation.
-- */
--typedef struct HMACContext {
-- int whichSha; /* which SHA is being used */
-- int hashSize; /* hash size of SHA being used */
-- int blockSize; /* block size of SHA being used */
-- USHAContext shaContext; /* SHA context */
-- unsigned char k_opad[USHA_Max_Message_Block_Size];
-- /* outer padding - key XORd with opad */
-- int Computed; /* Is the MAC computed? */
-- int Corrupted; /* Cumulative corruption code */
--
--} HMACContext;
--
--/*
-- * This structure will hold context information for the HKDF
-- * extract-and-expand Key Derivation Functions.
-- */
--typedef struct HKDFContext {
-- int whichSha; /* which SHA is being used */
-- HMACContext hmacContext;
-- int hashSize; /* hash size of SHA being used */
-- unsigned char prk[USHAMaxHashSize];
-- /* pseudo-random key - output of hkdfInput */
-- int Computed; /* Is the key material computed? */
-- int Corrupted; /* Cumulative corruption code */
--} HKDFContext;
--
--/*
- * Function Prototypes
- */
-
-@@ -281,76 +238,6 @@ extern int SHA512FinalBits(SHA512Context
- extern int SHA512Result(SHA512Context *,
- uint8_t Message_Digest[SHA512HashSize]);
-
--/* Unified SHA functions, chosen by whichSha */
--extern int USHAReset(USHAContext *context, SHAversion whichSha);
--extern int USHAInput(USHAContext *context,
-- const uint8_t *bytes, unsigned int bytecount);
--extern int USHAFinalBits(USHAContext *context,
-- uint8_t bits, unsigned int bit_count);
--extern int USHAResult(USHAContext *context,
-- uint8_t Message_Digest[USHAMaxHashSize]);
--extern int USHABlockSize(enum SHAversion whichSha);
--extern int USHAHashSize(enum SHAversion whichSha);
--extern int USHAHashSizeBits(enum SHAversion whichSha);
--extern const char *USHAHashName(enum SHAversion whichSha);
--
--/*
-- * HMAC Keyed-Hashing for Message Authentication, RFC 2104,
-- * for all SHAs.
-- * This interface allows a fixed-length text input to be used.
-- */
--extern int hmac(SHAversion whichSha, /* which SHA algorithm to use */
-- const unsigned char *text, /* pointer to data stream */
-- int text_len, /* length of data stream */
-- const unsigned char *key, /* pointer to authentication key */
-- int key_len, /* length of authentication key */
-- uint8_t digest[USHAMaxHashSize]); /* caller digest to fill in */
--
--/*
-- * HMAC Keyed-Hashing for Message Authentication, RFC 2104,
-- * for all SHAs.
-- * This interface allows any length of text input to be used.
-- */
--extern int hmacReset(HMACContext *context, enum SHAversion whichSha,
-- const unsigned char *key, int key_len);
--extern int hmacInput(HMACContext *context, const unsigned char *text,
-- int text_len);
--extern int hmacFinalBits(HMACContext *context, uint8_t bits,
-- unsigned int bit_count);
--extern int hmacResult(HMACContext *context,
-- uint8_t digest[USHAMaxHashSize]);
--
--/*
-- * HKDF HMAC-based Extract-and-Expand Key Derivation Function,
-- * RFC 5869, for all SHAs.
-- */
--extern int hkdf(SHAversion whichSha, const unsigned char *salt,
-- int salt_len, const unsigned char *ikm, int ikm_len,
-- const unsigned char *info, int info_len,
-- uint8_t okm[ ], int okm_len);
--extern int hkdfExtract(SHAversion whichSha, const unsigned char *salt,
-- int salt_len, const unsigned char *ikm,
-- int ikm_len, uint8_t prk[USHAMaxHashSize]);
--extern int hkdfExpand(SHAversion whichSha, const uint8_t prk[ ],
-- int prk_len, const unsigned char *info,
-- int info_len, uint8_t okm[ ], int okm_len);
--
--/*
-- * HKDF HMAC-based Extract-and-Expand Key Derivation Function,
-- * RFC 5869, for all SHAs.
-- * This interface allows any length of text input to be used.
-- */
--extern int hkdfReset(HKDFContext *context, enum SHAversion whichSha,
-- const unsigned char *salt, int salt_len);
--extern int hkdfInput(HKDFContext *context, const unsigned char *ikm,
-- int ikm_len);
--extern int hkdfFinalBits(HKDFContext *context, uint8_t ikm_bits,
-- unsigned int ikm_bit_count);
--extern int hkdfResult(HKDFContext *context,
-- uint8_t prk[USHAMaxHashSize],
-- const unsigned char *info, int info_len,
-- uint8_t okm[USHAMaxHashSize], int okm_len);
--
- /************************ sha-private.h ************************/
- /***************** See RFC 6234 for details. *******************/
- /*
diff --git a/comms/asterisk15/patches/patch-include_asterisk_strings.h b/comms/asterisk15/patches/patch-include_asterisk_strings.h
deleted file mode 100644
index 6eeaa463f01..00000000000
--- a/comms/asterisk15/patches/patch-include_asterisk_strings.h
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-include_asterisk_strings.h,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- include/asterisk/strings.h.orig 2018-05-01 20:12:26.000000000 +0000
-+++ include/asterisk/strings.h
-@@ -1168,7 +1168,7 @@ char *ast_tech_to_upper(char *dev_str),
- }
-
- for (pos = dev_str; *pos && *pos != '/'; pos++) {
-- *pos = toupper(*pos);
-+ *pos = toupper((unsigned char)*pos);
- }
- return dev_str;
- }
-@@ -1244,7 +1244,7 @@ static force_inline int attribute_pure a
- unsigned int hash = 5381;
-
- while (*str) {
-- hash = hash * 33 ^ (unsigned char) tolower(*str++);
-+ hash = hash * 33 ^ tolower((unsigned char)*str++);
- }
-
- return ast_str_hash_restrict(hash);
-@@ -1265,7 +1265,7 @@ static force_inline char *attribute_pure
- }
-
- for (; *str; ++str) {
-- *str = tolower(*str);
-+ *str = tolower((unsigned char)*str);
- }
-
- return str_orig;
-@@ -1286,7 +1286,7 @@ static force_inline char *attribute_pure
- }
-
- for (; *str; ++str) {
-- *str = toupper(*str);
-+ *str = toupper((unsigned char)*str);
- }
-
- return str_orig;
diff --git a/comms/asterisk15/patches/patch-main_Makefile b/comms/asterisk15/patches/patch-main_Makefile
deleted file mode 100644
index b5dc88f9806..00000000000
--- a/comms/asterisk15/patches/patch-main_Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-$NetBSD: patch-main_Makefile,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/Makefile.orig 2018-06-11 21:21:37.000000000 +0000
-+++ main/Makefile
-@@ -92,6 +92,10 @@ ifeq ($(OSARCH),OpenBSD)
- AST_LIBS+=-lcrypto -lpthread -lm $(EDITLINE_LIB)
- endif
-
-+ifeq ($(OSARCH),dragonfly)
-+ AST_LIBS+=-lpthread
-+endif
-+
- ifeq ($(OSARCH),SunOS)
- AST_LIBS+=-lpthread -ldl -lrt -lnsl -lsocket -lresolv
- ASTSSL_LIBS+=-L/opt/ssl/lib -L/usr/local/ssl/lib
-@@ -236,7 +240,7 @@ libasteriskpj.o: _ASTCFLAGS+=$(PJPROJECT
- ifeq ($(PJPROJECT_BUNDLED),yes)
-
- ASTPJ_SO_VERSION=2
--ASTPJ_LDLIBS=-L. -lasteriskpj
-+ASTPJ_LDLIBS=${COMPILER_RPATH_FLAG}${PREFIX}/lib/asterisk -L. -lasteriskpj
-
- PJDIR=$(ASTTOPDIR)/$(PJPROJECT_DIR)/source
- -include $(ASTTOPDIR)/$(PJPROJECT_DIR)/build.mak
-@@ -325,10 +329,10 @@ bininstall:
- $(INSTALL) -m 755 $(MAIN_TGT) "$(DESTDIR)$(ASTSBINDIR)/"
- ifeq ($(AST_ASTERISKSSL),yes)
- ifeq ($(findstring darwin,$(OSARCH)),) # not Darwin
-- $(INSTALL) -m 755 $(ASTSSL_LIB).$(ASTSSL_SO_VERSION) "$(DESTDIR)$(ASTLIBDIR)/"
-- $(LN) -sf $(ASTSSL_LIB).$(ASTSSL_SO_VERSION) "$(DESTDIR)$(ASTLIBDIR)/$(ASTSSL_LIB)"
-+ $(INSTALL) -m 755 $(ASTSSL_LIB).$(ASTSSL_SO_VERSION) "$(DESTDIR)$(PREFIX)/lib/"
-+ $(LN) -sf $(ASTSSL_LIB).$(ASTSSL_SO_VERSION) "$(DESTDIR)$(PREFIX)/lib/$(ASTSSL_LIB)"
- else # Darwin
-- $(INSTALL) -m 755 $(ASTSSL_LIB) "$(DESTDIR)$(ASTLIBDIR)/"
-+ $(INSTALL) -m 755 $(ASTSSL_LIB) "$(DESTDIR)$(PREFIX)/lib/"
- endif
- endif
- ifeq ($(PJPROJECT_BUNDLED),yes)
diff --git a/comms/asterisk15/patches/patch-main_acl.c b/comms/asterisk15/patches/patch-main_acl.c
deleted file mode 100644
index 2dbb51ea0e3..00000000000
--- a/comms/asterisk15/patches/patch-main_acl.c
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-main_acl.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/acl.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ main/acl.c
-@@ -127,7 +127,7 @@ static int get_local_address(struct ast_
- char *buf = NULL;
- int bufsz, x;
- #endif /* SOLARIS */
--#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__) || defined(__GLIBC__)
-+#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__) || defined(__DragonFly__) || defined(__GLIBC__)
- struct ifaddrs *ifap, *ifaphead;
- int rtnerr;
- const struct sockaddr_in *sin;
-@@ -136,7 +136,7 @@ static int get_local_address(struct ast_
- int best_score = -100;
- memset(&best_addr, 0, sizeof(best_addr));
-
--#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__) || defined(__GLIBC__)
-+#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__) || defined(__DragonFly__) || defined(__GLIBC__)
- rtnerr = getifaddrs(&ifaphead);
- if (rtnerr) {
- perror(NULL);
-@@ -147,7 +147,7 @@ static int get_local_address(struct ast_
- s = socket(AF_INET, SOCK_STREAM, 0);
-
- if (s > 0) {
--#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__) || defined(__GLIBC__)
-+#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__) || defined(__DragonFly__) || defined(__GLIBC__)
- for (ifap = ifaphead; ifap; ifap = ifap->ifa_next) {
-
- if (ifap->ifa_addr && ifap->ifa_addr->sa_family == AF_INET) {
-@@ -206,7 +206,7 @@ static int get_local_address(struct ast_
-
- close(s);
- }
--#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__)
-+#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__) || defined(__DragonFly__)
- freeifaddrs(ifaphead);
- #endif /* BSD_OR_LINUX */
-
diff --git a/comms/asterisk15/patches/patch-main_app.c b/comms/asterisk15/patches/patch-main_app.c
deleted file mode 100644
index f605b490488..00000000000
--- a/comms/asterisk15/patches/patch-main_app.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-main_app.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/app.c.orig 2018-05-07 17:23:29.870389813 +0000
-+++ main/app.c
-@@ -3085,7 +3085,7 @@ int ast_app_parse_timelen(const char *ti
- break;
- case 'm':
- case 'M':
-- if (toupper(u[1]) == 'S') {
-+ if (toupper((unsigned char)u[1]) == 'S') {
- unit = TIMELEN_MILLISECONDS;
- if (u[2] != '\0') {
- return -1;
diff --git a/comms/asterisk15/patches/patch-main_ast__expr2.c b/comms/asterisk15/patches/patch-main_ast__expr2.c
deleted file mode 100644
index 241b40877b1..00000000000
--- a/comms/asterisk15/patches/patch-main_ast__expr2.c
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-main_ast__expr2.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/ast_expr2.c.orig 2018-05-07 17:49:06.171631311 +0000
-+++ main/ast_expr2.c
-@@ -2545,9 +2545,9 @@ make_str (const char *s)
- return(NULL);
- }
-
-- for (i = 0, isint = (isdigit(s[0]) || s[0] == '-' || s[0]=='.'); isint && i < strlen(s); i++)
-+ for (i = 0, isint = (isdigit((unsigned char)s[0]) || s[0] == '-' || s[0]=='.'); isint && i < strlen(s); i++)
- {
-- if (!isdigit(s[i]) && s[i] != '.') {
-+ if (!isdigit((unsigned char)s[i]) && s[i] != '.') {
- isint = 0;
- break;
- }
diff --git a/comms/asterisk15/patches/patch-main_ast__expr2.y b/comms/asterisk15/patches/patch-main_ast__expr2.y
deleted file mode 100644
index 52c46444f48..00000000000
--- a/comms/asterisk15/patches/patch-main_ast__expr2.y
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-main_ast__expr2.y,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/ast_expr2.y.orig 2018-05-07 17:23:43.934750158 +0000
-+++ main/ast_expr2.y
-@@ -538,9 +538,9 @@ make_str (const char *s)
- return(NULL);
- }
-
-- for (i = 0, isint = (isdigit(s[0]) || s[0] == '-' || s[0]=='.'); isint && i < strlen(s); i++)
-+ for (i = 0, isint = (isdigit((unsigned char)s[0]) || s[0] == '-' || s[0]=='.'); isint && i < strlen(s); i++)
- {
-- if (!isdigit(s[i]) && s[i] != '.') {
-+ if (!isdigit((unsigned char)s[i]) && s[i] != '.') {
- isint = 0;
- break;
- }
diff --git a/comms/asterisk15/patches/patch-main_asterisk.c b/comms/asterisk15/patches/patch-main_asterisk.c
deleted file mode 100644
index 370ed33352d..00000000000
--- a/comms/asterisk15/patches/patch-main_asterisk.c
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-main_asterisk.c,v 1.2 2021/01/17 08:32:40 jnemeth Exp $
-
---- main/asterisk.c.orig 2019-09-05 13:09:20.000000000 +0000
-+++ main/asterisk.c
-@@ -852,7 +852,7 @@ int64_t ast_mark(int i, int startstop)
- #define DEFINE_PROFILE_MIN_MAX_VALUES min = 0; \
- max = prof_data->entries;\
- if (a->argc > 3) { /* specific entries */ \
-- if (isdigit(a->argv[3][0])) { \
-+ if (isdigit((unsigned char)a->argv[3][0])) { \
- min = atoi(a->argv[3]); \
- if (a->argc == 5 && strcmp(a->argv[4], "-")) \
- max = atoi(a->argv[4]); \
-@@ -2274,7 +2274,7 @@ static int remoteconsolehandler(const ch
- if (!ast_all_zeros(s))
- ast_el_add_history(s);
-
-- while (isspace(*s)) {
-+ while (isspace((unsigned char)*s)) {
- s++;
- }
-
-@@ -2286,7 +2286,7 @@ static int remoteconsolehandler(const ch
- ast_safe_system(getenv("SHELL") ? getenv("SHELL") : "/bin/sh");
- ret = 1;
- } else if ((strncasecmp(s, "quit", 4) == 0 || strncasecmp(s, "exit", 4) == 0) &&
-- (s[4] == '\0' || isspace(s[4]))) {
-+ (s[4] == '\0' || isspace((unsigned char)s[4]))) {
- quit_handler(0, SHUTDOWN_FAST, 0);
- ret = 1;
- }
-@@ -2949,7 +2949,7 @@ static char *cli_complete(EditLine *edit
- ptr = (char *)lf->cursor;
- if (ptr) {
- while (ptr > lf->buffer) {
-- if (isspace(*ptr)) {
-+ if (isspace((unsigned char)*ptr)) {
- ptr++;
- break;
- }
diff --git a/comms/asterisk15/patches/patch-main_astmm.c b/comms/asterisk15/patches/patch-main_astmm.c
deleted file mode 100644
index d07f890d54a..00000000000
--- a/comms/asterisk15/patches/patch-main_astmm.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-main_astmm.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/astmm.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ main/astmm.c
-@@ -1487,7 +1487,7 @@ void __ast_mm_init_phase_2(void)
-
- mmlog = fopen(filename, "a+");
- if (mmlog) {
-- fprintf(mmlog, "%ld - New session\n", (long) time(NULL));
-+ fprintf(mmlog, "%jd - New session\n", (intmax_t) time(NULL));
- fflush(mmlog);
- } else {
- ast_log(LOG_ERROR, "Could not open malloc debug log file: %s\n", filename);
diff --git a/comms/asterisk15/patches/patch-main_bridge__basic.c b/comms/asterisk15/patches/patch-main_bridge__basic.c
deleted file mode 100644
index c3eb1c52c96..00000000000
--- a/comms/asterisk15/patches/patch-main_bridge__basic.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-main_bridge__basic.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/bridge_basic.c.orig 2018-05-07 17:25:08.340535041 +0000
-+++ main/bridge_basic.c
-@@ -167,7 +167,7 @@ static int build_dtmf_features(struct as
- size_t number_of_missing_features = 0;
-
- for (feature = features; *feature; feature++) {
-- if (!isupper(*feature)) {
-+ if (!isupper((unsigned char)*feature)) {
- ast_log(LOG_ERROR, "Features string '%s' rejected because it contains non-uppercase feature.\n", features);
- return -1;
- }
diff --git a/comms/asterisk15/patches/patch-main_callerid.c b/comms/asterisk15/patches/patch-main_callerid.c
deleted file mode 100644
index e572078fff0..00000000000
--- a/comms/asterisk15/patches/patch-main_callerid.c
+++ /dev/null
@@ -1,28 +0,0 @@
-$NetBSD: patch-main_callerid.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/callerid.c.orig 2018-05-07 17:25:23.439816235 +0000
-+++ main/callerid.c
-@@ -233,20 +233,20 @@ void callerid_get_dtmf(char *cidstring,
- for (i = 1; i < strlen(cidstring); i++) {
- if (cidstring[i] == 'C' || cidstring[i] == '#')
- break;
-- if (isdigit(cidstring[i]))
-+ if (isdigit((unsigned char)cidstring[i]))
- number[i-1] = cidstring[i];
- else
- ast_debug(1, "Unknown CID digit '%c'\n",
- cidstring[i]);
- }
- number[i-1] = 0;
-- } else if (isdigit(cidstring[0])) {
-+ } else if (isdigit((unsigned char)cidstring[0])) {
- /* It begins with a digit, so we parse it as a number and hope
- * for the best */
- ast_log(LOG_WARNING, "Couldn't detect start-character. CID "
- "parsing might be unreliable\n");
- for (i = 0; i < strlen(cidstring); i++) {
-- if (isdigit(cidstring[i]))
-+ if (isdigit((unsigned char)cidstring[i]))
- number[i] = cidstring[i];
- else
- break;
diff --git a/comms/asterisk15/patches/patch-main_cdr.c b/comms/asterisk15/patches/patch-main_cdr.c
deleted file mode 100644
index a0ea45a13d0..00000000000
--- a/comms/asterisk15/patches/patch-main_cdr.c
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-main_cdr.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/cdr.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ main/cdr.c
-@@ -2787,7 +2787,7 @@ static const char *cdr_format_var_intern
- static void cdr_get_tv(struct timeval when, const char *fmt, char *buf, int bufsize)
- {
- if (fmt == NULL) { /* raw mode */
-- snprintf(buf, bufsize, "%ld.%06ld", (long)when.tv_sec, (long)when.tv_usec);
-+ snprintf(buf, bufsize, "%jd.%06ld", (intmax_t)when.tv_sec, (long)when.tv_usec);
- } else {
- buf[0] = '\0';/* Ensure the buffer is initialized. */
- if (when.tv_sec) {
-@@ -2833,9 +2833,9 @@ void ast_cdr_format_var(struct ast_cdr *
- } else if (!strcasecmp(name, "end")) {
- cdr_get_tv(cdr->end, raw ? NULL : fmt, workspace, workspacelen);
- } else if (!strcasecmp(name, "duration")) {
-- snprintf(workspace, workspacelen, "%ld", cdr->end.tv_sec != 0 ? cdr->duration : (long)ast_tvdiff_ms(ast_tvnow(), cdr->start) / 1000);
-+ snprintf(workspace, workspacelen, "%jd", cdr->end.tv_sec != 0 ? cdr->duration : (intmax_t)ast_tvdiff_ms(ast_tvnow(), cdr->start) / 1000);
- } else if (!strcasecmp(name, "billsec")) {
-- snprintf(workspace, workspacelen, "%ld", (cdr->billsec || !ast_tvzero(cdr->end) || ast_tvzero(cdr->answer)) ? cdr->billsec : (long)ast_tvdiff_ms(ast_tvnow(), cdr->answer) / 1000);
-+ snprintf(workspace, workspacelen, "%jd", (cdr->billsec || !ast_tvzero(cdr->end) || ast_tvzero(cdr->answer)) ? cdr->billsec : (intmax_t)ast_tvdiff_ms(ast_tvnow(), cdr->answer) / 1000);
- } else if (!strcasecmp(name, "disposition")) {
- if (raw) {
- snprintf(workspace, workspacelen, "%ld", cdr->disposition);
diff --git a/comms/asterisk15/patches/patch-main_cel.c b/comms/asterisk15/patches/patch-main_cel.c
deleted file mode 100644
index 4a20f8abfa6..00000000000
--- a/comms/asterisk15/patches/patch-main_cel.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-main_cel.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/cel.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ main/cel.c
-@@ -790,7 +790,7 @@ struct ast_channel *ast_cel_fabricate_ch
- }
-
- if (ast_strlen_zero(cfg->general->date_format)) {
-- snprintf(timebuf, sizeof(timebuf), "%ld.%06ld", (long) record.event_time.tv_sec,
-+ snprintf(timebuf, sizeof(timebuf), "%jd.%06ld", (intmax_t) record.event_time.tv_sec,
- (long) record.event_time.tv_usec);
- } else {
- struct ast_tm tm;
diff --git a/comms/asterisk15/patches/patch-main_cli.c b/comms/asterisk15/patches/patch-main_cli.c
deleted file mode 100644
index 28982c33ee1..00000000000
--- a/comms/asterisk15/patches/patch-main_cli.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-main_cli.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/cli.c.orig 2018-05-07 17:26:06.732494913 +0000
-+++ main/cli.c
-@@ -2440,7 +2440,7 @@ static char *parse_args(const char *s, i
- cur = duplicate;
-
- /* Remove leading spaces from the command */
-- while (isspace(*s)) {
-+ while (isspace((unsigned char)*s)) {
- cur++;
- s++;
- }
-@@ -2627,7 +2627,7 @@ struct ast_vector_string *ast_cli_comple
- continue;
- }
-
-- while (i < max_equal && toupper(prevstr[i]) == toupper(retstr[i])) {
-+ while (i < max_equal && toupper((unsigned char)prevstr[i]) == toupper((unsigned char)retstr[i])) {
- i++;
- }
-
diff --git a/comms/asterisk15/patches/patch-main_conversions.c b/comms/asterisk15/patches/patch-main_conversions.c
deleted file mode 100644
index 1a3cfdfe3b3..00000000000
--- a/comms/asterisk15/patches/patch-main_conversions.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-main_conversions.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/conversions.c.orig 2018-05-07 17:26:43.897798394 +0000
-+++ main/conversions.c
-@@ -33,7 +33,7 @@
- static int str_is_negative(const char *str)
- {
- /* Ignore any preceding white space */
-- while (isspace(*str) && *++str);
-+ while (isspace((unsigned char)*str) && *++str);
- return *str == '-';
- }
-
diff --git a/comms/asterisk15/patches/patch-main_dns__naptr.c b/comms/asterisk15/patches/patch-main_dns__naptr.c
deleted file mode 100644
index c255427c133..00000000000
--- a/comms/asterisk15/patches/patch-main_dns__naptr.c
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-main_dns__naptr.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/dns_naptr.c.orig 2018-05-07 17:26:59.602834230 +0000
-+++ main/dns_naptr.c
-@@ -78,7 +78,7 @@ static enum flags_result interpret_flags
- *flags == 'a' || *flags == 'A' ||
- *flags == 'u' || *flags == 'U') {
- return FLAGS_TERMINAL;
-- } else if (!isalnum(*flags)) {
-+ } else if (!isalnum((unsigned char)*flags)) {
- return FLAGS_INVALID;
- } else {
- return FLAGS_UNKNOWN;
-@@ -90,7 +90,7 @@ static enum flags_result interpret_flags
- * S, A, U, and P flags together.
- */
- for (i = 0; i < flags_size; ++i) {
-- if (!isalnum(flags[i])) {
-+ if (!isalnum((unsigned char)flags[i])) {
- return FLAGS_INVALID;
- } else if (flags[i] == 's' || flags[i] == 'S') {
- if (known_flag_found && known_flag_found != 's') {
-@@ -146,7 +146,7 @@ static int services_invalid(const char *
- uint8_t current_size = plus_pos ? plus_pos - current_pos : end_of_services - current_pos;
- int i;
-
-- if (!isalpha(current_pos[0])) {
-+ if (!isalpha((unsigned char)current_pos[0])) {
- return -1;
- }
-
-@@ -155,7 +155,7 @@ static int services_invalid(const char *
- }
-
- for (i = 1; i < current_size; ++i) {
-- if (!isalnum(current_pos[i])) {
-+ if (!isalnum((unsigned char)current_pos[i])) {
- return -1;
- }
- }
diff --git a/comms/asterisk15/patches/patch-main_enum.c b/comms/asterisk15/patches/patch-main_enum.c
deleted file mode 100644
index d10f4f4600d..00000000000
--- a/comms/asterisk15/patches/patch-main_enum.c
+++ /dev/null
@@ -1,76 +0,0 @@
-$NetBSD: patch-main_enum.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/enum.c.orig 2018-05-07 17:27:38.736672469 +0000
-+++ main/enum.c
-@@ -218,7 +218,7 @@ static int blr_txt(const char *cc, const
- ast_mutex_unlock(&enumlock);
-
- for (p2 = (char *) cc + strlen(cc) - 1; p2 >= cc; p2--) {
-- if (isdigit(*p2)) {
-+ if (isdigit((unsigned char)*p2)) {
- *p1++ = *p2;
- *p1++ = '.';
- }
-@@ -347,7 +347,7 @@ static int blr_ebl(const char *cc, const
- ast_mutex_unlock(&enumlock);
-
- for (p2 = (char *) cc + strlen(cc) - 1; p2 >= cc; p2--) {
-- if (isdigit(*p2)) {
-+ if (isdigit((unsigned char)*p2)) {
- *p1++ = *p2;
- *p1++ = '.';
- }
-@@ -456,7 +456,7 @@ static int parse_naptr(unsigned char *ds
- naptrinput, flags, services, regexp, repl);
-
-
-- if (tolower(flags[0]) != 'u') {
-+ if (tolower((unsigned char)flags[0]) != 'u') {
- ast_log(LOG_WARNING, "NAPTR Flag must be 'U' or 'u'.\n");
- return -1;
- }
-@@ -539,7 +539,7 @@ static int parse_naptr(unsigned char *ds
- * beginning and ending indexes of the substring to insert as the backreference.
- * if no backreference is found, continue copying the subst into tempdst */
- while (*subst && (d_len > 0)) {
-- if ((subst[0] == '\\') && isdigit(subst[1])) { /* is this character the beginning of a backreference */
-+ if ((subst[0] == '\\') && isdigit((unsigned char)subst[1])) { /* is this character the beginning of a backreference */
- matchindex = (int) (subst[1] - '0');
- if (matchindex >= ARRAY_LEN(pmatch)) {
- ast_log(LOG_WARNING, "Error during regex substitution. Invalid pmatch index.\n");
-@@ -561,7 +561,7 @@ static int parse_naptr(unsigned char *ds
- ast_log(LOG_WARNING, "Error during regex substitution. Invalid backreference index.\n");
- return -1;
- }
-- } else if (isprint(*subst)) {
-+ } else if (isprint((unsigned char)*subst)) {
- *d++ = *subst++;
- d_len--;
- } else {
-@@ -818,7 +818,7 @@ int ast_get_enum(struct ast_channel *cha
-
- p1 = middle + strlen(middle);
- for (p2 = (char *) number + sdl - 1; p2 >= number; p2--) {
-- if (isdigit(*p2)) {
-+ if (isdigit((unsigned char)*p2)) {
- *p1++ = *p2;
- *p1++ = '.';
- }
-@@ -837,7 +837,7 @@ int ast_get_enum(struct ast_channel *cha
- /* flip left into domain */
- p1 = domain;
- for (p2 = left + strlen(left); p2 >= left; p2--) {
-- if (isdigit(*p2)) {
-+ if (isdigit((unsigned char)*p2)) {
- *p1++ = *p2;
- *p1++ = '.';
- }
-@@ -949,7 +949,7 @@ int ast_get_txt(struct ast_channel *chan
- }
-
- while (pos >= 0) {
-- if (isdigit(number[pos])) {
-+ if (isdigit((unsigned char)number[pos])) {
- tmp[newpos++] = number[pos];
- tmp[newpos++] = '.';
- }
diff --git a/comms/asterisk15/patches/patch-main_features.c b/comms/asterisk15/patches/patch-main_features.c
deleted file mode 100644
index 705d758d5b9..00000000000
--- a/comms/asterisk15/patches/patch-main_features.c
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD: patch-main_features.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/features.c.orig 2018-05-07 17:28:38.342590540 +0000
-+++ main/features.c
-@@ -387,13 +387,13 @@ static void set_bridge_features_on_confi
- for (feature = features; *feature; feature++) {
- struct ast_flags *party;
-
-- if (isupper(*feature)) {
-+ if (isupper((unsigned char)*feature)) {
- party = &config->features_caller;
- } else {
- party = &config->features_callee;
- }
-
-- switch (tolower(*feature)) {
-+ switch (tolower((unsigned char)*feature)) {
- case 't' :
- ast_set_flag(party, AST_FEATURE_REDIRECT);
- break;
diff --git a/comms/asterisk15/patches/patch-main_http.c b/comms/asterisk15/patches/patch-main_http.c
deleted file mode 100644
index 316cde5c323..00000000000
--- a/comms/asterisk15/patches/patch-main_http.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-main_http.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/http.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ main/http.c
-@@ -304,7 +304,7 @@ static int static_callback(struct ast_tc
- }
-
- /* make "Etag:" http header value */
-- snprintf(etag, sizeof(etag), "\"%ld\"", (long)st.st_mtime);
-+ snprintf(etag, sizeof(etag), "\"%jd\"", (intmax_t)st.st_mtime);
-
- /* make "Last-Modified:" http header value */
- tv.tv_sec = st.st_mtime;
diff --git a/comms/asterisk15/patches/patch-main_indications.c b/comms/asterisk15/patches/patch-main_indications.c
deleted file mode 100644
index 1705d8a58ef..00000000000
--- a/comms/asterisk15/patches/patch-main_indications.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-main_indications.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/indications.c.orig 2018-05-07 17:29:02.579091198 +0000
-+++ main/indications.c
-@@ -904,7 +904,7 @@ static void store_tone_zone_ring_cadence
-
- ring = ast_strip(ring);
-
-- if (!isdigit(ring[0]) || (val = atoi(ring)) == -1) {
-+ if (!isdigit((unsigned char)ring[0]) || (val = atoi(ring)) == -1) {
- ast_log(LOG_WARNING, "Invalid ringcadence given '%s'.\n", ring);
- continue;
- }
diff --git a/comms/asterisk15/patches/patch-main_logger.c b/comms/asterisk15/patches/patch-main_logger.c
deleted file mode 100644
index 7ac363522f6..00000000000
--- a/comms/asterisk15/patches/patch-main_logger.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-main_logger.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/logger.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ main/logger.c
-@@ -674,7 +674,7 @@ void ast_queue_log(const char *queuename
-
- if (qlog) {
- va_start(ap, fmt);
-- qlog_len = snprintf(qlog_msg, sizeof(qlog_msg), "%ld|%s|%s|%s|%s|", (long)time(NULL), callid, queuename, agent, event);
-+ qlog_len = snprintf(qlog_msg, sizeof(qlog_msg), "%jd|%s|%s|%s|%s|", (intmax_t)time(NULL), callid, queuename, agent, event);
- vsnprintf(qlog_msg + qlog_len, sizeof(qlog_msg) - qlog_len, fmt, ap);
- va_end(ap);
- AST_RWLIST_RDLOCK(&logchannels);
-@@ -714,7 +714,7 @@ static int rotate_file(const char *filen
- }
- break;
- case TIMESTAMP:
-- snprintf(new, sizeof(new), "%s.%ld", filename, (long)time(NULL));
-+ snprintf(new, sizeof(new), "%s.%jd", filename, (intmax_t)time(NULL));
- if (rename(filename, new)) {
- fprintf(stderr, "Unable to rename file '%s' to '%s'\n", filename, new);
- res = -1;
diff --git a/comms/asterisk15/patches/patch-main_manager.c b/comms/asterisk15/patches/patch-main_manager.c
deleted file mode 100644
index b1ab7495649..00000000000
--- a/comms/asterisk15/patches/patch-main_manager.c
+++ /dev/null
@@ -1,83 +0,0 @@
-$NetBSD: patch-main_manager.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/manager.c.orig 2018-05-01 20:12:26.000000000 +0000
-+++ main/manager.c
-@@ -2639,7 +2639,7 @@ static char *handle_showmanconn(struct a
- struct mansession_session *session;
- time_t now = time(NULL);
- #define HSMCONN_FORMAT1 " %-15.15s %-55.55s %-10.10s %-10.10s %-8.8s %-8.8s %-5.5s %-5.5s\n"
--#define HSMCONN_FORMAT2 " %-15.15s %-55.55s %-10d %-10d %-8d %-8d %-5.5d %-5.5d\n"
-+#define HSMCONN_FORMAT2 " %-15.15s %-55.55s %-10jd %-10jd %-8d %-8d %-5.5d %-5.5d\n"
- int count = 0;
- struct ao2_iterator i;
-
-@@ -2665,8 +2665,8 @@ static char *handle_showmanconn(struct a
- ao2_lock(session);
- ast_cli(a->fd, HSMCONN_FORMAT2, session->username,
- ast_sockaddr_stringify_addr(&session->addr),
-- (int) (session->sessionstart),
-- (int) (now - session->sessionstart),
-+ (intmax_t) (session->sessionstart),
-+ (intmax_t) (now - session->sessionstart),
- session->stream ? ast_iostream_get_fd(session->stream) : -1,
- session->inuse,
- session->readperm,
-@@ -3510,9 +3510,9 @@ static int action_ping(struct mansession
- astman_append(
- s,
- "Ping: Pong\r\n"
-- "Timestamp: %ld.%06lu\r\n"
-+ "Timestamp: %jd.%06lu\r\n"
- "\r\n",
-- (long) now.tv_sec, (unsigned long) now.tv_usec);
-+ (intmax_t) now.tv_sec, (unsigned long) now.tv_usec);
- return 0;
- }
-
-@@ -4621,7 +4621,7 @@ static void generate_status(struct manse
- "DNID: %s\r\n"
- "EffectiveConnectedLineNum: %s\r\n"
- "EffectiveConnectedLineName: %s\r\n"
-- "TimeToHangup: %ld\r\n"
-+ "TimeToHangup: %jd\r\n"
- "BridgeID: %s\r\n"
- "Application: %s\r\n"
- "Data: %s\r\n"
-@@ -4641,7 +4641,7 @@ static void generate_status(struct manse
- S_OR(ast_channel_dialed(chan)->number.str, ""),
- S_COR(effective_id.number.valid, effective_id.number.str, "<unknown>"),
- S_COR(effective_id.name.valid, effective_id.name.str, "<unknown>"),
-- (long)ast_channel_whentohangup(chan)->tv_sec,
-+ (intmax_t)ast_channel_whentohangup(chan)->tv_sec,
- bridge ? bridge->uniqueid : "",
- ast_channel_appl(chan),
- ast_channel_data(chan),
-@@ -6920,8 +6920,8 @@ static int __attribute__((format(printf,
- if (timestampevents) {
- now = ast_tvnow();
- ast_str_append(&buf, 0,
-- "Timestamp: %ld.%06lu\r\n",
-- (long)now.tv_sec, (unsigned long) now.tv_usec);
-+ "Timestamp: %jd.%06lu\r\n",
-+ (intmax_t)now.tv_sec, (unsigned long) now.tv_usec);
- }
- if (manager_debug) {
- static int seq;
-@@ -7433,7 +7433,7 @@ static void xml_copy_escape(struct ast_s
- }
- }
-
-- if ( (mode & 2) && !isalnum(*src)) {
-+ if ( (mode & 2) && !isalnum((unsigned char)*src)) {
- *dst++ = '_';
- space--;
- continue;
-@@ -7466,7 +7466,7 @@ static void xml_copy_escape(struct ast_s
- break;
-
- default:
-- *dst++ = mode ? tolower(*src) : *src;
-+ *dst++ = mode ? tolower((unsigned char)*src) : *src;
- space--;
- }
- }
diff --git a/comms/asterisk15/patches/patch-main_netsock.c b/comms/asterisk15/patches/patch-main_netsock.c
deleted file mode 100644
index 3f405546be6..00000000000
--- a/comms/asterisk15/patches/patch-main_netsock.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-main_netsock.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/netsock.c.orig 2018-05-01 20:12:26.000000000 +0000
-+++ main/netsock.c
-@@ -32,7 +32,7 @@
- #include "asterisk.h"
-
- #if !defined (__linux__) && !defined (__GNU__)
--#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__Darwin__) || defined(__GLIBC__)
-+#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__Darwin__) || defined(__DragonFly__) || defined(__GLIBC__)
- #include <net/if_dl.h>
- #endif
- #endif
diff --git a/comms/asterisk15/patches/patch-main_pbx.c b/comms/asterisk15/patches/patch-main_pbx.c
deleted file mode 100644
index 5b35b41b44d..00000000000
--- a/comms/asterisk15/patches/patch-main_pbx.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-main_pbx.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/pbx.c.orig 2016-04-20 10:46:18.000000000 +0000
-+++ main/pbx.c
-@@ -7973,7 +7973,7 @@ static int testtime_write(struct ast_cha
- sscanf(remainder, "%79s", timezone);
- tv = ast_mktime(&tm, S_OR(timezone, NULL));
-
-- snprintf(result, sizeof(result), "%ld", (long) tv.tv_sec);
-+ snprintf(result, sizeof(result), "%jd", (intmax_t) tv.tv_sec);
- pbx_builtin_setvar_helper(chan, "__TESTTIME", result);
- return 0;
- }
diff --git a/comms/asterisk15/patches/patch-main_pbx__builtins.c b/comms/asterisk15/patches/patch-main_pbx__builtins.c
deleted file mode 100644
index 30c094dac22..00000000000
--- a/comms/asterisk15/patches/patch-main_pbx__builtins.c
+++ /dev/null
@@ -1,33 +0,0 @@
-$NetBSD: patch-main_pbx__builtins.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/pbx_builtins.c.orig 2018-05-01 20:12:26.000000000 +0000
-+++ main/pbx_builtins.c
-@@ -807,7 +807,7 @@ static int pbx_builtin_setamaflags(struc
- }
- /* Copy the AMA Flags as specified */
- ast_channel_lock(chan);
-- if (isdigit(data[0])) {
-+ if (isdigit((unsigned char)data[0])) {
- int amaflags;
- if (sscanf(data, "%30d", &amaflags) != 1) {
- ast_log(AST_LOG_WARNING, "Unable to set AMA flags on channel %s\n", ast_channel_name(chan));
-@@ -877,7 +877,7 @@ static int pbx_builtin_gotoiftime(struct
- struct ast_timing timing;
- const char *ctime;
- struct timeval tv = ast_tvnow();
-- long timesecs;
-+ int64_t timesecs;
-
- if (!chan) {
- ast_log(LOG_WARNING, "GotoIfTime requires a channel on which to operate\n");
-@@ -892,8 +892,8 @@ static int pbx_builtin_gotoiftime(struct
- ts = s = ast_strdupa(data);
-
- ast_channel_lock(chan);
-- if ((ctime = pbx_builtin_getvar_helper(chan, "TESTTIME")) && sscanf(ctime, "%ld", &timesecs) == 1) {
-- tv.tv_sec = timesecs;
-+ if ((ctime = pbx_builtin_getvar_helper(chan, "TESTTIME")) && sscanf(ctime, "%" SCNd64, &timesecs) == 1) {
-+ tv.tv_sec = (time_t)timesecs;
- } else if (ctime) {
- ast_log(LOG_WARNING, "Using current time to evaluate\n");
- /* Reset when unparseable */
diff --git a/comms/asterisk15/patches/patch-main_pbx__timing.c b/comms/asterisk15/patches/patch-main_pbx__timing.c
deleted file mode 100644
index 2e4e8f22127..00000000000
--- a/comms/asterisk15/patches/patch-main_pbx__timing.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-main_pbx__timing.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/pbx_timing.c.orig 2018-05-07 17:30:09.949079213 +0000
-+++ main/pbx_timing.c
-@@ -137,7 +137,7 @@ static void get_timerange(struct ast_tim
- }
- *endpart++ = '\0';
- /* why skip non digits? Mostly to skip spaces */
-- while (*endpart && !isdigit(*endpart)) {
-+ while (*endpart && !isdigit((unsigned char)*endpart)) {
- endpart++;
- }
- if (!*endpart) {
diff --git a/comms/asterisk15/patches/patch-main_sched.c b/comms/asterisk15/patches/patch-main_sched.c
deleted file mode 100644
index 58a2d6f6e89..00000000000
--- a/comms/asterisk15/patches/patch-main_sched.c
+++ /dev/null
@@ -1,27 +0,0 @@
-$NetBSD: patch-main_sched.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/sched.c.orig 2018-05-01 20:12:26.000000000 +0000
-+++ main/sched.c
-@@ -498,7 +498,7 @@ static int sched_settime(struct timeval
- ast_assert(0);
- }
-
-- /*ast_debug(1, "TV -> %lu,%lu\n", tv->tv_sec, tv->tv_usec);*/
-+ /*ast_debug(1, "TV -> %jd,%lu\n", (intmax_t)tv->tv_sec, tv->tv_usec);*/
- if (ast_tvzero(*t)) /* not supplied, default to now */
- *t = now;
- *t = ast_tvadd(*t, ast_samp2tv(when, 1000));
-@@ -732,11 +732,11 @@ void ast_sched_dump(struct ast_sched_con
- struct timeval delta;
- q = ast_heap_peek(con->sched_heap, x);
- delta = ast_tvsub(q->when, when);
-- ast_log(LOG_DEBUG, "|%.4d | %-15p | %-15p | %.6ld : %.6ld |\n",
-+ ast_log(LOG_DEBUG, "|%.4d | %-15p | %-15p | %.6jd : %.6ld |\n",
- q->sched_id->id,
- q->callback,
- q->data,
-- (long)delta.tv_sec,
-+ (intmax_t)delta.tv_sec,
- (long int)delta.tv_usec);
- }
- ast_mutex_unlock(&con->lock);
diff --git a/comms/asterisk15/patches/patch-main_stdtime_localtime.c b/comms/asterisk15/patches/patch-main_stdtime_localtime.c
deleted file mode 100644
index c11f6dd4a42..00000000000
--- a/comms/asterisk15/patches/patch-main_stdtime_localtime.c
+++ /dev/null
@@ -1,147 +0,0 @@
-$NetBSD: patch-main_stdtime_localtime.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/stdtime/localtime.c.orig 2018-05-01 20:12:26.000000000 +0000
-+++ main/stdtime/localtime.c
-@@ -65,6 +65,10 @@
- #include <sys/stat.h>
- #include <fcntl.h>
- #endif
-+#ifdef __sun
-+#include <time.h>
-+#include <xlocale.h>
-+#endif
-
- #include "private.h"
- #include "tzfile.h"
-@@ -74,6 +78,7 @@
- #include "asterisk/localtime.h"
- #include "asterisk/strings.h"
- #include "asterisk/linkedlists.h"
-+#include "asterisk/autoconfig.h"
- #include "asterisk/utils.h"
- #include "asterisk/test.h"
-
-@@ -310,7 +315,7 @@ static struct state * sstate_alloc(void)
- static void sstate_free(struct state *p);
-
- static AST_LIST_HEAD_STATIC(zonelist, state);
--#if defined(HAVE_NEWLOCALE) && defined(HAVE_USELOCALE)
-+#if defined(HAVE_NEWLOCALE) && (defined(HAVE_USELOCALE) || HAVE_STRFTIME_L || HAVE_STRPTIME_L)
- static AST_LIST_HEAD_STATIC(localelist, locale_entry);
- #endif
-
-@@ -731,7 +736,7 @@ static void *notify_daemon(void *data)
- if (st.st_mtime > cur->mtime[0] || lst.st_mtime > cur->mtime[1]) {
- #ifdef TEST_FRAMEWORK
- if (test) {
-- ast_test_status_update(test, "Removing cached TZ entry '%s' because underlying file changed. (%ld != %ld) or (%ld != %ld)\n", name, st.st_mtime, cur->mtime[0], lst.st_mtime, cur->mtime[1]);
-+ ast_test_status_update(test, "Removing cached TZ entry '%s' because underlying file changed. (%jd != %jd) or (%jd != %jd)\n", name, (intmax_t)st.st_mtime, (intmax_t)cur->mtime[0], (intmax_t)lst.st_mtime, (intmax_t)cur->mtime[1]);
- } else
- #endif
- {
-@@ -2362,7 +2367,8 @@ struct timeval ast_mktime(struct ast_tm
- return time1(tmp, localsub, 0L, sp);
- }
-
--#if defined(HAVE_NEWLOCALE) && defined(HAVE_USELOCALE)
-+#if defined(HAVE_NEWLOCALE) && (defined(HAVE_USELOCALE) || HAVE_STRFTIME_L || HAVE_STRPTIME_L)
-+#if defined HAVE_USELOCALE
- static struct locale_entry *find_by_locale(locale_t locale)
- {
- struct locale_entry *cur;
-@@ -2373,6 +2379,7 @@ static struct locale_entry *find_by_loca
- }
- return NULL;
- }
-+#endif
-
- static struct locale_entry *find_by_name(const char *name)
- {
-@@ -2385,6 +2392,23 @@ static struct locale_entry *find_by_name
- return NULL;
- }
-
-+#if HAVE_STRFTIME_L || HAVE_STRPTIME_L
-+static locale_t ast_getlocale(const char *locale)
-+{
-+ struct locale_entry *cur;
-+
-+ AST_LIST_LOCK(&localelist);
-+ if ((cur = find_by_name(locale)) == NULL) {
-+ cur->locale = newlocale(LC_ALL_MASK, locale, NULL);
-+ strcpy(cur->name, locale); /* SAFE */
-+ AST_LIST_INSERT_TAIL(&localelist, cur, list);
-+ }
-+ AST_LIST_UNLOCK(&localelist);
-+ return cur->locale;
-+}
-+#endif
-+
-+#if !HAVE_STRFTIME_L || !HAVE_STRPTIME_L
- static const char *store_by_locale(locale_t prevlocale)
- {
- struct locale_entry *cur;
-@@ -2442,6 +2466,7 @@ const char *ast_setlocale(const char *lo
- AST_LIST_UNLOCK(&localelist);
- return store_by_locale(prevlocale);
- }
-+#endif
- #else
- const char *ast_setlocale(const char *unused)
- {
-@@ -2455,7 +2480,9 @@ int ast_strftime_locale(char *buf, size_
- char *format = ast_calloc(1, fmtlen), *fptr = format, *newfmt;
- int decimals = -1, i, res;
- long fraction;
-+#if !HAVE_STRFTIME_L
- const char *prevlocale;
-+#endif
-
- buf[0] = '\0';/* Ensure the buffer is initialized. */
- if (!format) {
-@@ -2510,6 +2537,14 @@ defcase: *fptr++ = *tmp;
- }
- *fptr = '\0';
- #undef strftime
-+#if HAVE_STRFTIME_L
-+ if (locale) {
-+ locale_t l = ast_getlocale(locale);
-+ res = (int)strftime_l(buf, len, format, (struct tm *)tm, l);
-+ } else {
-+ res = (int)strftime(buf, len, format, (struct tm *)tm);
-+ }
-+#else
- if (locale) {
- prevlocale = ast_setlocale(locale);
- }
-@@ -2517,6 +2552,7 @@ defcase: *fptr++ = *tmp;
- if (locale) {
- ast_setlocale(prevlocale);
- }
-+#endif
- ast_free(format);
- return res;
- }
-@@ -2530,11 +2566,22 @@ char *ast_strptime_locale(const char *s,
- {
- struct tm tm2 = { 0, };
- char *res;
-+#if !HAVE_STRPTIME_L
- const char *prevlocale;
-+#endif
-
-+#if HAVE_STRPTIME_L
-+ if (locale) {
-+ locale_t l = ast_getlocale(locale);
-+ res = strptime_l(s, format, &tm2, l);
-+ } else {
-+ res = strptime(s, format, &tm2);
-+ }
-+#else
- prevlocale = ast_setlocale(locale);
- res = strptime(s, format, &tm2);
- ast_setlocale(prevlocale);
-+#endif
- /* ast_time and tm are not the same size - tm is a subset of
- * ast_time. Hence, the size of tm needs to be used for the
- * memcpy
diff --git a/comms/asterisk15/patches/patch-main_tdd.c b/comms/asterisk15/patches/patch-main_tdd.c
deleted file mode 100644
index 75d6a73950f..00000000000
--- a/comms/asterisk15/patches/patch-main_tdd.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-main_tdd.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/tdd.c.orig 2018-05-07 17:30:59.571540797 +0000
-+++ main/tdd.c
-@@ -313,7 +313,7 @@ int tdd_generate(struct tdd_state *tdd,
- if ( (tdd->charnum++) % 72 == 0)
- PUT_TDD(tdd->mode ? 27 /* FIGS */ : 31 /* LTRS */);
-
-- c = toupper(str[x]);
-+ c = toupper((unsigned char)str[x]);
- #if 0
- printf("%c",c); fflush(stdout);
- #endif
diff --git a/comms/asterisk15/patches/patch-main_test.c b/comms/asterisk15/patches/patch-main_test.c
deleted file mode 100644
index a0b2767bb09..00000000000
--- a/comms/asterisk15/patches/patch-main_test.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-main_test.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/test.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ main/test.c
-@@ -975,7 +975,7 @@ static char *test_cli_generate_results(s
- if (!(buf = ast_str_create(256))) {
- return NULL;
- }
-- ast_str_set(&buf, 0, "%s/asterisk_test_results-%ld.%s", ast_config_AST_LOG_DIR, (long) time.tv_sec, type);
-+ ast_str_set(&buf, 0, "%s/asterisk_test_results-%jd.%s", ast_config_AST_LOG_DIR, (intmax_t) time.tv_sec, type);
-
- file = ast_str_buffer(buf);
- }
diff --git a/comms/asterisk15/patches/patch-main_utils.c b/comms/asterisk15/patches/patch-main_utils.c
deleted file mode 100644
index 45389fe486d..00000000000
--- a/comms/asterisk15/patches/patch-main_utils.c
+++ /dev/null
@@ -1,60 +0,0 @@
-$NetBSD: patch-main_utils.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- main/utils.c.orig 2018-05-01 20:12:26.000000000 +0000
-+++ main/utils.c
-@@ -39,6 +39,10 @@
- #elif defined(HAVE_SYS_THR_H)
- #include <sys/thr.h>
- #endif
-+#if defined(HAVE_GETIFADDRS)
-+#include <ifaddrs.h>
-+#include <net/if_dl.h>
-+#endif
-
- #include "asterisk/network.h"
- #include "asterisk/ast_version.h"
-@@ -204,7 +208,7 @@ struct hostent *ast_gethostbyname(const
- while (s && *s) {
- if (*s == '.')
- dots++;
-- else if (!isdigit(*s))
-+ else if (!isdigit((unsigned char)*s))
- break;
- s++;
- }
-@@ -612,7 +616,7 @@ const char *ast_inet_ntoa(struct in_addr
-
- static int dev_urandom_fd = -1;
-
--#ifndef __linux__
-+#if !defined(__linux__) && !defined(__DragonFly__)
- #undef pthread_create /* For ast_pthread_create function only */
- #endif /* !__linux__ */
-
-@@ -1820,13 +1824,13 @@ int ast_false(const char *s)
- static struct timeval tvfix(struct timeval a)
- {
- if (a.tv_usec >= ONE_MILLION) {
-- ast_log(LOG_WARNING, "warning too large timestamp %ld.%ld\n",
-- (long)a.tv_sec, (long int) a.tv_usec);
-+ ast_log(LOG_WARNING, "warning too large timestamp %jd.%ld\n",
-+ (intmax_t)a.tv_sec, (long int) a.tv_usec);
- a.tv_sec += a.tv_usec / ONE_MILLION;
- a.tv_usec %= ONE_MILLION;
- } else if (a.tv_usec < 0) {
-- ast_log(LOG_WARNING, "warning negative timestamp %ld.%ld\n",
-- (long)a.tv_sec, (long int) a.tv_usec);
-+ ast_log(LOG_WARNING, "warning negative timestamp %jd.%ld\n",
-+ (intmax_t)a.tv_sec, (long int) a.tv_usec);
- a.tv_usec = 0;
- }
- return a;
-@@ -1986,7 +1990,7 @@ char *ast_to_camel_case_delim(const char
-
- while (front) {
- size = strlen(front);
-- *front = toupper(*front);
-+ *front = toupper((unsigned char)*front);
- ast_copy_string(buf, front, size + 1);
- buf += size;
- front = strtok_r(NULL, delim, &back);
diff --git a/comms/asterisk15/patches/patch-menuselect_menuselect.c b/comms/asterisk15/patches/patch-menuselect_menuselect.c
deleted file mode 100644
index b91bf5c28bb..00000000000
--- a/comms/asterisk15/patches/patch-menuselect_menuselect.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-menuselect_menuselect.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- menuselect/menuselect.c.orig 2018-05-07 17:13:49.312815875 +0000
-+++ menuselect/menuselect.c
-@@ -1461,7 +1461,7 @@ static int generate_makedeps_file(void)
- }
-
- for (c = dep->name; *c; c++)
-- fputc(toupper(*c), f);
-+ fputc(toupper((unsigned char)*c), f);
- fputc(' ', f);
- }
- AST_LIST_TRAVERSE(&mem->uses, use, list) {
-@@ -1477,7 +1477,7 @@ static int generate_makedeps_file(void)
- }
-
- for (c = use->name; *c; c++)
-- fputc(toupper(*c), f);
-+ fputc(toupper((unsigned char)*c), f);
- fputc(' ', f);
- }
-
diff --git a/comms/asterisk15/patches/patch-pbx_pbx__config.c b/comms/asterisk15/patches/patch-pbx_pbx__config.c
deleted file mode 100644
index e24dd64b0d8..00000000000
--- a/comms/asterisk15/patches/patch-pbx_pbx__config.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-pbx_pbx__config.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- pbx/pbx_config.c.orig 2018-05-07 17:17:05.322793470 +0000
-+++ pbx/pbx_config.c
-@@ -237,7 +237,7 @@ static const char *skip_words(const char
- {
- int in_blank = 0;
- for (;n && *p; p++) {
-- if (isblank(*p) /* XXX order is important */ && !in_blank) {
-+ if (isblank((unsigned char)*p) /* XXX order is important */ && !in_blank) {
- n--; /* one word is gone */
- in_blank = 1;
- } else if (/* !is_blank(*p), we know already, && */ in_blank) {
-@@ -447,7 +447,7 @@ static char *handle_cli_dialplan_remove_
- if (!strcmp("hint", c))
- removing_priority = PRIORITY_HINT;
- else {
-- while (*c && isdigit(*c))
-+ while (*c && isdigit((unsigned char)*c))
- c++;
- if (*c) { /* non-digit in string */
- ast_cli(a->fd, "Invalid priority '%s'\n", a->argv[4]);
diff --git a/comms/asterisk15/patches/patch-pbx_pbx__dundi.c b/comms/asterisk15/patches/patch-pbx_pbx__dundi.c
deleted file mode 100644
index 4e58e60b33a..00000000000
--- a/comms/asterisk15/patches/patch-pbx_pbx__dundi.c
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-pbx_pbx__dundi.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- pbx/pbx_dundi.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ pbx/pbx_dundi.c
-@@ -47,7 +47,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
- #include <pthread.h>
- #include <net/if.h>
-
--#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__Darwin__)
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__Darwin__) || defined(__DragonFly__)
- #include <net/if_dl.h>
- #include <ifaddrs.h>
- #include <signal.h>
-@@ -885,7 +885,7 @@ static int cache_save_hint(dundi_eid *ei
-
- time(&timeout);
- timeout += expiration;
-- snprintf(data, sizeof(data), "%ld|", (long)(timeout));
-+ snprintf(data, sizeof(data), "%jd|", (intmax_t)(timeout));
-
- ast_db_put("dundi/cache", key1, data);
- ast_debug(1, "Caching hint at '%s'\n", key1);
-@@ -921,7 +921,7 @@ static int cache_save(dundi_eid *eidpeer
- /* Build request string */
- time(&timeout);
- timeout += expiration;
-- snprintf(data, sizeof(data), "%ld|", (long)(timeout));
-+ snprintf(data, sizeof(data), "%jd|", (intmax_t)(timeout));
- for (x=start;x<req->respcount;x++) {
- /* Skip anything with an illegal pipe in it */
- if (strchr(req->dr[x].dest, '|'))
-@@ -2166,7 +2166,7 @@ static void check_password(void)
-
- time(&now);
- #if 0
-- printf("%ld/%ld\n", now, rotatetime);
-+ printf("%jd/%jd\n", now, rotatetime);
- #endif
- if ((now - rotatetime) >= 0) {
- /* Time to rotate keys */
diff --git a/comms/asterisk15/patches/patch-res_ael_pval.c b/comms/asterisk15/patches/patch-res_ael_pval.c
deleted file mode 100644
index 317862f3d23..00000000000
--- a/comms/asterisk15/patches/patch-res_ael_pval.c
+++ /dev/null
@@ -1,41 +0,0 @@
-$NetBSD: patch-res_ael_pval.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/ael/pval.c.orig 2018-05-07 17:37:44.116772314 +0000
-+++ res/ael/pval.c
-@@ -855,7 +855,7 @@ static void check_timerange(pval *p)
- }
- *e = '\0';
- e++;
-- while (*e && !isdigit(*e))
-+ while (*e && !isdigit((unsigned char)*e))
- e++;
- if (!*e) {
- ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: The time range format (%s) is missing the end time!\n",
-@@ -3531,11 +3531,11 @@ static int gen_prios(struct ael_extensio
- for_init->appargs = strdup(buf2);
- } else {
- strp2 = p->u1.for_init;
-- while (*strp2 && isspace(*strp2))
-+ while (*strp2 && isspace((unsigned char)*strp2))
- strp2++;
- if (*strp2 == '&') { /* itsa macro call */
- char *strp3 = strp2+1;
-- while (*strp3 && isspace(*strp3))
-+ while (*strp3 && isspace((unsigned char)*strp3))
- strp3++;
- strcpy(buf2, strp3);
- strp3 = strchr(buf2,'(');
-@@ -3581,11 +3581,11 @@ static int gen_prios(struct ael_extensio
- for_inc->app = strdup("MSet");
- } else {
- strp2 = p->u3.for_inc;
-- while (*strp2 && isspace(*strp2))
-+ while (*strp2 && isspace((unsigned char)*strp2))
- strp2++;
- if (*strp2 == '&') { /* itsa macro call */
- char *strp3 = strp2+1;
-- while (*strp3 && isspace(*strp3))
-+ while (*strp3 && isspace((unsigned char)*strp3))
- strp3++;
- strcpy(buf2, strp3);
- strp3 = strchr(buf2,'(');
diff --git a/comms/asterisk15/patches/patch-res_res__calendar.c b/comms/asterisk15/patches/patch-res_res__calendar.c
deleted file mode 100644
index 3bba5125a00..00000000000
--- a/comms/asterisk15/patches/patch-res_res__calendar.c
+++ /dev/null
@@ -1,37 +0,0 @@
-$NetBSD: patch-res_res__calendar.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_calendar.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ res/res_calendar.c
-@@ -1245,7 +1245,7 @@ static int calendar_query_exec(struct as
- i = ao2_iterator_init(cal->events, 0);
- while ((event = ao2_iterator_next(&i))) {
- if (!(start > event->end || end < event->start)) {
-- ast_debug(10, "%s (%ld - %ld) overlapped with (%ld - %ld)\n", event->summary, (long) event->start, (long) event->end, (long) start, (long) end);
-+ ast_debug(10, "%s (%jd - %jd) overlapped with (%jd - %jd)\n", event->summary, (intmax_t) event->start, (intmax_t) event->end, (intmax_t) start, (intmax_t) end);
- if (add_event_to_list(events, event, start, end) < 0) {
- event = ast_calendar_unref_event(event);
- cal = unref_calendar(cal);
-@@ -1378,9 +1378,9 @@ static int calendar_query_result_exec(st
- } else if (!strcasecmp(args.field, "uid")) {
- ast_copy_string(buf, entry->event->uid, len);
- } else if (!strcasecmp(args.field, "start")) {
-- snprintf(buf, len, "%ld", (long) entry->event->start);
-+ snprintf(buf, len, "%jd", (intmax_t) entry->event->start);
- } else if (!strcasecmp(args.field, "end")) {
-- snprintf(buf, len, "%ld", (long) entry->event->end);
-+ snprintf(buf, len, "%jd", (intmax_t) entry->event->end);
- } else if (!strcasecmp(args.field, "busystate")) {
- snprintf(buf, len, "%u", entry->event->busy_state);
- } else if (!strcasecmp(args.field, "attendees")) {
-@@ -1739,9 +1739,9 @@ static int calendar_event_read(struct as
- } else if (!strcasecmp(data, "uid")) {
- ast_copy_string(buf, event->uid, len);
- } else if (!strcasecmp(data, "start")) {
-- snprintf(buf, len, "%ld", (long)event->start);
-+ snprintf(buf, len, "%jd", (intmax_t)event->start);
- } else if (!strcasecmp(data, "end")) {
-- snprintf(buf, len, "%ld", (long)event->end);
-+ snprintf(buf, len, "%jd", (intmax_t)event->end);
- } else if (!strcasecmp(data, "busystate")) {
- snprintf(buf, len, "%u", event->busy_state);
- } else if (!strcasecmp(data, "attendees")) {
diff --git a/comms/asterisk15/patches/patch-res_res__calendar__caldav.c b/comms/asterisk15/patches/patch-res_res__calendar__caldav.c
deleted file mode 100644
index 99101fff4b0..00000000000
--- a/comms/asterisk15/patches/patch-res_res__calendar__caldav.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-res_res__calendar__caldav.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_calendar_caldav.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ res/res_calendar_caldav.c
-@@ -404,7 +404,7 @@ static void caldav_add_event(icalcompone
- ast_string_field_set(event, uid, event->summary);
- } else {
- char tmp[100];
-- snprintf(tmp, sizeof(tmp), "%ld", event->start);
-+ snprintf(tmp, sizeof(tmp), "%jd", (intmax_t)event->start);
- ast_string_field_set(event, uid, tmp);
- }
- }
diff --git a/comms/asterisk15/patches/patch-res_res__calendar__icalendar.c b/comms/asterisk15/patches/patch-res_res__calendar__icalendar.c
deleted file mode 100644
index 6fe4a09b489..00000000000
--- a/comms/asterisk15/patches/patch-res_res__calendar__icalendar.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-res_res__calendar__icalendar.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_calendar_icalendar.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ res/res_calendar_icalendar.c
-@@ -246,7 +246,7 @@ static void icalendar_add_event(icalcomp
- ast_string_field_set(event, uid, event->summary);
- } else {
- char tmp[100];
-- snprintf(tmp, sizeof(tmp), "%ld", event->start);
-+ snprintf(tmp, sizeof(tmp), "%jd", (intmax_t)event->start);
- ast_string_field_set(event, uid, tmp);
- }
- }
diff --git a/comms/asterisk15/patches/patch-res_res__hep__pjsip.c b/comms/asterisk15/patches/patch-res_res__hep__pjsip.c
deleted file mode 100644
index 4b6b1560383..00000000000
--- a/comms/asterisk15/patches/patch-res_res__hep__pjsip.c
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-res_res__hep__pjsip.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_hep_pjsip.c.orig 2018-06-20 15:24:25.999288749 +0000
-+++ res/res_hep_pjsip.c
-@@ -34,6 +34,9 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+#include "asterisk/netsock2.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
- #include <pjlib.h>
-@@ -41,8 +44,6 @@
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
- #include "asterisk/res_hep.h"
--#include "asterisk/module.h"
--#include "asterisk/netsock2.h"
-
- static char *assign_uuid(const pj_str_t *call_id, const pj_str_t *local_tag, const pj_str_t *remote_tag)
- {
diff --git a/comms/asterisk15/patches/patch-res_res__limit.c b/comms/asterisk15/patches/patch-res_res__limit.c
deleted file mode 100644
index f6eb15ea5c0..00000000000
--- a/comms/asterisk15/patches/patch-res_res__limit.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-res_res__limit.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_limit.c.orig 2018-05-07 17:38:31.944908572 +0000
-+++ res/res_limit.c
-@@ -191,7 +191,7 @@ static char *handle_cli_ulimit(struct as
- else
- snprintf(printlimit, sizeof(printlimit), "limited to %d", (int) rlimit.rlim_cur);
- desc = str2desc(a->argv[1]);
-- ast_cli(a->fd, "%c%s (%s) is %s.\n", toupper(desc[0]), desc + 1, a->argv[1], printlimit);
-+ ast_cli(a->fd, "%c%s (%s) is %s.\n", toupper((unsigned char)desc[0]), desc + 1, a->argv[1], printlimit);
- } else
- ast_cli(a->fd, "Could not retrieve resource limits for %s: %s\n", str2desc(a->argv[1]), strerror(errno));
- return CLI_SUCCESS;
diff --git a/comms/asterisk15/patches/patch-res_res__musiconhold.c b/comms/asterisk15/patches/patch-res_res__musiconhold.c
deleted file mode 100644
index 97ef6fa3c8f..00000000000
--- a/comms/asterisk15/patches/patch-res_res__musiconhold.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-res_res__musiconhold.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_musiconhold.c.orig 2018-05-07 17:40:09.242361670 +0000
-+++ res/res_musiconhold.c
-@@ -1071,7 +1071,7 @@ static void moh_parse_options(struct ast
- ast_copy_string(mohclass->dir, var->value, sizeof(mohclass->dir));
- } else if (!strcasecmp(var->name, "application")) {
- ast_copy_string(mohclass->args, var->value, sizeof(mohclass->args));
-- } else if (!strcasecmp(var->name, "digit") && (isdigit(*var->value) || strchr("*#", *var->value))) {
-+ } else if (!strcasecmp(var->name, "digit") && (isdigit((unsigned char)*var->value) || strchr("*#", *var->value))) {
- mohclass->digit = *var->value;
- } else if (!strcasecmp(var->name, "random")) {
- static int deprecation_warning = 0;
-@@ -1771,7 +1771,7 @@ static int load_moh_classes(int reload)
- } else if (!strcasecmp(var->name, "announcement")) {
- ast_copy_string(class->announcement, var->value, sizeof(class->announcement));
- ast_set_flag(class, MOH_ANNOUNCEMENT);
-- } else if (!strcasecmp(var->name, "digit") && (isdigit(*var->value) || strchr("*#", *var->value))) {
-+ } else if (!strcasecmp(var->name, "digit") && (isdigit((unsigned char)*var->value) || strchr("*#", *var->value))) {
- class->digit = *var->value;
- } else if (!strcasecmp(var->name, "random")) {
- ast_set2_flag(class, ast_true(var->value), MOH_RANDOMIZE);
diff --git a/comms/asterisk15/patches/patch-res_res__pjproject.c b/comms/asterisk15/patches/patch-res_res__pjproject.c
deleted file mode 100644
index d0746409cef..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjproject.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-res_res__pjproject.c,v 1.2 2021/01/17 08:32:40 jnemeth Exp $
-
---- res/res_pjproject.c.orig 2019-09-05 13:09:20.000000000 +0000
-+++ res/res_pjproject.c
-@@ -99,20 +99,22 @@
- #include "asterisk.h"
-
- #include <stdarg.h>
--#include <pjlib.h>
--#include <pjsip.h>
--#include <pj/log.h>
-
- #include "asterisk/options.h"
- #include "asterisk/logger.h"
- #include "asterisk/module.h"
- #include "asterisk/cli.h"
--#include "asterisk/res_pjproject.h"
- #include "asterisk/vector.h"
- #include "asterisk/sorcery.h"
- #include "asterisk/test.h"
- #include "asterisk/netsock2.h"
-
-+#include <pjlib.h>
-+#include <pjsip.h>
-+#include <pj/log.h>
-+
-+#include "asterisk/res_pjproject.h"
-+
- static struct ast_sorcery *pjproject_sorcery;
- static pj_log_func *log_cb_orig;
- static unsigned decor_orig;
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip.c b/comms/asterisk15/patches/patch-res_res__pjsip.c
deleted file mode 100644
index 0071e16fc94..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip.c
+++ /dev/null
@@ -1,42 +0,0 @@
-$NetBSD: patch-res_res__pjsip.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip.c.orig 2018-06-20 15:00:27.990234837 +0000
-+++ res/res_pjsip.c
-@@ -18,16 +18,6 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--/* Needed for SUBSCRIBE, NOTIFY, and PUBLISH method definitions */
--#include <pjsip_simple.h>
--#include <pjsip/sip_transaction.h>
--#include <pj/timer.h>
--#include <pjlib.h>
--#include <pjmedia/errno.h>
--
--#include "asterisk/res_pjsip.h"
--#include "res_pjsip/include/res_pjsip_private.h"
- #include "asterisk/linkedlists.h"
- #include "asterisk/logger.h"
- #include "asterisk/lock.h"
-@@ -40,8 +30,19 @@
- #include "asterisk/sorcery.h"
- #include "asterisk/file.h"
- #include "asterisk/cli.h"
--#include "asterisk/res_pjsip_cli.h"
- #include "asterisk/test.h"
-+
-+#include <pjsip.h>
-+/* Needed for SUBSCRIBE, NOTIFY, and PUBLISH method definitions */
-+#include <pjsip_simple.h>
-+#include <pjsip/sip_transaction.h>
-+#include <pj/timer.h>
-+#include <pjlib.h>
-+#include <pjmedia/errno.h>
-+
-+#include "asterisk/res_pjsip.h"
-+#include "res_pjsip/include/res_pjsip_private.h"
-+#include "asterisk/res_pjsip_cli.h"
- #include "asterisk/res_pjsip_presence_xml.h"
- #include "asterisk/res_pjproject.h"
-
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__acl.c b/comms/asterisk15/patches/patch-res_res__pjsip__acl.c
deleted file mode 100644
index 354a4ae5376..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__acl.c
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-res_res__pjsip__acl.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_acl.c.orig 2018-06-20 14:56:24.968342681 +0000
-+++ res/res_pjsip_acl.c
-@@ -24,14 +24,15 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--
--#include "asterisk/res_pjsip.h"
- #include "asterisk/module.h"
- #include "asterisk/logger.h"
- #include "asterisk/sorcery.h"
- #include "asterisk/acl.h"
-
-+#include <pjsip.h>
-+
-+#include "asterisk/res_pjsip.h"
-+
- /*** DOCUMENTATION
- <configInfo name="res_pjsip_acl" language="en_US">
- <synopsis>SIP ACL module</synopsis>
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__authenticator__digest.c b/comms/asterisk15/patches/patch-res_res__pjsip__authenticator__digest.c
deleted file mode 100644
index 925d3cf2def..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__authenticator__digest.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-res_res__pjsip__authenticator__digest.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_authenticator_digest.c.orig 2018-06-20 15:24:04.208176916 +0000
-+++ res/res_pjsip_authenticator_digest.c
-@@ -18,13 +18,14 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--
--#include "asterisk/res_pjsip.h"
- #include "asterisk/logger.h"
- #include "asterisk/module.h"
- #include "asterisk/strings.h"
-
-+#include <pjsip.h>
-+
-+#include "asterisk/res_pjsip.h"
-+
- /*** MODULEINFO
- <depend>pjproject</depend>
- <depend>res_pjsip</depend>
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__caller__id.c b/comms/asterisk15/patches/patch-res_res__pjsip__caller__id.c
deleted file mode 100644
index 266ba0b78e0..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__caller__id.c
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-res_res__pjsip__caller__id.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_caller_id.c.orig 2018-06-20 14:54:36.848214785 +0000
-+++ res/res_pjsip_caller_id.c
-@@ -25,14 +25,15 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/channel.h"
-+#include "asterisk/module.h"
-+#include "asterisk/callerid.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
-
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
--#include "asterisk/channel.h"
--#include "asterisk/module.h"
--#include "asterisk/callerid.h"
-
- /*!
- * \internal
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__config__wizard.c b/comms/asterisk15/patches/patch-res_res__pjsip__config__wizard.c
deleted file mode 100644
index f68cab134a8..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__config__wizard.c
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-res_res__pjsip__config__wizard.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_config_wizard.c.orig 2018-06-20 15:24:53.691223999 +0000
-+++ res/res_pjsip_config_wizard.c
-@@ -40,16 +40,18 @@
- #include "asterisk.h"
-
- #include <regex.h>
--#include <pjsip.h>
-
- #include "asterisk/astobj2.h"
- #include "asterisk/cli.h"
--#include "asterisk/res_pjsip.h"
- #include "asterisk/module.h"
- #include "asterisk/pbx.h"
- #include "asterisk/sorcery.h"
- #include "asterisk/vector.h"
-
-+#include <pjsip.h>
-+
-+#include "asterisk/res_pjsip.h"
-+
- /*** DOCUMENTATION
- <configInfo name="res_pjsip_config_wizard" language="en_US">
- <synopsis>Module that privides simple configuration wizard capabilities.</synopsis>
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__dialog__info__body__generator.c b/comms/asterisk15/patches/patch-res_res__pjsip__dialog__info__body__generator.c
deleted file mode 100644
index 057eb4ec577..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__dialog__info__body__generator.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-res_res__pjsip__dialog__info__body__generator.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_dialog_info_body_generator.c.orig 2018-06-20 15:26:57.623918703 +0000
-+++ res/res_pjsip_dialog_info_body_generator.c
-@@ -26,11 +26,12 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+
- #include <pjsip.h>
- #include <pjsip_simple.h>
- #include <pjlib.h>
-
--#include "asterisk/module.h"
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_pubsub.h"
- #include "asterisk/res_pjsip_presence_xml.h"
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__diversion.c b/comms/asterisk15/patches/patch-res_res__pjsip__diversion.c
deleted file mode 100644
index dee6b26789c..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__diversion.c
+++ /dev/null
@@ -1,34 +0,0 @@
-$NetBSD: patch-res_res__pjsip__diversion.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_diversion.c.orig 2018-06-11 21:21:37.000000000 +0000
-+++ res/res_pjsip_diversion.c
-@@ -25,15 +25,16 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/callerid.h"
-+#include "asterisk/channel.h"
-+#include "asterisk/module.h"
-+#include "asterisk/strings.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
-
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
--#include "asterisk/callerid.h"
--#include "asterisk/channel.h"
--#include "asterisk/module.h"
--#include "asterisk/strings.h"
-
- static const pj_str_t diversion_name = { "Diversion", 9 };
-
-@@ -59,7 +60,7 @@ static int sip_is_token(const char *str)
-
- is_token = 1;
- do {
-- if (!isalnum(*str)
-+ if (!isalnum((unsigned char)*str)
- && !strchr("-.!%*_+`'~", *str)) {
- /* The character is not allowed in a token. */
- is_token = 0;
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__dlg__options.c b/comms/asterisk15/patches/patch-res_res__pjsip__dlg__options.c
deleted file mode 100644
index 8b67205af24..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__dlg__options.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-res_res__pjsip__dlg__options.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_dlg_options.c.orig 2018-06-20 14:45:17.495724166 +0000
-+++ res/res_pjsip_dlg_options.c
-@@ -25,11 +25,12 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
- #include <pjlib.h>
-
--#include "asterisk/module.h"
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
-
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__dtmf__info.c b/comms/asterisk15/patches/patch-res_res__pjsip__dtmf__info.c
deleted file mode 100644
index e1c93b28f56..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__dtmf__info.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-res_res__pjsip__dtmf__info.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_dtmf_info.c.orig 2018-06-20 15:18:23.473675677 +0000
-+++ res/res_pjsip_dtmf_info.c
-@@ -25,12 +25,13 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
-
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
--#include "asterisk/module.h"
-
- static int is_media_type(pjsip_rx_data *rdata, char *subtype)
- {
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__empty__info.c b/comms/asterisk15/patches/patch-res_res__pjsip__empty__info.c
deleted file mode 100644
index 5ca5276b404..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__empty__info.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-res_res__pjsip__empty__info.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_empty_info.c.orig 2018-06-20 15:17:23.874357861 +0000
-+++ res/res_pjsip_empty_info.c
-@@ -25,12 +25,13 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
-
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
--#include "asterisk/module.h"
-
- static void send_response(struct ast_sip_session *session,
- struct pjsip_rx_data *rdata, int code)
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__endpoint__identifier__anonymous.c b/comms/asterisk15/patches/patch-res_res__pjsip__endpoint__identifier__anonymous.c
deleted file mode 100644
index c6adfb06003..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__endpoint__identifier__anonymous.c
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-res_res__pjsip__endpoint__identifier__anonymous.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_endpoint_identifier_anonymous.c.orig 2018-06-20 14:51:13.694673514 +0000
-+++ res/res_pjsip_endpoint_identifier_anonymous.c
-@@ -24,11 +24,11 @@
- ***/
-
- #include "asterisk.h"
-+#include "asterisk/module.h"
-
- #include <pjsip.h>
-
- #include "asterisk/res_pjsip.h"
--#include "asterisk/module.h"
-
- static int get_endpoint_details(pjsip_rx_data *rdata, char *domain, size_t domain_size)
- {
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__endpoint__identifier__ip.c b/comms/asterisk15/patches/patch-res_res__pjsip__endpoint__identifier__ip.c
deleted file mode 100644
index a0c48d983bb..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__endpoint__identifier__ip.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-res_res__pjsip__endpoint__identifier__ip.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_endpoint_identifier_ip.c.orig 2018-06-20 14:53:35.046125088 +0000
-+++ res/res_pjsip_endpoint_identifier_ip.c
-@@ -24,13 +24,14 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+#include "asterisk/acl.h"
-+#include "asterisk/manager.h"
-+
- #include <pjsip.h>
-
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_cli.h"
--#include "asterisk/module.h"
--#include "asterisk/acl.h"
--#include "asterisk/manager.h"
- #include "res_pjsip/include/res_pjsip_private.h"
-
- /*** DOCUMENTATION
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__endpoint__identifier__user.c b/comms/asterisk15/patches/patch-res_res__pjsip__endpoint__identifier__user.c
deleted file mode 100644
index 65ddb2148e7..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__endpoint__identifier__user.c
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-res_res__pjsip__endpoint__identifier__user.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_endpoint_identifier_user.c.orig 2018-06-20 15:14:17.549119230 +0000
-+++ res/res_pjsip_endpoint_identifier_user.c
-@@ -24,10 +24,11 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+
- #include <pjsip.h>
-
- #include "asterisk/res_pjsip.h"
--#include "asterisk/module.h"
-
- static int get_from_header(pjsip_rx_data *rdata, char *username, size_t username_size, char *domain, size_t domain_size)
- {
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__exten__state.c b/comms/asterisk15/patches/patch-res_res__pjsip__exten__state.c
deleted file mode 100644
index 37e2be65f65..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__exten__state.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-res_res__pjsip__exten__state.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_exten_state.c.orig 2018-06-20 15:27:23.695134703 +0000
-+++ res/res_pjsip_exten_state.c
-@@ -28,6 +28,13 @@
-
- #include <regex.h>
-
-+#include "asterisk/module.h"
-+#include "asterisk/logger.h"
-+#include "asterisk/astobj2.h"
-+#include "asterisk/sorcery.h"
-+#include "asterisk/app.h"
-+#include "asterisk/taskprocessor.h"
-+
- #include <pjsip.h>
- #include <pjsip_simple.h>
- #include <pjlib.h>
-@@ -36,12 +43,6 @@
- #include "asterisk/res_pjsip_outbound_publish.h"
- #include "asterisk/res_pjsip_pubsub.h"
- #include "asterisk/res_pjsip_body_generator_types.h"
--#include "asterisk/module.h"
--#include "asterisk/logger.h"
--#include "asterisk/astobj2.h"
--#include "asterisk/sorcery.h"
--#include "asterisk/app.h"
--#include "asterisk/taskprocessor.h"
-
- #define BODY_SIZE 1024
- #define EVENT_TYPE_SIZE 50
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__header__funcs.c b/comms/asterisk15/patches/patch-res_res__pjsip__header__funcs.c
deleted file mode 100644
index a4384ea35a1..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__header__funcs.c
+++ /dev/null
@@ -1,28 +0,0 @@
-$NetBSD: patch-res_res__pjsip__header__funcs.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_header_funcs.c.orig 2018-06-20 14:59:36.015809914 +0000
-+++ res/res_pjsip_header_funcs.c
-@@ -25,17 +25,18 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjsip_ua.h>
--
--#include "asterisk/res_pjsip.h"
--#include "asterisk/res_pjsip_session.h"
- #include "asterisk/channel.h"
- #include "asterisk/pbx.h"
- #include "asterisk/app.h"
- #include "asterisk/module.h"
- #include "asterisk/utils.h"
-
-+#include <pjsip.h>
-+#include <pjsip_ua.h>
-+
-+#include "asterisk/res_pjsip.h"
-+#include "asterisk/res_pjsip_session.h"
-+
- /*** DOCUMENTATION
- <function name="PJSIP_HEADER" language="en_US">
- <synopsis>
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__history.c b/comms/asterisk15/patches/patch-res_res__pjsip__history.c
deleted file mode 100644
index 9defbc51676..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__history.c
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-res_res__pjsip__history.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_history.c.orig 2018-06-20 14:51:30.138834951 +0000
-+++ res/res_pjsip_history.c
-@@ -31,17 +31,18 @@
- ***/
-
- #include "asterisk.h"
--
--#include <pjsip.h>
- #include <regex.h>
-
--#include "asterisk/res_pjsip.h"
- #include "asterisk/module.h"
- #include "asterisk/logger.h"
- #include "asterisk/cli.h"
- #include "asterisk/netsock2.h"
- #include "asterisk/vector.h"
- #include "asterisk/lock.h"
-+
-+#include <pjsip.h>
-+
-+#include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjproject.h"
-
- #define HISTORY_INITIAL_SIZE 256
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__logger.c b/comms/asterisk15/patches/patch-res_res__pjsip__logger.c
deleted file mode 100644
index b28a3c1ecab..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__logger.c
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-res_res__pjsip__logger.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_logger.c.orig 2018-06-20 14:45:55.987678816 +0000
-+++ res/res_pjsip_logger.c
-@@ -25,14 +25,15 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--
--#include "asterisk/res_pjsip.h"
- #include "asterisk/module.h"
- #include "asterisk/logger.h"
- #include "asterisk/cli.h"
- #include "asterisk/netsock2.h"
-
-+#include <pjsip.h>
-+
-+#include "asterisk/res_pjsip.h"
-+
- enum pjsip_logging_mode {
- LOGGING_MODE_DISABLED, /* No logging is enabled */
- LOGGING_MODE_ENABLED, /* Logging is enabled */
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__messaging.c b/comms/asterisk15/patches/patch-res_res__pjsip__messaging.c
deleted file mode 100644
index cf21da94642..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__messaging.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-res_res__pjsip__messaging.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_messaging.c.orig 2018-06-20 14:44:43.652384305 +0000
-+++ res/res_pjsip_messaging.c
-@@ -35,14 +35,14 @@
- ***/
- #include "asterisk.h"
-
--#include "pjsua-lib/pjsua.h"
--
- #include "asterisk/message.h"
- #include "asterisk/module.h"
- #include "asterisk/pbx.h"
-+#include "asterisk/taskprocessor.h"
-+
-+#include "pjsua-lib/pjsua.h"
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
--#include "asterisk/taskprocessor.h"
-
- const pjsip_method pjsip_message_method = {PJSIP_OTHER_METHOD, {"MESSAGE", 7} };
-
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__mwi.c b/comms/asterisk15/patches/patch-res_res__pjsip__mwi.c
deleted file mode 100644
index cfd6930475c..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__mwi.c
+++ /dev/null
@@ -1,33 +0,0 @@
-$NetBSD: patch-res_res__pjsip__mwi.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_mwi.c.orig 2018-06-20 15:14:36.457639759 +0000
-+++ res/res_pjsip_mwi.c
-@@ -25,13 +25,6 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjsip_simple.h>
--#include <pjlib.h>
--
--#include "asterisk/res_pjsip.h"
--#include "asterisk/res_pjsip_pubsub.h"
--#include "asterisk/res_pjsip_body_generator_types.h"
- #include "asterisk/module.h"
- #include "asterisk/logger.h"
- #include "asterisk/astobj2.h"
-@@ -40,6 +33,14 @@
- #include "asterisk/stasis.h"
- #include "asterisk/app.h"
-
-+#include <pjsip.h>
-+#include <pjsip_simple.h>
-+#include <pjlib.h>
-+
-+#include "asterisk/res_pjsip.h"
-+#include "asterisk/res_pjsip_pubsub.h"
-+#include "asterisk/res_pjsip_body_generator_types.h"
-+
- struct mwi_subscription;
- static struct ao2_container *unsolicited_mwi;
-
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__mwi__body__generator.c b/comms/asterisk15/patches/patch-res_res__pjsip__mwi__body__generator.c
deleted file mode 100644
index ee77cdca3ec..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__mwi__body__generator.c
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-res_res__pjsip__mwi__body__generator.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_mwi_body_generator.c.orig 2018-06-20 15:23:44.066022439 +0000
-+++ res/res_pjsip_mwi_body_generator.c
-@@ -25,6 +25,9 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+#include "asterisk/strings.h"
-+
- #include <pjsip.h>
- #include <pjsip_simple.h>
- #include <pjlib.h>
-@@ -32,8 +35,6 @@
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_pubsub.h"
- #include "asterisk/res_pjsip_body_generator_types.h"
--#include "asterisk/module.h"
--#include "asterisk/strings.h"
-
- #define MWI_TYPE "application"
- #define MWI_SUBTYPE "simple-message-summary"
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__nat.c b/comms/asterisk15/patches/patch-res_res__pjsip__nat.c
deleted file mode 100644
index 8660736249b..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__nat.c
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-res_res__pjsip__nat.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_nat.c.orig 2018-06-20 15:19:15.829960259 +0000
-+++ res/res_pjsip_nat.c
-@@ -24,13 +24,14 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+#include "asterisk/acl.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
-
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
--#include "asterisk/module.h"
--#include "asterisk/acl.h"
-
- static void rewrite_uri(pjsip_rx_data *rdata, pjsip_sip_uri *uri)
- {
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__notify.c b/comms/asterisk15/patches/patch-res_res__pjsip__notify.c
deleted file mode 100644
index ec475eaf1b1..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__notify.c
+++ /dev/null
@@ -1,27 +0,0 @@
-$NetBSD: patch-res_res__pjsip__notify.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_notify.c.orig 2018-06-20 15:18:42.604587100 +0000
-+++ res/res_pjsip_notify.c
-@@ -24,17 +24,18 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjsip_ua.h>
--
- #include "asterisk/cli.h"
- #include "asterisk/config.h"
- #include "asterisk/manager.h"
- #include "asterisk/module.h"
- #include "asterisk/pbx.h"
-+#include "asterisk/sorcery.h"
-+
-+#include <pjsip.h>
-+#include <pjsip_ua.h>
-+
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
--#include "asterisk/sorcery.h"
-
- /*** DOCUMENTATION
- <manager name="PJSIPNotify" language="en_US">
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__one__touch__record__info.c b/comms/asterisk15/patches/patch-res_res__pjsip__one__touch__record__info.c
deleted file mode 100644
index f9c85a5023b..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__one__touch__record__info.c
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-res_res__pjsip__one__touch__record__info.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_one_touch_record_info.c.orig 2018-06-20 15:23:15.924284229 +0000
-+++ res/res_pjsip_one_touch_record_info.c
-@@ -25,14 +25,15 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/features.h"
-+#include "asterisk/module.h"
-+#include "asterisk/features_config.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
-
--#include "asterisk/features.h"
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
--#include "asterisk/module.h"
--#include "asterisk/features_config.h"
-
- static void send_response(struct ast_sip_session *session, int code, struct pjsip_rx_data *rdata)
- {
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__outbound__authenticator__digest.c b/comms/asterisk15/patches/patch-res_res__pjsip__outbound__authenticator__digest.c
deleted file mode 100644
index 92d41df3ab7..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__outbound__authenticator__digest.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-res_res__pjsip__outbound__authenticator__digest.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_outbound_authenticator_digest.c.orig 2018-06-20 15:22:43.400330893 +0000
-+++ res/res_pjsip_outbound_authenticator_digest.c
-@@ -24,13 +24,14 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--
--#include "asterisk/res_pjsip.h"
- #include "asterisk/logger.h"
- #include "asterisk/module.h"
- #include "asterisk/strings.h"
-
-+#include <pjsip.h>
-+
-+#include "asterisk/res_pjsip.h"
-+
- static pjsip_www_authenticate_hdr *get_auth_header(pjsip_rx_data *challenge,
- const void *start)
- {
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__outbound__publish.c b/comms/asterisk15/patches/patch-res_res__pjsip__outbound__publish.c
deleted file mode 100644
index 04743481757..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__outbound__publish.c
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-res_res__pjsip__outbound__publish.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_outbound_publish.c.orig 2018-06-20 15:25:56.444583849 +0000
-+++ res/res_pjsip_outbound_publish.c
-@@ -25,16 +25,17 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+#include "asterisk/taskprocessor.h"
-+#include "asterisk/threadpool.h"
-+#include "asterisk/datastore.h"
-+
- #include <pjsip.h>
- #include <pjsip_simple.h>
-
- #include "asterisk/res_pjproject.h"
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_outbound_publish.h"
--#include "asterisk/module.h"
--#include "asterisk/taskprocessor.h"
--#include "asterisk/threadpool.h"
--#include "asterisk/datastore.h"
- #include "res_pjsip/include/res_pjsip_private.h"
-
- /*** DOCUMENTATION
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__outbound__registration.c b/comms/asterisk15/patches/patch-res_res__pjsip__outbound__registration.c
deleted file mode 100644
index e0e4d3a839f..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__outbound__registration.c
+++ /dev/null
@@ -1,29 +0,0 @@
-$NetBSD: patch-res_res__pjsip__outbound__registration.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_outbound_registration.c.orig 2018-06-20 14:52:22.011336029 +0000
-+++ res/res_pjsip_outbound_registration.c
-@@ -25,11 +25,6 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjsip_ua.h>
--
--#include "asterisk/res_pjsip.h"
--#include "asterisk/res_pjsip_cli.h"
- #include "asterisk/module.h"
- #include "asterisk/taskprocessor.h"
- #include "asterisk/cli.h"
-@@ -37,6 +32,12 @@
- #include "asterisk/threadstorage.h"
- #include "asterisk/threadpool.h"
- #include "asterisk/statsd.h"
-+
-+#include <pjsip.h>
-+#include <pjsip_ua.h>
-+
-+#include "asterisk/res_pjsip.h"
-+#include "asterisk/res_pjsip_cli.h"
- #include "res_pjsip/include/res_pjsip_private.h"
-
- /*** DOCUMENTATION
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__path.c b/comms/asterisk15/patches/patch-res_res__pjsip__path.c
deleted file mode 100644
index 4266753bbfa..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__path.c
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-res_res__pjsip__path.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_path.c.orig 2018-06-20 14:52:49.712903058 +0000
-+++ res/res_pjsip_path.c
-@@ -23,14 +23,14 @@
- ***/
-
- #include "asterisk.h"
-+#include "asterisk/module.h"
-+#include "asterisk/strings.h"
-
- #include <pjsip.h>
- #include <pjsip_ua.h>
-
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
--#include "asterisk/module.h"
--#include "asterisk/strings.h"
-
- static const pj_str_t PATH_NAME = { "Path", 4 };
- static pj_str_t PATH_SUPPORTED_NAME = { "path", 4 };
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__phoneprov__provider.c b/comms/asterisk15/patches/patch-res_res__pjsip__phoneprov__provider.c
deleted file mode 100644
index 6fd480c817a..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__phoneprov__provider.c
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-res_res__pjsip__phoneprov__provider.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_phoneprov_provider.c.orig 2018-06-20 15:28:01.690262506 +0000
-+++ res/res_pjsip_phoneprov_provider.c
-@@ -41,12 +41,13 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--
--#include "asterisk/res_pjsip.h"
- #include "asterisk/module.h"
- #include "asterisk/sorcery.h"
- #include "asterisk/phoneprov.h"
-+
-+#include <pjsip.h>
-+
-+#include "asterisk/res_pjsip.h"
- #include "res_pjsip/include/res_pjsip_private.h"
-
- /*** DOCUMENTATION
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__pidf__body__generator.c b/comms/asterisk15/patches/patch-res_res__pjsip__pidf__body__generator.c
deleted file mode 100644
index 661994218f9..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__pidf__body__generator.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-res_res__pjsip__pidf__body__generator.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_pidf_body_generator.c.orig 2018-06-20 15:17:01.479385106 +0000
-+++ res/res_pjsip_pidf_body_generator.c
-@@ -25,11 +25,12 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+
- #include <pjsip.h>
- #include <pjsip_simple.h>
- #include <pjlib.h>
-
--#include "asterisk/module.h"
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_pubsub.h"
- #include "asterisk/res_pjsip_presence_xml.h"
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__pidf__digium__body__supplement.c b/comms/asterisk15/patches/patch-res_res__pjsip__pidf__digium__body__supplement.c
deleted file mode 100644
index ca16d36b70c..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__pidf__digium__body__supplement.c
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD: patch-res_res__pjsip__pidf__digium__body__supplement.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_pidf_digium_body_supplement.c.orig 2018-06-20 15:16:30.009948356 +0000
-+++ res/res_pjsip_pidf_digium_body_supplement.c
-@@ -25,12 +25,13 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+#include "asterisk/presencestate.h"
-+
- #include <pjsip.h>
- #include <pjsip_simple.h>
- #include <pjlib.h>
-
--#include "asterisk/module.h"
--#include "asterisk/presencestate.h"
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_pubsub.h"
- #include "asterisk/res_pjsip_presence_xml.h"
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__pidf__eyebeam__body__supplement.c b/comms/asterisk15/patches/patch-res_res__pjsip__pidf__eyebeam__body__supplement.c
deleted file mode 100644
index 87e71d7c1a4..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__pidf__eyebeam__body__supplement.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-res_res__pjsip__pidf__eyebeam__body__supplement.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_pidf_eyebeam_body_supplement.c.orig 2018-06-20 15:13:48.837303343 +0000
-+++ res/res_pjsip_pidf_eyebeam_body_supplement.c
-@@ -25,11 +25,12 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+
- #include <pjsip.h>
- #include <pjsip_simple.h>
- #include <pjlib.h>
-
--#include "asterisk/module.h"
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_pubsub.h"
- #include "asterisk/res_pjsip_presence_xml.h"
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__publish__asterisk.c b/comms/asterisk15/patches/patch-res_res__pjsip__publish__asterisk.c
deleted file mode 100644
index 469dab31059..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__publish__asterisk.c
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-res_res__pjsip__publish__asterisk.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_publish_asterisk.c.orig 2018-06-20 15:15:27.126012722 +0000
-+++ res/res_pjsip_publish_asterisk.c
-@@ -28,15 +28,16 @@
-
- #include <regex.h>
-
-+#include "asterisk/module.h"
-+#include "asterisk/logger.h"
-+#include "asterisk/app.h"
-+
- #include <pjsip.h>
- #include <pjsip_simple.h>
-
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_outbound_publish.h"
- #include "asterisk/res_pjsip_pubsub.h"
--#include "asterisk/module.h"
--#include "asterisk/logger.h"
--#include "asterisk/app.h"
-
- /*** DOCUMENTATION
- <configInfo name="res_pjsip_publish_asterisk" language="en_US">
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__pubsub.c b/comms/asterisk15/patches/patch-res_res__pjsip__pubsub.c
deleted file mode 100644
index 36d11e50a9b..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__pubsub.c
+++ /dev/null
@@ -1,36 +0,0 @@
-$NetBSD: patch-res_res__pjsip__pubsub.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_pubsub.c.orig 2018-06-20 14:55:07.570481514 +0000
-+++ res/res_pjsip_pubsub.c
-@@ -27,12 +27,7 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjsip_simple.h>
--#include <pjlib.h>
--
- #include "asterisk/app.h"
--#include "asterisk/res_pjsip_pubsub.h"
- #include "asterisk/module.h"
- #include "asterisk/linkedlists.h"
- #include "asterisk/astobj2.h"
-@@ -40,11 +35,17 @@
- #include "asterisk/uuid.h"
- #include "asterisk/taskprocessor.h"
- #include "asterisk/sched.h"
--#include "asterisk/res_pjsip.h"
- #include "asterisk/callerid.h"
- #include "asterisk/manager.h"
- #include "asterisk/cli.h"
- #include "asterisk/test.h"
-+
-+#include <pjsip.h>
-+#include <pjsip_simple.h>
-+#include <pjlib.h>
-+
-+#include "asterisk/res_pjsip_pubsub.h"
-+#include "asterisk/res_pjsip.h"
- #include "res_pjsip/include/res_pjsip_private.h"
- #include "asterisk/res_pjsip_presence_xml.h"
-
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__refer.c b/comms/asterisk15/patches/patch-res_res__pjsip__refer.c
deleted file mode 100644
index 08d0ebb1136..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__refer.c
+++ /dev/null
@@ -1,29 +0,0 @@
-$NetBSD: patch-res_res__pjsip__refer.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_refer.c.orig 2018-06-20 14:53:06.998187075 +0000
-+++ res/res_pjsip_refer.c
-@@ -25,11 +25,6 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjsip_ua.h>
--
--#include "asterisk/res_pjsip.h"
--#include "asterisk/res_pjsip_session.h"
- #include "asterisk/module.h"
- #include "asterisk/pbx.h"
- #include "asterisk/taskprocessor.h"
-@@ -39,6 +34,12 @@
- #include "asterisk/stasis_channels.h"
- #include "asterisk/causes.h"
-
-+#include <pjsip.h>
-+#include <pjsip_ua.h>
-+
-+#include "asterisk/res_pjsip.h"
-+#include "asterisk/res_pjsip_session.h"
-+
- /*! \brief REFER Progress structure */
- struct refer_progress {
- /*! \brief Subscription to provide updates on */
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__registrar.c b/comms/asterisk15/patches/patch-res_res__pjsip__registrar.c
deleted file mode 100644
index 45209e21b83..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__registrar.c
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-res_res__pjsip__registrar.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_registrar.c.orig 2018-06-20 15:15:55.779062250 +0000
-+++ res/res_pjsip_registrar.c
-@@ -26,16 +26,18 @@
- #include "asterisk.h"
-
- #include <signal.h>
--#include <pjsip.h>
--#include <pjsip_ua.h>
-
--#include "asterisk/res_pjsip.h"
- #include "asterisk/module.h"
- #include "asterisk/paths.h"
- #include "asterisk/test.h"
- #include "asterisk/taskprocessor.h"
- #include "asterisk/manager.h"
- #include "asterisk/named_locks.h"
-+
-+#include <pjsip.h>
-+#include <pjsip_ua.h>
-+
-+#include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjproject.h"
- #include "res_pjsip/include/res_pjsip_private.h"
-
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__rfc3326.c b/comms/asterisk15/patches/patch-res_res__pjsip__rfc3326.c
deleted file mode 100644
index 645e07ab984..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__rfc3326.c
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-res_res__pjsip__rfc3326.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_rfc3326.c.orig 2018-06-20 14:50:37.040036015 +0000
-+++ res/res_pjsip_rfc3326.c
-@@ -25,14 +25,15 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+#include "asterisk/causes.h"
-+#include "asterisk/threadpool.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
-
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
--#include "asterisk/module.h"
--#include "asterisk/causes.h"
--#include "asterisk/threadpool.h"
-
- static void rfc3326_use_reason_header(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
- {
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__sdp__rtp.c b/comms/asterisk15/patches/patch-res_res__pjsip__sdp__rtp.c
deleted file mode 100644
index e37461995e2..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__sdp__rtp.c
+++ /dev/null
@@ -1,28 +0,0 @@
-$NetBSD: patch-res_res__pjsip__sdp__rtp.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_sdp_rtp.c.orig 2018-06-20 14:44:19.523907244 +0000
-+++ res/res_pjsip_sdp_rtp.c
-@@ -33,11 +33,6 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjsip_ua.h>
--#include <pjmedia.h>
--#include <pjlib.h>
--
- #include "asterisk/utils.h"
- #include "asterisk/module.h"
- #include "asterisk/format.h"
-@@ -54,6 +49,11 @@
- #include "asterisk/stream.h"
- #include "asterisk/format_cache.h"
-
-+#include <pjsip.h>
-+#include <pjsip_ua.h>
-+#include <pjmedia.h>
-+#include <pjlib.h>
-+
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
-
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__send__to__voicemail.c b/comms/asterisk15/patches/patch-res_res__pjsip__send__to__voicemail.c
deleted file mode 100644
index 47b6bc5cd33..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__send__to__voicemail.c
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-res_res__pjsip__send__to__voicemail.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_send_to_voicemail.c.orig 2018-06-20 14:58:59.976213530 +0000
-+++ res/res_pjsip_send_to_voicemail.c
-@@ -33,13 +33,14 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/pbx.h"
-+#include "asterisk/module.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
-
--#include "asterisk/pbx.h"
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
--#include "asterisk/module.h"
-
- #define DATASTORE_NAME "call_feature_send_to_vm_datastore"
-
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__session.c b/comms/asterisk15/patches/patch-res_res__pjsip__session.c
deleted file mode 100644
index e7aa5867292..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__session.c
+++ /dev/null
@@ -1,37 +0,0 @@
-$NetBSD: patch-res_res__pjsip__session.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_session.c.orig 2018-06-20 15:26:23.023816148 +0000
-+++ res/res_pjsip_session.c
-@@ -24,17 +24,10 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjsip_ua.h>
--#include <pjlib.h>
--
--#include "asterisk/res_pjsip.h"
--#include "asterisk/res_pjsip_session.h"
- #include "asterisk/callerid.h"
- #include "asterisk/datastore.h"
- #include "asterisk/module.h"
- #include "asterisk/logger.h"
--#include "asterisk/res_pjsip.h"
- #include "asterisk/astobj2.h"
- #include "asterisk/lock.h"
- #include "asterisk/uuid.h"
-@@ -49,6 +42,14 @@
- #include "asterisk/test.h"
- #include "asterisk/stream.h"
-
-+#include <pjsip.h>
-+#include <pjsip_ua.h>
-+#include <pjlib.h>
-+
-+#include "asterisk/res_pjsip.h"
-+#include "asterisk/res_pjsip_session.h"
-+#include "asterisk/res_pjsip.h"
-+
- #define SDP_HANDLER_BUCKETS 11
-
- #define MOD_DATA_ON_RESPONSE "on_response"
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__sips__contact.c b/comms/asterisk15/patches/patch-res_res__pjsip__sips__contact.c
deleted file mode 100644
index 3453ef6c8f8..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__sips__contact.c
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-res_res__pjsip__sips__contact.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_sips_contact.c.orig 2018-06-20 15:18:05.179232502 +0000
-+++ res/res_pjsip_sips_contact.c
-@@ -24,10 +24,11 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+
- #include <pjsip.h>
-
- #include "asterisk/res_pjsip.h"
--#include "asterisk/module.h"
-
- /*!
- * \brief Upgrade Contact URIs on outgoing SIP requests to SIPS if required.
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__t38.c b/comms/asterisk15/patches/patch-res_res__pjsip__t38.c
deleted file mode 100644
index 9ab05e49ebb..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__t38.c
+++ /dev/null
@@ -1,28 +0,0 @@
-$NetBSD: patch-res_res__pjsip__t38.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_t38.c.orig 2018-06-20 15:15:02.160803849 +0000
-+++ res/res_pjsip_t38.c
-@@ -32,11 +32,6 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjsip_ua.h>
--#include <pjmedia.h>
--#include <pjlib.h>
--
- #include "asterisk/utils.h"
- #include "asterisk/module.h"
- #include "asterisk/udptl.h"
-@@ -46,6 +41,11 @@
- #include "asterisk/stream.h"
- #include "asterisk/format_cache.h"
-
-+#include <pjsip.h>
-+#include <pjsip_ua.h>
-+#include <pjmedia.h>
-+#include <pjlib.h>
-+
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
-
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__transport__websocket.c b/comms/asterisk15/patches/patch-res_res__pjsip__transport__websocket.c
deleted file mode 100644
index 3cf6cc2d5df..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__transport__websocket.c
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-res_res__pjsip__transport__websocket.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_transport_websocket.c.orig 2018-06-20 14:55:54.355115874 +0000
-+++ res/res_pjsip_transport_websocket.c
-@@ -29,14 +29,15 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+#include "asterisk/http_websocket.h"
-+#include "asterisk/taskprocessor.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
-
--#include "asterisk/module.h"
--#include "asterisk/http_websocket.h"
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
--#include "asterisk/taskprocessor.h"
-
- static int transport_type_wss;
- static int transport_type_wss_ipv6;
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip__xpidf__body__generator.c b/comms/asterisk15/patches/patch-res_res__pjsip__xpidf__body__generator.c
deleted file mode 100644
index da4391ab0cb..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip__xpidf__body__generator.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-res_res__pjsip__xpidf__body__generator.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip_xpidf_body_generator.c.orig 2018-06-20 14:57:12.605637881 +0000
-+++ res/res_pjsip_xpidf_body_generator.c
-@@ -26,11 +26,12 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+
- #include <pjsip.h>
- #include <pjsip_simple.h>
- #include <pjlib.h>
-
--#include "asterisk/module.h"
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_pubsub.h"
- #include "asterisk/res_pjsip_presence_xml.h"
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_config__auth.c b/comms/asterisk15/patches/patch-res_res__pjsip_config__auth.c
deleted file mode 100644
index 425090b584c..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_config__auth.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-res_res__pjsip_config__auth.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/config_auth.c.orig 2018-06-20 15:02:20.856250840 +0000
-+++ res/res_pjsip/config_auth.c
-@@ -18,12 +18,14 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjlib.h>
--#include "asterisk/res_pjsip.h"
- #include "asterisk/logger.h"
- #include "asterisk/sorcery.h"
- #include "asterisk/cli.h"
-+
-+#include <pjsip.h>
-+#include <pjlib.h>
-+
-+#include "asterisk/res_pjsip.h"
- #include "include/res_pjsip_private.h"
- #include "asterisk/res_pjsip_cli.h"
-
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_config__domain__aliases.c b/comms/asterisk15/patches/patch-res_res__pjsip_config__domain__aliases.c
deleted file mode 100644
index 998cbffd049..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_config__domain__aliases.c
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-res_res__pjsip_config__domain__aliases.c,v 1.2 2021/01/17 08:32:40 jnemeth Exp $
-
---- res/res_pjsip/config_domain_aliases.c.orig 2019-09-05 13:09:20.000000000 +0000
-+++ res/res_pjsip/config_domain_aliases.c
-@@ -17,14 +17,14 @@
- */
-
- #include "asterisk.h"
-+#include "asterisk/logger.h"
-+#include "asterisk/sorcery.h"
-
- #include <pjsip.h>
- #include <pjlib.h>
-
- #include "asterisk/res_pjsip.h"
- #include "include/res_pjsip_private.h"
--#include "asterisk/logger.h"
--#include "asterisk/sorcery.h"
-
- static void domain_alias_destroy(void *obj)
- {
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_config__global.c b/comms/asterisk15/patches/patch-res_res__pjsip_config__global.c
deleted file mode 100644
index bc36ead9be9..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_config__global.c
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-res_res__pjsip_config__global.c,v 1.2 2021/01/17 08:32:40 jnemeth Exp $
-
---- res/res_pjsip/config_global.c.orig 2019-09-05 13:09:20.000000000 +0000
-+++ res/res_pjsip/config_global.c
-@@ -17,16 +17,16 @@
- */
-
- #include "asterisk.h"
-+#include "asterisk/sorcery.h"
-+#include "asterisk/taskprocessor.h"
-+#include "asterisk/ast_version.h"
-
- #include <pjsip.h>
- #include <pjlib.h>
-
- #include "asterisk/res_pjsip.h"
--#include "include/res_pjsip_private.h"
--#include "asterisk/sorcery.h"
--#include "asterisk/taskprocessor.h"
--#include "asterisk/ast_version.h"
- #include "asterisk/res_pjsip_cli.h"
-+#include "include/res_pjsip_private.h"
-
- #define DEFAULT_MAX_FORWARDS 70
- #define DEFAULT_KEEPALIVE_INTERVAL 90
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_config__system.c b/comms/asterisk15/patches/patch-res_res__pjsip_config__system.c
deleted file mode 100644
index 92b8595d1c5..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_config__system.c
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-res_res__pjsip_config__system.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/config_system.c.orig 2018-06-20 15:09:27.717943335 +0000
-+++ res/res_pjsip/config_system.c
-@@ -18,14 +18,15 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/sorcery.h"
-+#include "asterisk/threadpool.h"
-+#include "asterisk/dns.h"
-+
- #include <pjsip.h>
- #include <pjlib.h>
-
- #include "asterisk/res_pjsip.h"
--#include "asterisk/sorcery.h"
- #include "include/res_pjsip_private.h"
--#include "asterisk/threadpool.h"
--#include "asterisk/dns.h"
- #include "asterisk/res_pjsip_cli.h"
-
- #define TIMER_T1_MIN 100
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_config__transport.c b/comms/asterisk15/patches/patch-res_res__pjsip_config__transport.c
deleted file mode 100644
index b70d86674d1..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_config__transport.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-res_res__pjsip_config__transport.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/config_transport.c.orig 2018-06-20 15:08:28.782330643 +0000
-+++ res/res_pjsip/config_transport.c
-@@ -19,19 +19,21 @@
- #include "asterisk.h"
-
- #include <math.h>
--#include <pjsip.h>
--#include <pjlib.h>
-
--#include "asterisk/res_pjsip.h"
--#include "asterisk/res_pjsip_cli.h"
- #include "asterisk/logger.h"
- #include "asterisk/astobj2.h"
- #include "asterisk/sorcery.h"
- #include "asterisk/acl.h"
- #include "asterisk/utils.h"
--#include "include/res_pjsip_private.h"
- #include "asterisk/http_websocket.h"
-
-+#include <pjsip.h>
-+#include <pjlib.h>
-+
-+#include "asterisk/res_pjsip.h"
-+#include "asterisk/res_pjsip_cli.h"
-+#include "include/res_pjsip_private.h"
-+
- #define MAX_POINTER_STRING 33
-
- /*! \brief Default number of state container buckets */
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_location.c b/comms/asterisk15/patches/patch-res_res__pjsip_location.c
deleted file mode 100644
index 69806e6d4cc..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_location.c
+++ /dev/null
@@ -1,33 +0,0 @@
-$NetBSD: patch-res_res__pjsip_location.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/location.c.orig 2018-06-20 15:05:13.082730303 +0000
-+++ res/res_pjsip/location.c
-@@ -17,21 +17,22 @@
- */
-
- #include "asterisk.h"
--#include <pjsip.h>
--#include <pjlib.h>
--
--#include "asterisk/res_pjsip.h"
- #include "asterisk/logger.h"
- #include "asterisk/astobj2.h"
- #include "asterisk/paths.h"
- #include "asterisk/sorcery.h"
- #include "asterisk/taskprocessor.h"
--#include "include/res_pjsip_private.h"
--#include "asterisk/res_pjsip_cli.h"
- #include "asterisk/statsd.h"
- #include "asterisk/named_locks.h"
-
-+
-+#include <pjsip.h>
-+#include <pjlib.h>
-+
-+#include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjproject.h"
-+#include "asterisk/res_pjsip_cli.h"
-+#include "include/res_pjsip_private.h"
-
- static int pj_max_hostname = PJ_MAX_HOSTNAME;
- static int pjsip_max_url_size = PJSIP_MAX_URL_SIZE;
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__cli.c b/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__cli.c
deleted file mode 100644
index ec5d2f2c0ea..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__cli.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-res_res__pjsip_pjsip__cli.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/pjsip_cli.c.orig 2018-06-20 15:02:40.104650162 +0000
-+++ res/res_pjsip/pjsip_cli.c
-@@ -18,12 +18,6 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjsip_ua.h>
--
--#include "asterisk/res_pjsip.h"
--#include "include/res_pjsip_private.h"
--#include "asterisk/res_pjsip_cli.h"
- #include "asterisk/acl.h"
- #include "asterisk/cli.h"
- #include "asterisk/astobj2.h"
-@@ -31,6 +25,13 @@
- #include "asterisk/utils.h"
- #include "asterisk/sorcery.h"
-
-+#include <pjsip.h>
-+#include <pjsip_ua.h>
-+
-+#include "asterisk/res_pjsip.h"
-+#include "include/res_pjsip_private.h"
-+#include "asterisk/res_pjsip_cli.h"
-+
- static struct ao2_container *formatter_registry;
-
- int ast_sip_cli_print_sorcery_objectset(void *obj, void *arg, int flags)
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__configuration.c b/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__configuration.c
deleted file mode 100644
index c42001f0337..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__configuration.c
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-res_res__pjsip_pjsip__configuration.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/pjsip_configuration.c.orig 2018-06-11 21:21:37.000000000 +0000
-+++ res/res_pjsip/pjsip_configuration.c
-@@ -18,12 +18,6 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjsip_ua.h>
--
--#include "asterisk/res_pjsip.h"
--#include "include/res_pjsip_private.h"
--#include "asterisk/res_pjsip_cli.h"
- #include "asterisk/acl.h"
- #include "asterisk/manager.h"
- #include "asterisk/astobj2.h"
-@@ -35,6 +29,13 @@
- #include "asterisk/pbx.h"
- #include "asterisk/stream.h"
-
-+#include <pjsip.h>
-+#include <pjsip_ua.h>
-+
-+#include "asterisk/res_pjsip.h"
-+#include "include/res_pjsip_private.h"
-+#include "asterisk/res_pjsip_cli.h"
-+
- /*! \brief Number of buckets for persistent endpoint information */
- #define PERSISTENT_BUCKETS 53
-
-@@ -1222,7 +1223,7 @@ static int from_user_handler(const struc
- const char *val;
-
- for (val = var->value; *val; val++) {
-- if (!isalpha(*val) && !isdigit(*val) && !strchr(valid_uri_marks, *val)) {
-+ if (!isalpha((unsigned char)*val) && !isdigit((unsigned char)*val) && !strchr(valid_uri_marks, *val)) {
- ast_log(LOG_ERROR, "Error configuring endpoint '%s' - '%s' field "
- "contains invalid character '%c'\n",
- ast_sorcery_object_get_id(endpoint), var->name, *val);
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__distributor.c b/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__distributor.c
deleted file mode 100644
index 77604f86d4d..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__distributor.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-res_res__pjsip_pjsip__distributor.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/pjsip_distributor.c.orig 2018-06-20 15:08:07.655594906 +0000
-+++ res/res_pjsip/pjsip_distributor.c
-@@ -18,13 +18,14 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/acl.h"
-+#include "asterisk/taskprocessor.h"
-+#include "asterisk/threadpool.h"
-+
- #include <pjsip.h>
-
- #include "asterisk/res_pjsip.h"
--#include "asterisk/acl.h"
- #include "include/res_pjsip_private.h"
--#include "asterisk/taskprocessor.h"
--#include "asterisk/threadpool.h"
- #include "asterisk/res_pjsip_cli.h"
-
- static int distribute(void *data);
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__global__headers.c b/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__global__headers.c
deleted file mode 100644
index 304dd841829..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__global__headers.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-res_res__pjsip_pjsip__global__headers.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/pjsip_global_headers.c.orig 2018-06-20 15:04:07.107055522 +0000
-+++ res/res_pjsip/pjsip_global_headers.c
-@@ -18,11 +18,13 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/linkedlists.h"
-+#include "asterisk/network.h"
-+
- #include <pjsip.h>
- #include <pjlib.h>
-
- #include "asterisk/res_pjsip.h"
--#include "asterisk/linkedlists.h"
- #include "include/res_pjsip_private.h"
-
- static pj_status_t add_request_headers(pjsip_tx_data *tdata);
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__message__filter.c b/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__message__filter.c
deleted file mode 100644
index 321a58dad79..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__message__filter.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-res_res__pjsip_pjsip__message__filter.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/pjsip_message_filter.c.orig 2018-06-20 15:11:13.041603718 +0000
-+++ res/res_pjsip/pjsip_message_filter.c
-@@ -18,6 +18,8 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/network.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
-
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__options.c b/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__options.c
deleted file mode 100644
index 6fb60fc34e5..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__options.c
+++ /dev/null
@@ -1,34 +0,0 @@
-$NetBSD: patch-res_res__pjsip_pjsip__options.c,v 1.2 2021/01/17 08:32:40 jnemeth Exp $
-
---- res/res_pjsip/pjsip_options.c.orig 2019-09-05 13:09:20.000000000 +0000
-+++ res/res_pjsip/pjsip_options.c
-@@ -19,11 +19,6 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjsip_ua.h>
--#include <pjlib.h>
--
--#include "asterisk/res_pjsip.h"
- #include "asterisk/channel.h"
- #include "asterisk/pbx.h"
- #include "asterisk/astobj2.h"
-@@ -31,10 +26,16 @@
- #include "asterisk/time.h"
- #include "asterisk/test.h"
- #include "asterisk/statsd.h"
--#include "include/res_pjsip_private.h"
- #include "asterisk/taskprocessor.h"
- #include "asterisk/threadpool.h"
-
-+#include <pjsip.h>
-+#include <pjsip_ua.h>
-+#include <pjlib.h>
-+
-+#include "asterisk/res_pjsip.h"
-+#include "include/res_pjsip_private.h"
-+
- /*
- * This implementation for OPTIONS support is based around the idea
- * that realistically an AOR generally has very few contacts and is
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__resolver.c b/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__resolver.c
deleted file mode 100644
index df3bb5180d9..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__resolver.c
+++ /dev/null
@@ -1,33 +0,0 @@
-$NetBSD: patch-res_res__pjsip_pjsip__resolver.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/pjsip_resolver.c.orig 2018-06-20 15:09:57.824142836 +0000
-+++ res/res_pjsip/pjsip_resolver.c
-@@ -18,9 +18,6 @@
-
- #include "asterisk.h"
-
--#include <pjsip.h>
--#include <pjlib-util/errno.h>
--
- #include <arpa/nameser.h>
-
- #include "asterisk/astobj2.h"
-@@ -28,11 +25,16 @@
- #include "asterisk/dns_query_set.h"
- #include "asterisk/dns_srv.h"
- #include "asterisk/dns_naptr.h"
--#include "asterisk/res_pjsip.h"
--#include "include/res_pjsip_private.h"
-+#include "asterisk/network.h"
- #include "asterisk/taskprocessor.h"
- #include "asterisk/threadpool.h"
-
-+#include <pjsip.h>
-+#include <pjlib-util/errno.h>
-+
-+#include "asterisk/res_pjsip.h"
-+#include "include/res_pjsip_private.h"
-+
- #ifdef HAVE_PJSIP_EXTERNAL_RESOLVER
-
- /*! \brief Structure which contains transport+port information for an active query */
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__scheduler.c b/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__scheduler.c
deleted file mode 100644
index f235765a308..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__scheduler.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-res_res__pjsip_pjsip__scheduler.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/pjsip_scheduler.c.orig 2018-06-20 15:01:28.428240101 +0000
-+++ res/res_pjsip/pjsip_scheduler.c
-@@ -25,10 +25,12 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/network.h"
-+#include "asterisk/taskprocessor.h"
-+
- #include "asterisk/res_pjsip.h"
- #include "include/res_pjsip_private.h"
- #include "asterisk/res_pjsip_cli.h"
--#include "asterisk/taskprocessor.h"
-
- #define TASK_BUCKETS 53
-
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__session.c b/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__session.c
deleted file mode 100644
index 606f5485d4d..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__session.c
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-res_res__pjsip_pjsip__session.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/pjsip_session.c.orig 2018-06-20 15:05:52.774557946 +0000
-+++ res/res_pjsip/pjsip_session.c
-@@ -18,6 +18,10 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/linkedlists.h"
-+#include "asterisk/lock.h"
-+#include "asterisk/module.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
- #include <pjlib.h>
-@@ -25,9 +29,6 @@
- #include "asterisk/res_pjsip.h"
- #include "asterisk/res_pjsip_session.h"
- #include "include/res_pjsip_private.h"
--#include "asterisk/linkedlists.h"
--#include "asterisk/lock.h"
--#include "asterisk/module.h"
-
-
- AST_RWLIST_HEAD_STATIC(session_supplements, ast_sip_session_supplement);
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__transport__events.c b/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__transport__events.c
deleted file mode 100644
index bb4d3c399aa..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__transport__events.c
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD: patch-res_res__pjsip_pjsip__transport__events.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/pjsip_transport_events.c.orig 2018-06-20 15:11:40.942746700 +0000
-+++ res/res_pjsip/pjsip_transport_events.c
-@@ -29,11 +29,13 @@
-
- #include "asterisk.h"
-
--#include "asterisk/res_pjsip.h"
--#include "include/res_pjsip_private.h"
- #include "asterisk/linkedlists.h"
-+#include "asterisk/network.h"
- #include "asterisk/vector.h"
-
-+#include "asterisk/res_pjsip.h"
-+#include "include/res_pjsip_private.h"
-+
- /* ------------------------------------------------------------------- */
-
- /*! \brief Number of buckets for monitored active transports */
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__transport__management.c b/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__transport__management.c
deleted file mode 100644
index 144d783e28c..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_pjsip__transport__management.c
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD: patch-res_res__pjsip_pjsip__transport__management.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/pjsip_transport_management.c.orig 2018-06-20 15:03:44.845962982 +0000
-+++ res/res_pjsip/pjsip_transport_management.c
-@@ -20,12 +20,13 @@
-
- #include <signal.h>
-
-+#include "asterisk/module.h"
-+#include "asterisk/astobj2.h"
-+
- #include <pjsip.h>
- #include <pjsip_ua.h>
-
- #include "asterisk/res_pjsip.h"
--#include "asterisk/module.h"
--#include "asterisk/astobj2.h"
- #include "include/res_pjsip_private.h"
-
- /*! \brief Number of buckets for monitored transports */
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_presence__xml.c b/comms/asterisk15/patches/patch-res_res__pjsip_presence__xml.c
deleted file mode 100644
index 7c948a08c9d..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_presence__xml.c
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD: patch-res_res__pjsip_presence__xml.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/presence_xml.c.orig 2018-06-20 15:06:56.336281107 +0000
-+++ res/res_pjsip/presence_xml.c
-@@ -18,12 +18,13 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/module.h"
-+#include "asterisk/pbx.h"
-+
- #include <pjsip.h>
- #include <pjsip_simple.h>
- #include <pjlib.h>
-
--#include "asterisk/module.h"
--#include "asterisk/pbx.h"
- #include "asterisk/res_pjsip_presence_xml.h"
-
- void ast_sip_sanitize_xml(const char *input, char *output, size_t len)
diff --git a/comms/asterisk15/patches/patch-res_res__pjsip_security__events.c b/comms/asterisk15/patches/patch-res_res__pjsip_security__events.c
deleted file mode 100644
index 4079e8e55a4..00000000000
--- a/comms/asterisk15/patches/patch-res_res__pjsip_security__events.c
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-res_res__pjsip_security__events.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_pjsip/security_events.c.orig 2018-06-20 15:13:16.454003414 +0000
-+++ res/res_pjsip/security_events.c
-@@ -26,10 +26,11 @@
-
- #include "asterisk.h"
-
-+#include "asterisk/security_events.h"
-+
- #include <pjsip.h>
-
- #include "asterisk/res_pjsip.h"
--#include "asterisk/security_events.h"
-
- static enum ast_transport security_event_get_transport(pjsip_rx_data *rdata)
- {
diff --git a/comms/asterisk15/patches/patch-res_res__rtp__asterisk.c b/comms/asterisk15/patches/patch-res_res__rtp__asterisk.c
deleted file mode 100644
index 91960b23d58..00000000000
--- a/comms/asterisk15/patches/patch-res_res__rtp__asterisk.c
+++ /dev/null
@@ -1,44 +0,0 @@
-$NetBSD: patch-res_res__rtp__asterisk.c,v 1.2 2021/01/17 08:32:40 jnemeth Exp $
-
---- res/res_rtp_asterisk.c.orig 2019-09-05 13:09:20.000000000 +0000
-+++ res/res_rtp_asterisk.c
-@@ -56,13 +56,6 @@
- #endif
- #endif
-
--#ifdef HAVE_PJPROJECT
--#include <pjlib.h>
--#include <pjlib-util.h>
--#include <pjnath.h>
--#include <ifaddrs.h>
--#endif
--
- #include "asterisk/options.h"
- #include "asterisk/stun.h"
- #include "asterisk/pbx.h"
-@@ -82,7 +75,16 @@
- #include "asterisk/uuid.h"
- #include "asterisk/test.h"
- #include "asterisk/data_buffer.h"
-+
-+static int is_zero_address(struct in_addr *addr) {
-+ return !addr->s_addr;
-+}
- #ifdef HAVE_PJPROJECT
-+#include <pjlib.h>
-+#include <pjlib-util.h>
-+#include <pjnath.h>
-+#include <ifaddrs.h>
-+
- #include "asterisk/res_pjproject.h"
- #endif
-
-@@ -3297,7 +3299,7 @@ static void rtp_add_candidates_to_ice(st
- }
-
- /* If configured to use a STUN server to get our external mapped address do so */
-- if (count && stunaddr.sin_addr.s_addr && !stun_address_is_blacklisted(addr) &&
-+ if (count && !is_zero_address(&stunaddr.sin_addr) && !stun_address_is_blacklisted(addr) &&
- (ast_sockaddr_is_ipv4(addr) || ast_sockaddr_is_any(addr))) {
- struct sockaddr_in answer;
- int rsp;
diff --git a/comms/asterisk15/patches/patch-res_res__xmpp.c b/comms/asterisk15/patches/patch-res_res__xmpp.c
deleted file mode 100644
index b0d0ac715a0..00000000000
--- a/comms/asterisk15/patches/patch-res_res__xmpp.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-res_res__xmpp.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- res/res_xmpp.c.orig 2018-06-19 21:29:29.310245367 +0000
-+++ res/res_xmpp.c
-@@ -3746,7 +3746,7 @@ static int xmpp_client_receive(struct as
- /* if we stumble on the ending tag character,
- we skip any whitespace that follows it*/
- if (c == '>') {
-- while (isspace(buf[pos+1])) {
-+ while (isspace((unsigned char)buf[pos+1])) {
- pos++;
- }
- }
diff --git a/comms/asterisk15/patches/patch-sounds_Makefile b/comms/asterisk15/patches/patch-sounds_Makefile
deleted file mode 100644
index 86a6502add8..00000000000
--- a/comms/asterisk15/patches/patch-sounds_Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-sounds_Makefile,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- sounds/Makefile.orig 2018-05-01 20:12:26.000000000 +0000
-+++ sounds/Makefile
-@@ -124,20 +124,6 @@ endef # sound_format_lang_rule
- all: $(CORE_SOUNDS) $(EXTRA_SOUNDS) $(MOH)
-
- have_download:
-- @if test "$(DOWNLOAD)" = ":" ; then \
-- echo "**************************************************"; \
-- echo "*** ***"; \
-- echo "*** You must have either wget, curl, or fetch ***"; \
-- echo "*** to be able to automatically download and ***"; \
-- echo "*** install the requested sound packages. ***"; \
-- echo "*** ***"; \
-- echo "*** Please install one of these, or remove any ***"; \
-- echo "*** extra sound package selections in ***"; \
-- echo "*** menuselect before installing Asterisk. ***"; \
-- echo "*** ***"; \
-- echo "**************************************************"; \
-- exit 1; \
-- fi
-
- $(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),core-sounds,en,$(CORE_SOUNDS_VERSION)))
-
diff --git a/comms/asterisk15/patches/patch-tests_test__locale.c b/comms/asterisk15/patches/patch-tests_test__locale.c
deleted file mode 100644
index 708dac5b564..00000000000
--- a/comms/asterisk15/patches/patch-tests_test__locale.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-tests_test__locale.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- tests/test_locale.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ tests/test_locale.c
-@@ -81,7 +81,7 @@ static char *handle_cli_test_locales(str
-
- /* First we run a set of tests with the global locale, which isn't thread-safe. */
- if (!(localedir = opendir(
--#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__)
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) || defined(__DragonFly__)
- "/usr/share/locale"
- #else /* Linux */
- "/usr/lib/locale"
diff --git a/comms/asterisk15/patches/patch-tests_test__voicemail__api.c b/comms/asterisk15/patches/patch-tests_test__voicemail__api.c
deleted file mode 100644
index 86a7624ab5f..00000000000
--- a/comms/asterisk15/patches/patch-tests_test__voicemail__api.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-tests_test__voicemail__api.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- tests/test_voicemail_api.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ tests/test_voicemail_api.c
-@@ -383,7 +383,7 @@ static struct ast_vm_msg_snapshot *test_
- struct ast_vm_msg_snapshot *snapshot;
-
- snprintf(msg_id_hash, sizeof(msg_id_hash), "%s%s%s", exten, context, callerid);
-- snprintf(msg_id_buf, sizeof(msg_id_buf), "%ld-%d", (long)time(NULL), ast_str_hash(msg_id_hash));
-+ snprintf(msg_id_buf, sizeof(msg_id_buf), "%jd-%d", (intmax_t)time(NULL), ast_str_hash(msg_id_hash));
-
- if ((snapshot = ast_calloc(1, sizeof(*snapshot)))) {
- if (ast_string_field_init(snapshot, 128)) {
diff --git a/comms/asterisk15/patches/patch-utils_Makefile b/comms/asterisk15/patches/patch-utils_Makefile
deleted file mode 100644
index 29e6e7f8b75..00000000000
--- a/comms/asterisk15/patches/patch-utils_Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-utils_Makefile,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- utils/Makefile.orig 2018-05-01 20:12:26.000000000 +0000
-+++ utils/Makefile
-@@ -41,6 +41,10 @@ ifeq ($(OSARCH),SunOS)
- UTILS:=$(filter-out muted,$(UTILS))
- endif
-
-+ifeq ($(OSARCH),NetBSD)
-+ UTILS:=$(filter-out muted,$(UTILS))
-+endif
-+
- ifeq ($(OSARCH),OpenBSD)
- UTILS:=$(filter-out muted,$(UTILS))
- endif
-@@ -75,7 +79,7 @@ all: $(UTILS)
- install:
- for x in $(UTILS); do \
- if [ "$$x" != "none" ]; then \
-- $(INSTALL) -m 755 $$x "$(DESTDIR)$(ASTSBINDIR)/$$x"; \
-+ $(BSD_INSTALL_PROGRAM) $$x "$(DESTDIR)$(ASTSBINDIR)/$$x"; \
- fi; \
- done
-
diff --git a/comms/asterisk15/patches/patch-utils_db1-ast_include_db.h b/comms/asterisk15/patches/patch-utils_db1-ast_include_db.h
deleted file mode 100644
index 3df9d904cdc..00000000000
--- a/comms/asterisk15/patches/patch-utils_db1-ast_include_db.h
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-utils_db1-ast_include_db.h,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- utils/db1-ast/include/db.h.orig 2015-10-09 21:48:48.000000000 +0000
-+++ utils/db1-ast/include/db.h
-@@ -55,7 +55,7 @@
-
- #ifndef __BIT_TYPES_DEFINED__
- #define __BIT_TYPES_DEFINED__
--#if (!defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__APPLE__))
-+#if (!defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(__DragonFly__))
- typedef __signed char int8_t;
- typedef short int16_t;
- typedef int int32_t;
diff --git a/comms/asterisk15/patches/patch-utils_extconf.c b/comms/asterisk15/patches/patch-utils_extconf.c
deleted file mode 100644
index 64e2aa14c7d..00000000000
--- a/comms/asterisk15/patches/patch-utils_extconf.c
+++ /dev/null
@@ -1,67 +0,0 @@
-$NetBSD: patch-utils_extconf.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- utils/extconf.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ utils/extconf.c
-@@ -593,6 +593,10 @@ static void __attribute__((destructor))
- #include "libkern/OSAtomic.h"
- #endif
-
-+#if defined(HAVE_SYS_ATOMIC_H)
-+#include <sys/atomic.h>
-+#endif
-+
- /*! \brief Atomically add v to *p and return * the previous value of *p.
- * This can be used to handle reference counts, and the return value
- * can be used to generate unique identifiers.
-@@ -606,12 +610,18 @@ AST_INLINE_API(int ast_atomic_fetchadd_i
- #elif defined(HAVE_OSX_ATOMICS) && (SIZEOF_INT == 4)
- AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
- {
-- return OSAtomicAdd32(v, (int32_t *) p);
-+ return OSAtomicAdd32(v, (int32_t *) p) - v;
- })
- #elif defined(HAVE_OSX_ATOMICS) && (SIZEOF_INT == 8)
- AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
- {
-- return OSAtomicAdd64(v, (int64_t *) p);
-+ return OSAtomicAdd64(v, (int64_t *) p) - v;
-+})
-+#elif defined(HAVE_SYS_ATOMIC_H)
-+AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
-+{
-+ return atomic_add_int_nv((unsigned int *)p, v) - v;
-+})
- #elif defined (__i386__) || defined(__x86_64__)
- AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
- {
-@@ -653,6 +663,12 @@ AST_INLINE_API(int ast_atomic_dec_and_te
- AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
- {
- return OSAtomicAdd64( -1, (int64_t *) p) == 0;
-+})
-+#elif defined(HAVE_SYS_ATOMIC_H)
-+AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
-+{
-+ return atomic_dec_uint_nv((unsigned int *)p) == 0;
-+})
- #else
- AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
- {
-@@ -2537,13 +2553,13 @@ static int ast_true(const char *s)
- static struct timeval tvfix(struct timeval a)
- {
- if (a.tv_usec >= ONE_MILLION) {
-- ast_log(LOG_WARNING, "warning too large timestamp %ld.%ld\n",
-- (long)a.tv_sec, (long int) a.tv_usec);
-+ ast_log(LOG_WARNING, "warning too large timestamp %jd.%ld\n",
-+ (intmax_t)a.tv_sec, (long int) a.tv_usec);
- a.tv_sec += a.tv_usec / ONE_MILLION;
- a.tv_usec %= ONE_MILLION;
- } else if (a.tv_usec < 0) {
-- ast_log(LOG_WARNING, "warning negative timestamp %ld.%ld\n",
-- (long)a.tv_sec, (long int) a.tv_usec);
-+ ast_log(LOG_WARNING, "warning negative timestamp %jd.%ld\n",
-+ (intmax_t)a.tv_sec, (long int) a.tv_usec);
- a.tv_usec = 0;
- }
- return a;
diff --git a/comms/asterisk15/patches/patch-utils_smsq.c b/comms/asterisk15/patches/patch-utils_smsq.c
deleted file mode 100644
index c189d749466..00000000000
--- a/comms/asterisk15/patches/patch-utils_smsq.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-utils_smsq.c,v 1.1 2018/07/16 21:53:05 joerg Exp $
-
---- utils/smsq.c.orig 2015-10-09 21:48:48.000000000 +0000
-+++ utils/smsq.c
-@@ -687,7 +687,7 @@ main (int argc, const char *argv[])
- snprintf (temp, sizeof(temp), "sms/.smsq-%d", (int)getpid ());
- mkdir ("sms", 0777); /* ensure directory exists */
- mkdir (dir, 0777); /* ensure directory exists */
-- snprintf (queuename, sizeof(queuename), "%s/%s.%ld-%d", dir, *queue ? queue : "0", (long)time (0), (int)getpid ());
-+ snprintf (queuename, sizeof(queuename), "%s/%s.%jd-%d", dir, *queue ? queue : "0", (intmax_t)time (0), (int)getpid ());
- f = fopen (temp, "w");
- if (!f)
- {