summaryrefslogtreecommitdiff
path: root/comms/asterisk18/patches
diff options
context:
space:
mode:
authorjnemeth <jnemeth@pkgsrc.org>2010-12-15 03:22:43 +0000
committerjnemeth <jnemeth@pkgsrc.org>2010-12-15 03:22:43 +0000
commitc8ba94232c89598cff57e0e802b154e7497dfaf5 (patch)
tree3d0853b135d1850fb31980488515f5cb91535195 /comms/asterisk18/patches
parent20604c489dc5e0bd53f695828ae6bc764d55cb29 (diff)
downloadpkgsrc-c8ba94232c89598cff57e0e802b154e7497dfaf5.tar.gz
Import Asterisk 1.8.1:
Asterisk is a complete PBX in software. It provides all of the features you would expect from a PBX and more. Asterisk does voice over IP in three protocols, and can interoperate with almost all standards-based telephony equipment using relatively inexpensive hardware. Asterisk 1.8 is a long term support version (i.e. it will be supported for four years with an additional year of security only fixes). See: https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions What's new: Asterisk 1.8 is the next major release series of Asterisk. The release of Asterisk 1.8.0 would not have been possible without the support and contributions of the community. Since Asterisk 1.6.2, we've had over 500 reporters, more than 300 testers and greater than 200 developers contributed to this release. You can find a summary of the work involved with the 1.8.0 release in the sumary: http://svn.asterisk.org/svn/asterisk/tags/1.8.0/asterisk-1.8.0-summary.txt A short list of available features includes: * Secure RTP * IPv6 Support in the SIP channel driver * Connected Party Identification Support * Calendaring Integration * A new call logging system, Channel Event Logging (CEL) * Distributed Device State using Jabber/XMPP PubSub * Call Completion Supplementary Services support * Advice of Charge support * Much, much more! A full list of new features can be found in the CHANGES file. http://svn.digium.com/view/asterisk/branches/1.8/CHANGES?view=markup For a full list of changes in the current release candidate, please see the ChangeLog: http://downloads.asterisk.org/pub/telephony/asterisk/ChangeLog-1.8.0 ----- The Asterisk Development Team has announced the release of Asterisk 1.8.1. The release of Asterisk 1.8.1 resolves several issues reported by the community and would have not been possible without your participation. Thank you! The following is a sample of the issues resolved in this release: * Fix issue when using directmedia. Asterisk needs to limit the codecs offered to just the ones that both sides recognize, otherwise they may end up sending audio that the other side doesn't understand. (Closes issue #17403. Reported, patched by one47. Tested by one47, falves11) * Resolve issue where Party A in an analog 3-way call would continue to hear ringback after party C answers. (Patched by rmudgett) * Fix playback failure when using IAX with the timerfd module. (Closes issue #18110. Reported, tested by tpanton. Patched by jpeeler) * Fix problem with qualify option packets for realtime peers never stopping. The option packets not only never stopped, but if a realtime peer was not in the peer list multiple options dialogs could accumulate over time. (Closes issue #16382. Reported by lftsy. Tested by zerohalo. Patched by jpeeler) * Fix issue where it is possible to crash Asterisk by feeding the curl engine invalid data. (Closes issue #18161. Reported by wdoekes. Patched by tilghman) For a full list of changes in this release, please see the ChangeLog: http://downloads.asterisk.org/pub/telephony/asterisk/ChangeLog-1.8.1
Diffstat (limited to 'comms/asterisk18/patches')
-rw-r--r--comms/asterisk18/patches/patch-aa126
-rw-r--r--comms/asterisk18/patches/patch-af26
-rw-r--r--comms/asterisk18/patches/patch-ag34
-rw-r--r--comms/asterisk18/patches/patch-ai16
-rw-r--r--comms/asterisk18/patches/patch-ak13
-rw-r--r--comms/asterisk18/patches/patch-al13
-rw-r--r--comms/asterisk18/patches/patch-am13
-rw-r--r--comms/asterisk18/patches/patch-an13
-rw-r--r--comms/asterisk18/patches/patch-ao22
-rw-r--r--comms/asterisk18/patches/patch-ap14
-rw-r--r--comms/asterisk18/patches/patch-aq31
-rw-r--r--comms/asterisk18/patches/patch-ar14
-rw-r--r--comms/asterisk18/patches/patch-as41
-rw-r--r--comms/asterisk18/patches/patch-at49
-rw-r--r--comms/asterisk18/patches/patch-au25
-rw-r--r--comms/asterisk18/patches/patch-av19
-rw-r--r--comms/asterisk18/patches/patch-aw19
-rw-r--r--comms/asterisk18/patches/patch-ax165
-rw-r--r--comms/asterisk18/patches/patch-ay84
-rw-r--r--comms/asterisk18/patches/patch-az22
-rw-r--r--comms/asterisk18/patches/patch-ba20
-rw-r--r--comms/asterisk18/patches/patch-bb22
-rw-r--r--comms/asterisk18/patches/patch-bc181
23 files changed, 982 insertions, 0 deletions
diff --git a/comms/asterisk18/patches/patch-aa b/comms/asterisk18/patches/patch-aa
new file mode 100644
index 00000000000..d4889a104a2
--- /dev/null
+++ b/comms/asterisk18/patches/patch-aa
@@ -0,0 +1,126 @@
+$NetBSD: patch-aa,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- Makefile.orig 2010-11-11 22:13:38.000000000 +0000
++++ Makefile
+@@ -126,7 +126,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
+ MODULES_DIR=$(ASTLIBDIR)/modules
+ AGI_DIR=$(ASTDATADIR)/agi-bin
+
+@@ -216,10 +216,6 @@ ifeq ($(AST_DEVMODE),yes)
+ _ASTCFLAGS+=-Wformat=2
+ endif
+
+-ifneq ($(findstring BSD,$(OSARCH)),)
+- _ASTCFLAGS+=-isystem /usr/local/include
+-endif
+-
+ ifeq ($(findstring -march,$(_ASTCFLAGS) $(ASTCFLAGS)),)
+ ifneq ($(PROC),ultrasparc)
+ _ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
+@@ -449,7 +445,7 @@ distclean: $(SUBDIRS_DIST_CLEAN) _clean
+ rm -rf doc/api
+ rm -f build_tools/menuselect-deps
+
+-datafiles: _all doc/core-en_US.xml
++datafiles: doc/core-en_US.xml
+ CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig $(DESTDIR)$(libdir)/pkgconfig;
+ # Should static HTTP be installed during make samples or even with its own target ala
+ # webvoicemail? There are portions here that *could* be customized but might also be
+@@ -468,7 +464,6 @@ datafiles: _all doc/core-en_US.xml
+ for x in images/*.jpg; do \
+ $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/images ; \
+ done
+- $(MAKE) -C sounds install
+
+ doc/core-en_US.xml: $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
+ @printf "Building Documentation For: "
+@@ -520,7 +515,7 @@ OLDHEADERS=$(filter-out $(NEWHEADERS),$(
+ installdirs:
+ $(INSTALL) -d "$(DESTDIR)$(MODULES_DIR)"
+ $(INSTALL) -d "$(DESTDIR)$(ASTSBINDIR)"
+- $(INSTALL) -d "$(DESTDIR)$(ASTETCDIR)"
++ $(INSTALL) -d "$(DESTDIR)$(ASTEXAMPLEDIR)"
+ $(INSTALL) -d "$(DESTDIR)$(ASTVARRUNDIR)"
+ $(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)"
+ $(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/dictate"
+@@ -547,8 +542,9 @@ installdirs:
+ $(INSTALL) -d "$(DESTDIR)$(ASTDATADIR)/static-http"
+ $(INSTALL) -d "$(DESTDIR)$(ASTMANDIR)/man8"
+ $(INSTALL) -d "$(DESTDIR)$(AGI_DIR)"
++ $(INSTALL) -d "$(DESTDIR)$(ASTDBDIR)"
+
+-bininstall: _all installdirs $(SUBDIRS_INSTALL)
++bininstall: installdirs $(SUBDIRS_INSTALL)
+ $(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
+ $(LN) -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
+ $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
+@@ -640,21 +636,21 @@ upgrade: bininstall
+ # XXX why *.adsi is installed first ?
+ adsi:
+ @echo Installing adsi config files...
+- $(INSTALL) -d $(DESTDIR)$(ASTETCDIR)
++ $(INSTALL) -d $(DESTDIR)$(ASTEXAMPLEDIR)
+ @for x in configs/*.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
+ @echo Installing other config files...
+ @for x in configs/*.sample; do \
+- dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`" ; \
++ dst="$(DESTDIR)$(ASTEXAMPLEDIR)/`$(BASENAME) $$x .sample`" ; \
+ if [ -f $${dst} ]; then \
+ if [ "$(OVERWRITE)" = "y" ]; then \
+ if cmp -s $${dst} $$x ; then \
+@@ -682,9 +678,9 @@ samples: adsi
+ -e 's|^astspooldir.*$$|astspooldir => $(ASTSPOOLDIR)|' \
+ -e 's|^astrundir.*$$|astrundir => $(ASTVARRUNDIR)|' \
+ -e 's|^astlogdir.*$$|astlogdir => $(ASTLOGDIR)|' \
+- $(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 ; \
+ $(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
+ build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
+@@ -710,7 +706,7 @@ samples: adsi
+ 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/; \
+@@ -854,7 +850,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
+@@ -923,6 +919,7 @@ menuselect-tree: $(foreach dir,$(filter-
+ @echo "</menu>" >> $@
+
+ .PHONY: menuselect
++.PHONY: menuselect.makeopts
+ .PHONY: main
+ .PHONY: sounds
+ .PHONY: clean
diff --git a/comms/asterisk18/patches/patch-af b/comms/asterisk18/patches/patch-af
new file mode 100644
index 00000000000..9a1066c6df9
--- /dev/null
+++ b/comms/asterisk18/patches/patch-af
@@ -0,0 +1,26 @@
+$NetBSD: patch-af,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+Index: utils/Makefile
+===================================================================
+--- utils/Makefile.orig 2010-04-22 22:10:17.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) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
+ fi; \
+ done
+
diff --git a/comms/asterisk18/patches/patch-ag b/comms/asterisk18/patches/patch-ag
new file mode 100644
index 00000000000..74944cc7dec
--- /dev/null
+++ b/comms/asterisk18/patches/patch-ag
@@ -0,0 +1,34 @@
+$NetBSD: patch-ag,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- codecs/lpc10/Makefile.orig 2007-10-29 15:24:44.000000000 -0700
++++ codecs/lpc10/Makefile
+@@ -31,19 +31,21 @@ ASTCFLAGS:= $(ASTCFLAGS:-Werror=)
+ ifneq ($(OSARCH),Darwin)
+ ifneq ($(findstring BSD,${OSARCH}),BSD)
+ ifneq ($(PROC),ppc)
+- ifneq ($(PROC),x86_64)
+- ifneq ($(PROC),alpha)
++ ifneq ($(PROC),powerpc)
++ ifneq ($(PROC),x86_64)
++ ifneq ($(PROC),alpha)
+ #The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
+ #This works for even old (2.96) versions of gcc and provides a small boost either way.
+ #A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn.t support it.
+ #So we go lowest common available by gcc and go a step down, still a step up from
+ #the default as we now have a better instruction set to work with. - Belgarath
+- ifeq ($(PROC),ultrasparc)
+- CFLAGS+= -mtune=$(PROC) -mcpu=v8 -O3 -fomit-frame-pointer
+- else
+- ifneq ($(OSARCH),SunOS)
+- ifneq ($(OSARCH),arm)
+-# CFLAGS+= -march=$(PROC)
++ ifeq ($(PROC),ultrasparc)
++ CFLAGS+= -mtune=$(PROC) -mcpu=v8 -O3 -fomit-frame-pointer
++ else
++ ifneq ($(OSARCH),SunOS)
++ ifneq ($(OSARCH),arm)
++# CFLAGS+= -march=$(PROC)
++ endif
+ endif
+ endif
+ endif
diff --git a/comms/asterisk18/patches/patch-ai b/comms/asterisk18/patches/patch-ai
new file mode 100644
index 00000000000..4388ba7482d
--- /dev/null
+++ b/comms/asterisk18/patches/patch-ai
@@ -0,0 +1,16 @@
+$NetBSD: patch-ai,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- include/asterisk/endian.h.orig 2008-10-09 10:51:25.000000000 -0700
++++ include/asterisk/endian.h
+@@ -31,6 +31,11 @@
+ #ifndef __BYTE_ORDER
+ #ifdef __linux__
+ #include <endian.h>
++#elif defined(__DragonFly__)
++#include <sys/endian.h>
++#define __BYTE_ORDER BYTE_ORDER
++#define __LITTLE_ENDIAN LITTLE_ENDIAN
++#define __BIG_ENDIAN BIG_ENDIAN
+ #elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+ #if defined(__OpenBSD__)
+ #include "asterisk/compat.h"
diff --git a/comms/asterisk18/patches/patch-ak b/comms/asterisk18/patches/patch-ak
new file mode 100644
index 00000000000..b514860e219
--- /dev/null
+++ b/comms/asterisk18/patches/patch-ak
@@ -0,0 +1,13 @@
+$NetBSD: patch-ak,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- channels/chan_oss.c.orig 2008-11-02 16:39:04.000000000 -0800
++++ channels/chan_oss.c
+@@ -47,7 +47,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
+
+ #ifdef __linux
+ #include <linux/soundcard.h>
+-#elif defined(__FreeBSD__) || defined(__CYGWIN__)
++#elif defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__DragonFly__)
+ #include <sys/soundcard.h>
+ #else
+ #include <soundcard.h>
diff --git a/comms/asterisk18/patches/patch-al b/comms/asterisk18/patches/patch-al
new file mode 100644
index 00000000000..623f6d13f3a
--- /dev/null
+++ b/comms/asterisk18/patches/patch-al
@@ -0,0 +1,13 @@
+$NetBSD: patch-al,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- pbx/pbx_dundi.c.orig 2010-06-22 15:00:11.000000000 +0000
++++ pbx/pbx_dundi.c
+@@ -37,7 +37,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>
diff --git a/comms/asterisk18/patches/patch-am b/comms/asterisk18/patches/patch-am
new file mode 100644
index 00000000000..64aeed0780f
--- /dev/null
+++ b/comms/asterisk18/patches/patch-am
@@ -0,0 +1,13 @@
+$NetBSD: patch-am,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- apps/app_sms.c.orig 2010-09-30 15:39:45.000000000 +0000
++++ apps/app_sms.c
+@@ -549,7 +549,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;
diff --git a/comms/asterisk18/patches/patch-an b/comms/asterisk18/patches/patch-an
new file mode 100644
index 00000000000..197e4a27711
--- /dev/null
+++ b/comms/asterisk18/patches/patch-an
@@ -0,0 +1,13 @@
+$NetBSD: patch-an,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- utils/streamplayer.c.orig 2008-11-02 16:39:04.000000000 -0800
++++ utils/streamplayer.c
+@@ -49,7 +49,7 @@
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__Darwin__) || defined(__CYGWIN__)
++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__Darwin__) || defined(__CYGWIN__) || defined(__DragonFly__)
+ #include <netinet/in.h>
+ #endif
+ #include <sys/time.h>
diff --git a/comms/asterisk18/patches/patch-ao b/comms/asterisk18/patches/patch-ao
new file mode 100644
index 00000000000..265e18c8240
--- /dev/null
+++ b/comms/asterisk18/patches/patch-ao
@@ -0,0 +1,22 @@
+$NetBSD: patch-ao,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- build_tools/mkpkgconfig.orig 2007-08-22 11:54:30.000000000 -0700
++++ build_tools/mkpkgconfig
+@@ -21,12 +25,15 @@ 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/\s*-pipe\s*//g' | ${EXTREGEX} 's/-[Wmp]\S*\s*//g' | \
++LOCAL_CFLAGS=`echo $CFLAGS | ${EXTREGEX} 's/\-pipe\s*//g' | ${EXTREGEX} 's/-[Wmp]\S*\s*//g' | \
+ ${EXTREGEX} 's/-I(include|\.\.\/include) //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/-DAST(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR)=\S* //g' | \
++ ${EXTREGEX} "s;${WRKSRC};${PREFIX};g"`
+
+
+ cat <<EOF > $PPATH/asterisk.pc
diff --git a/comms/asterisk18/patches/patch-ap b/comms/asterisk18/patches/patch-ap
new file mode 100644
index 00000000000..5a646924d06
--- /dev/null
+++ b/comms/asterisk18/patches/patch-ap
@@ -0,0 +1,14 @@
+$NetBSD: patch-ap,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- configure.ac.orig 2010-11-09 20:33:05.000000000 +0000
++++ configure.ac
+@@ -981,6 +981,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/asterisk18/patches/patch-aq b/comms/asterisk18/patches/patch-aq
new file mode 100644
index 00000000000..ae0cfbfffc3
--- /dev/null
+++ b/comms/asterisk18/patches/patch-aq
@@ -0,0 +1,31 @@
+$NetBSD: patch-aq,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- configure.orig 2010-11-09 20:33:05.000000000 +0000
++++ configure
+@@ -16365,6 +16365,17 @@ fi
+
+
+
++ac_fn_c_check_header_mongrel "$LINENO" "sys/atomic.h" "ac_cv_header_sys_atomic_h" "$ac_includes_default"
++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]];'.
+@@ -17346,6 +17357,8 @@ $as_echo_n "checking if \"struct ifaddrs
+
+ 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/asterisk18/patches/patch-ar b/comms/asterisk18/patches/patch-ar
new file mode 100644
index 00000000000..8cd17a8cdca
--- /dev/null
+++ b/comms/asterisk18/patches/patch-ar
@@ -0,0 +1,14 @@
+$NetBSD: patch-ar,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- include/asterisk/autoconfig.h.in.orig 2010-11-09 20:33:05.000000000 +0000
++++ include/asterisk/autoconfig.h.in
+@@ -864,6 +864,9 @@
+ /* Define to 1 if you have the <syslog.h> header file. */
+ #undef HAVE_SYSLOG_H
+
++/* 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/asterisk18/patches/patch-as b/comms/asterisk18/patches/patch-as
new file mode 100644
index 00000000000..08b18f01392
--- /dev/null
+++ b/comms/asterisk18/patches/patch-as
@@ -0,0 +1,41 @@
+$NetBSD: patch-as,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- include/asterisk/lock.h.orig 2010-07-03 02:36:31.000000000 +0000
++++ include/asterisk/lock.h
+@@ -580,6 +580,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.
+@@ -599,6 +603,12 @@ AST_INLINE_API(int ast_atomic_fetchadd_i
+ AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
+ {
+ 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__)
+ #ifdef sun
+ AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
+@@ -645,6 +655,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),
+ {
diff --git a/comms/asterisk18/patches/patch-at b/comms/asterisk18/patches/patch-at
new file mode 100644
index 00000000000..ea88e183f0a
--- /dev/null
+++ b/comms/asterisk18/patches/patch-at
@@ -0,0 +1,49 @@
+$NetBSD: patch-at,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- utils/extconf.c.orig 2010-06-10 08:15:45.000000000 +0000
++++ utils/extconf.c
+@@ -790,6 +790,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.
+@@ -803,12 +807,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),
+ {
+@@ -850,6 +860,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),
+ {
diff --git a/comms/asterisk18/patches/patch-au b/comms/asterisk18/patches/patch-au
new file mode 100644
index 00000000000..c8847359521
--- /dev/null
+++ b/comms/asterisk18/patches/patch-au
@@ -0,0 +1,25 @@
+$NetBSD: patch-au,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- sounds/Makefile.orig 2010-10-18 22:01:16.000000000 +0000
++++ sounds/Makefile
+@@ -135,20 +135,6 @@ endif
+ all: $(SOUNDS_CACHE_DIR) $(CORE_SOUNDS) $(EXTRA_SOUNDS) $(MOH)
+
+ have_download:
+- @if test "$(DOWNLOAD)" = ":" ; then \
+- echo "**************************************************"; \
+- echo "*** ***"; \
+- echo "*** You must have either wget or fetch to be ***"; \
+- echo "*** able to automatically download and install ***"; \
+- echo "*** 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/asterisk18/patches/patch-av b/comms/asterisk18/patches/patch-av
new file mode 100644
index 00000000000..5f112f72a03
--- /dev/null
+++ b/comms/asterisk18/patches/patch-av
@@ -0,0 +1,19 @@
+$NetBSD: patch-av,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- apps/app_dial.c.orig 2010-10-21 00:07:17.000000000 +0000
++++ apps/app_dial.c
+@@ -1728,12 +1728,12 @@ static void end_bridge_callback(void *da
+
+ ast_channel_lock(chan);
+ if (chan->cdr->answer.tv_sec) {
+- snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->answer.tv_sec);
++ snprintf(buf, sizeof(buf), "%jd", (intmax_t) ((long) end - chan->cdr->answer.tv_sec));
+ pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", buf);
+ }
+
+ if (chan->cdr->start.tv_sec) {
+- snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->start.tv_sec);
++ snprintf(buf, sizeof(buf), "%jd", (intmax_t) ((long) end - chan->cdr->start.tv_sec));
+ pbx_builtin_setvar_helper(chan, "DIALEDTIME", buf);
+ }
+ ast_channel_unlock(chan);
diff --git a/comms/asterisk18/patches/patch-aw b/comms/asterisk18/patches/patch-aw
new file mode 100644
index 00000000000..48a2ef04d68
--- /dev/null
+++ b/comms/asterisk18/patches/patch-aw
@@ -0,0 +1,19 @@
+$NetBSD: patch-aw,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- apps/app_followme.c.orig 2010-09-02 05:20:59.000000000 +0000
++++ apps/app_followme.c
+@@ -992,12 +992,12 @@ static void end_bridge_callback(void *da
+
+ ast_channel_lock(chan);
+ if (chan->cdr->answer.tv_sec) {
+- snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->answer.tv_sec);
++ snprintf(buf, sizeof(buf), "%jd", (intmax_t) ((long) end - chan->cdr->answer.tv_sec));
+ pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", buf);
+ }
+
+ if (chan->cdr->start.tv_sec) {
+- snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->start.tv_sec);
++ snprintf(buf, sizeof(buf), "%jd", (intmax_t) ((long) end - chan->cdr->start.tv_sec));
+ pbx_builtin_setvar_helper(chan, "DIALEDTIME", buf);
+ }
+ ast_channel_unlock(chan);
diff --git a/comms/asterisk18/patches/patch-ax b/comms/asterisk18/patches/patch-ax
new file mode 100644
index 00000000000..aa02b538d09
--- /dev/null
+++ b/comms/asterisk18/patches/patch-ax
@@ -0,0 +1,165 @@
+$NetBSD: patch-ax,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- apps/app_queue.c.orig 2010-09-21 20:29:59.000000000 +0000
++++ apps/app_queue.c
+@@ -3180,8 +3180,8 @@ static void record_abandoned(struct queu
+ "Uniqueid: %s\r\n"
+ "Position: %d\r\n"
+ "OriginalPosition: %d\r\n"
+- "HoldTime: %d\r\n",
+- qe->parent->name, qe->chan->uniqueid, qe->pos, qe->opos, (int)(time(NULL) - qe->start));
++ "HoldTime: %jd\r\n",
++ qe->parent->name, qe->chan->uniqueid, qe->pos, qe->opos, (intmax_t)(time(NULL) - qe->start));
+
+ qe->parent->callsabandoned++;
+ ao2_unlock(qe->parent);
+@@ -3768,7 +3768,7 @@ static int wait_our_turn(struct queue_en
+
+ if ((status = get_member_status(qe->parent, qe->max_penalty, qe->min_penalty, qe->parent->leavewhenempty))) {
+ *reason = QUEUE_LEAVEEMPTY;
+- ast_queue_log(qe->parent->name, qe->chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe->pos, qe->opos, (long) time(NULL) - qe->start);
++ ast_queue_log(qe->parent->name, qe->chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%jd", qe->pos, qe->opos, (intmax_t) time(NULL) - qe->start);
+ leave_queue(qe);
+ break;
+ }
+@@ -3972,12 +3972,12 @@ static void send_agent_complete(const st
+ "Channel: %s\r\n"
+ "Member: %s\r\n"
+ "MemberName: %s\r\n"
+- "HoldTime: %ld\r\n"
+- "TalkTime: %ld\r\n"
++ "HoldTime: %jd\r\n"
++ "TalkTime: %jd\r\n"
+ "Reason: %s\r\n"
+ "%s",
+ queuename, qe->chan->uniqueid, peer->name, member->interface, member->membername,
+- (long)(callstart - qe->start), (long)(time(NULL) - callstart), reason,
++ (intmax_t)(callstart - qe->start), (intmax_t)(time(NULL) - callstart), reason,
+ qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, vars_len) : "");
+ }
+
+@@ -4020,9 +4020,9 @@ static void queue_transfer_fixup(void *d
+ int callcompletedinsl = qtds->callcompletedinsl;
+ struct ast_datastore *datastore;
+
+- ast_queue_log(qe->parent->name, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld|%d",
+- new_chan->exten, new_chan->context, (long) (callstart - qe->start),
+- (long) (time(NULL) - callstart), qe->opos);
++ ast_queue_log(qe->parent->name, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%jd|%jd|%d",
++ new_chan->exten, new_chan->context, (intmax_t) (callstart - qe->start),
++ (intmax_t) (time(NULL) - callstart), qe->opos);
+
+ update_queue(qe->parent, member, callcompletedinsl, (time(NULL) - callstart));
+
+@@ -4516,7 +4516,7 @@ static int try_calling(struct queue_ent
+ } else if (res2) {
+ /* Caller must have hung up just before being connected*/
+ ast_log(LOG_NOTICE, "Caller was about to talk to agent on %s but the caller hungup.\n", peer->name);
+- ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "ABANDON", "%d|%d|%ld", qe->pos, qe->opos, (long) time(NULL) - qe->start);
++ ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "ABANDON", "%d|%d|%jd", qe->pos, qe->opos, (intmax_t) time(NULL) - qe->start);
+ record_abandoned(qe);
+ ast_hangup(peer);
+ ao2_ref(member, -1);
+@@ -4562,8 +4562,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) {
+- snprintf(interfacevar, sizeof(interfacevar), "QEHOLDTIME=%ld,QEORIGINALPOS=%d",
+- (long) time(NULL) - qe->start, qe->opos);
++ snprintf(interfacevar, sizeof(interfacevar), "QEHOLDTIME=%jd,QEORIGINALPOS=%d",
++ (intmax_t) time(NULL) - qe->start, qe->opos);
+ pbx_builtin_setvar_multiple(qe->chan, interfacevar);
+ pbx_builtin_setvar_multiple(peer, interfacevar);
+ }
+@@ -4808,8 +4808,8 @@ static int try_calling(struct queue_ent
+ ast_log(LOG_WARNING, "Asked to execute an AGI on this channel, but could not find application (agi)!\n");
+ }
+ qe->handled++;
+- ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "CONNECT", "%ld|%s|%ld", (long) time(NULL) - qe->start, peer->uniqueid,
+- (long)(orig - to > 0 ? (orig - to) / 1000 : 0));
++ ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "CONNECT", "%jd|%s|%jd", (intmax_t) time(NULL) - qe->start, peer->uniqueid,
++ (intmax_t)(orig - to > 0 ? (orig - to) / 1000 : 0));
+ if (update_cdr && qe->chan->cdr)
+ ast_copy_string(qe->chan->cdr->dstchannel, member->membername, sizeof(qe->chan->cdr->dstchannel));
+ if (qe->parent->eventwhencalled)
+@@ -4819,12 +4819,12 @@ static int try_calling(struct queue_ent
+ "Channel: %s\r\n"
+ "Member: %s\r\n"
+ "MemberName: %s\r\n"
+- "Holdtime: %ld\r\n"
++ "Holdtime: %jd\r\n"
+ "BridgedChannel: %s\r\n"
+- "Ringtime: %ld\r\n"
++ "Ringtime: %jd\r\n"
+ "%s",
+ queuename, qe->chan->uniqueid, peer->name, member->interface, member->membername,
+- (long) time(NULL) - qe->start, peer->uniqueid, (long)(orig - to > 0 ? (orig - to) / 1000 : 0),
++ (intmax_t) time(NULL) - qe->start, peer->uniqueid, (intmax_t)(orig - to > 0 ? (orig - to) / 1000 : 0),
+ qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
+ ast_copy_string(oldcontext, qe->chan->context, sizeof(oldcontext));
+ ast_copy_string(oldexten, qe->chan->exten, sizeof(oldexten));
+@@ -4856,17 +4856,17 @@ static int try_calling(struct queue_ent
+
+ /* detect a blind transfer */
+ if (!(qe->chan->_softhangup | peer->_softhangup) && (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten))) {
+- ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld|%d",
+- qe->chan->exten, qe->chan->context, (long) (callstart - qe->start),
+- (long) (time(NULL) - callstart), qe->opos);
++ ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%jd|%jd|%d",
++ qe->chan->exten, qe->chan->context, (intmax_t) (callstart - qe->start),
++ (intmax_t) (time(NULL) - callstart), qe->opos);
+ send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), TRANSFER);
+ } else if (ast_check_hangup(qe->chan)) {
+- ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETECALLER", "%ld|%ld|%d",
+- (long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
++ ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETECALLER", "%jd|%jd|%d",
++ (intmax_t) (callstart - qe->start), (intmax_t) (time(NULL) - callstart), qe->opos);
+ send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), CALLER);
+ } else {
+- ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETEAGENT", "%ld|%ld|%d",
+- (long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
++ ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETEAGENT", "%jd|%jd|%d",
++ (intmax_t) (callstart - qe->start), (intmax_t) (time(NULL) - callstart), qe->opos);
+ send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), AGENT);
+ }
+ if ((tds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL))) {
+@@ -5765,8 +5765,8 @@ check_turns:
+ record_abandoned(&qe);
+ reason = QUEUE_TIMEOUT;
+ res = 0;
+- ast_queue_log(args.queuename, chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld",
+- qe.pos, qe.opos, (long) time(NULL) - qe.start);
++ ast_queue_log(args.queuename, chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d|%d|%jd",
++ qe.pos, qe.opos, (intmax_t) time(NULL) - qe.start);
+ break;
+ }
+
+@@ -5808,7 +5808,7 @@ check_turns:
+ if ((status = get_member_status(qe.parent, qe.max_penalty, qe.min_penalty, qe.parent->leavewhenempty))) {
+ record_abandoned(&qe);
+ reason = QUEUE_LEAVEEMPTY;
+- ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe.pos, qe.opos, (long)(time(NULL) - qe.start));
++ ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%jd", qe.pos, qe.opos, (intmax_t)(time(NULL) - qe.start));
+ res = 0;
+ break;
+ }
+@@ -5830,7 +5830,7 @@ check_turns:
+ record_abandoned(&qe);
+ reason = QUEUE_TIMEOUT;
+ res = 0;
+- ast_queue_log(qe.parent->name, qe.chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", qe.pos, qe.opos, (long) time(NULL) - qe.start);
++ ast_queue_log(qe.parent->name, qe.chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d|%d|%jd", qe.pos, qe.opos, (intmax_t) time(NULL) - qe.start);
+ break;
+ }
+
+@@ -5857,8 +5857,8 @@ stop:
+ if (!qe.handled) {
+ record_abandoned(&qe);
+ ast_queue_log(args.queuename, chan->uniqueid, "NONE", "ABANDON",
+- "%d|%d|%ld", qe.pos, qe.opos,
+- (long) time(NULL) - qe.start);
++ "%d|%d|%jd", qe.pos, qe.opos,
++ (intmax_t) time(NULL) - qe.start);
+ res = -1;
+ } else if (qcontinue) {
+ reason = QUEUE_CONTINUE;
diff --git a/comms/asterisk18/patches/patch-ay b/comms/asterisk18/patches/patch-ay
new file mode 100644
index 00000000000..737588f428c
--- /dev/null
+++ b/comms/asterisk18/patches/patch-ay
@@ -0,0 +1,84 @@
+$NetBSD: patch-ay,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- main/features.c.orig 2010-09-29 21:12:43.000000000 +0000
++++ main/features.c
+@@ -1005,12 +1005,12 @@ static int park_call_full(struct ast_cha
+ "Channel: %s\r\n"
+ "Parkinglot: %s\r\n"
+ "From: %s\r\n"
+- "Timeout: %ld\r\n"
++ "Timeout: %jd\r\n"
+ "CallerIDNum: %s\r\n"
+ "CallerIDName: %s\r\n"
+ "Uniqueid: %s\r\n",
+ pu->parkingexten, pu->chan->name, pu->parkinglot->name, event_from ? event_from : "",
+- (long)pu->start.tv_sec + (long)(pu->parkingtime/1000) - (long)time(NULL),
++ (intmax_t)pu->start.tv_sec + (intmax_t)(pu->parkingtime/1000) - (intmax_t)time(NULL),
+ S_COR(pu->chan->caller.id.number.valid, pu->chan->caller.id.number.str, "<unknown>"),
+ S_COR(pu->chan->caller.id.name.valid, pu->chan->caller.id.name.str, "<unknown>"),
+ pu->chan->uniqueid
+@@ -1473,7 +1473,7 @@ static int builtin_automonitor(struct as
+ len = strlen(touch_monitor) + 50;
+ args = alloca(len);
+ touch_filename = alloca(len);
+- snprintf(touch_filename, len, "%s-%ld-%s", S_OR(touch_monitor_prefix, "auto"), (long)time(NULL), touch_monitor);
++ snprintf(touch_filename, len, "%s-%jd-%s", S_OR(touch_monitor_prefix, "auto"), (intmax_t)time(NULL), touch_monitor);
+ snprintf(args, len, "%s,%s,m", S_OR(touch_format, "wav"), touch_filename);
+ } else {
+ caller_chan_id = ast_strdupa(S_COR(caller_chan->caller.id.number.valid,
+@@ -1483,7 +1483,7 @@ static int builtin_automonitor(struct as
+ len = strlen(caller_chan_id) + strlen(callee_chan_id) + 50;
+ args = alloca(len);
+ touch_filename = alloca(len);
+- snprintf(touch_filename, len, "%s-%ld-%s-%s", S_OR(touch_monitor_prefix, "auto"), (long)time(NULL), caller_chan_id, callee_chan_id);
++ snprintf(touch_filename, len, "%s-%jd-%s-%s", S_OR(touch_monitor_prefix, "auto"), (intmax_t)time(NULL), caller_chan_id, callee_chan_id);
+ snprintf(args, len, "%s,%s,m", S_OR(touch_format, "wav"), touch_filename);
+ }
+
+@@ -1589,7 +1589,7 @@ static int builtin_automixmonitor(struct
+ len = strlen(touch_monitor) + 50;
+ args = alloca(len);
+ touch_filename = alloca(len);
+- snprintf(touch_filename, len, "auto-%ld-%s", (long)time(NULL), touch_monitor);
++ snprintf(touch_filename, len, "auto-%jd-%s", (intmax_t)time(NULL), touch_monitor);
+ snprintf(args, len, "%s.%s,b", touch_filename, (touch_format) ? touch_format : "wav");
+ } else {
+ caller_chan_id = ast_strdupa(S_COR(caller_chan->caller.id.number.valid,
+@@ -1599,7 +1599,7 @@ static int builtin_automixmonitor(struct
+ len = strlen(caller_chan_id) + strlen(callee_chan_id) + 50;
+ args = alloca(len);
+ touch_filename = alloca(len);
+- snprintf(touch_filename, len, "auto-%ld-%s-%s", (long)time(NULL), caller_chan_id, callee_chan_id);
++ snprintf(touch_filename, len, "auto-%jd-%s-%s", (intmax_t)time(NULL), caller_chan_id, callee_chan_id);
+ snprintf(args, len, "%s.%s,b", touch_filename, S_OR(touch_format, "wav"));
+ }
+
+@@ -5089,10 +5089,10 @@ static char *handle_parkedcalls(struct a
+
+ AST_LIST_LOCK(&curlot->parkings);
+ AST_LIST_TRAVERSE(&curlot->parkings, cur, list) {
+- ast_cli(a->fd, "%-10.10s %25s (%-15s %-12s %-4d) %6lds\n"
++ ast_cli(a->fd, "%-10.10s %25s (%-15s %-12s %-4d) %6jds\n"
+ ,cur->parkingexten, cur->chan->name, cur->context, cur->exten
+ ,cur->priority,
+- (long)(cur->start.tv_sec + (cur->parkingtime/1000) - time(NULL)) );
++ (intmax_t)(cur->start.tv_sec + (cur->parkingtime/1000) - time(NULL)) );
+ numparked++;
+ numparked += lotparked;
+ }
+@@ -5144,13 +5144,13 @@ static int manager_parking_status(struct
+ "Exten: %d\r\n"
+ "Channel: %s\r\n"
+ "From: %s\r\n"
+- "Timeout: %ld\r\n"
++ "Timeout: %jd\r\n"
+ "CallerIDNum: %s\r\n"
+ "CallerIDName: %s\r\n"
+ "%s"
+ "\r\n",
+ cur->parkingnum, cur->chan->name, cur->peername,
+- (long) cur->start.tv_sec + (long) (cur->parkingtime / 1000) - (long) time(NULL),
++ (intmax_t) cur->start.tv_sec + (intmax_t) (cur->parkingtime / 1000) - (intmax_t) time(NULL),
+ S_COR(cur->chan->caller.id.number.valid, cur->chan->caller.id.number.str, ""), /* XXX in other places it is <unknown> */
+ S_COR(cur->chan->caller.id.name.valid, cur->chan->caller.id.name.str, ""),
+ idText);
diff --git a/comms/asterisk18/patches/patch-az b/comms/asterisk18/patches/patch-az
new file mode 100644
index 00000000000..e4b09bc657b
--- /dev/null
+++ b/comms/asterisk18/patches/patch-az
@@ -0,0 +1,22 @@
+$NetBSD: patch-az,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- main/manager.c.orig 2010-11-02 20:45:09.000000000 +0000
++++ main/manager.c
+@@ -1600,7 +1600,7 @@ static char *handle_showmanconn(struct a
+ struct mansession_session *session;
+ time_t now = time(NULL);
+ #define HSMCONN_FORMAT1 " %-15.15s %-15.15s %-10.10s %-10.10s %-8.8s %-8.8s %-5.5s %-5.5s\n"
+-#define HSMCONN_FORMAT2 " %-15.15s %-15.15s %-10d %-10d %-8d %-8d %-5.5d %-5.5d\n"
++#define HSMCONN_FORMAT2 " %-15.15s %-15.15s %-10jd %-10jd %-8d %-8d %-5.5d %-5.5d\n"
+ int count = 0;
+ struct ao2_iterator i;
+
+@@ -1621,7 +1621,7 @@ static char *handle_showmanconn(struct a
+ i = ao2_iterator_init(sessions, 0);
+ while ((session = ao2_iterator_next(&i))) {
+ ao2_lock(session);
+- ast_cli(a->fd, HSMCONN_FORMAT2, session->username, ast_inet_ntoa(session->sin.sin_addr), (int)(session->sessionstart), (int)(now - session->sessionstart), session->fd, session->inuse, session->readperm, session->writeperm);
++ ast_cli(a->fd, HSMCONN_FORMAT2, session->username, ast_inet_ntoa(session->sin.sin_addr), (intmax_t)(session->sessionstart), (intmax_t)(now - session->sessionstart), session->fd, session->inuse, session->readperm, session->writeperm);
+ count++;
+ ao2_unlock(session);
+ unref_mansession(session);
diff --git a/comms/asterisk18/patches/patch-ba b/comms/asterisk18/patches/patch-ba
new file mode 100644
index 00000000000..60749cf5a93
--- /dev/null
+++ b/comms/asterisk18/patches/patch-ba
@@ -0,0 +1,20 @@
+$NetBSD: patch-ba,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- main/sched.c.orig 2010-08-10 18:05:07.000000000 +0000
++++ main/sched.c
+@@ -579,12 +579,12 @@ void ast_sched_dump(struct sched_context
+ struct timeval delta;
+ q = ast_heap_peek(con->sched_heap, x);
+ delta = ast_tvsub(q->when, when);
+- ast_debug(1, "|%.4d | %-15p | %-15p | %.6ld : %.6ld |\n",
++ ast_debug(1, "|%.4d | %-15p | %-15p | %.6jd : %.6jd |\n",
+ q->id,
+ q->callback,
+ q->data,
+- (long)delta.tv_sec,
+- (long int)delta.tv_usec);
++ (intmax_t)delta.tv_sec,
++ (intmax_t)delta.tv_usec);
+ }
+ ast_mutex_unlock(&con->lock);
+ ast_debug(1, "=============================================================\n");
diff --git a/comms/asterisk18/patches/patch-bb b/comms/asterisk18/patches/patch-bb
new file mode 100644
index 00000000000..80aaea7f71e
--- /dev/null
+++ b/comms/asterisk18/patches/patch-bb
@@ -0,0 +1,22 @@
+$NetBSD: patch-bb,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- main/utils.c.orig 2010-08-06 18:57:10.000000000 +0000
++++ main/utils.c
+@@ -1353,13 +1353,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;
diff --git a/comms/asterisk18/patches/patch-bc b/comms/asterisk18/patches/patch-bc
new file mode 100644
index 00000000000..7b8322d1bad
--- /dev/null
+++ b/comms/asterisk18/patches/patch-bc
@@ -0,0 +1,181 @@
+$NetBSD: patch-bc,v 1.1.1.1 2010/12/15 03:22:45 jnemeth Exp $
+
+--- contrib/scripts/vmail.cgi.orig 2008-09-20 00:55:01.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);