aboutsummaryrefslogtreecommitdiff
path: root/net/asterisk10/files
diff options
context:
space:
mode:
Diffstat (limited to 'net/asterisk10/files')
-rw-r--r--net/asterisk10/files/patch-Makefile301
-rw-r--r--net/asterisk10/files/patch-agi::Makefile35
-rw-r--r--net/asterisk10/files/patch-apps::Makefile36
-rw-r--r--net/asterisk10/files/patch-apps::app_intercom.c14
-rw-r--r--net/asterisk10/files/patch-astman::Makefile14
-rw-r--r--net/asterisk10/files/patch-cdr::Makefile14
-rw-r--r--net/asterisk10/files/patch-channels::Makefile52
-rw-r--r--net/asterisk10/files/patch-channels::chan_h323.c13
-rw-r--r--net/asterisk10/files/patch-channels::chan_oss.c14
-rw-r--r--net/asterisk10/files/patch-channels::h323::Makefile64
-rw-r--r--net/asterisk10/files/patch-codecs::Makefile44
-rw-r--r--net/asterisk10/files/patch-codecs::codec_g723_1_dummy.c314
-rw-r--r--net/asterisk10/files/patch-codecs::codec_g729_dummy.c281
-rw-r--r--net/asterisk10/files/patch-codecs::g729_slin_ex.h20
-rw-r--r--net/asterisk10/files/patch-codecs::gsm::Makefile25
-rw-r--r--net/asterisk10/files/patch-codecs::ilbc::Makefile11
-rw-r--r--net/asterisk10/files/patch-codecs::lpc10::Makefile31
-rw-r--r--net/asterisk10/files/patch-codecs::slin_g729_ex.h31
-rw-r--r--net/asterisk10/files/patch-db.c14
-rw-r--r--net/asterisk10/files/patch-editline::configure14
-rw-r--r--net/asterisk10/files/patch-formats::Makefile23
-rw-r--r--net/asterisk10/files/patch-formats::format_g723_1.c351
-rw-r--r--net/asterisk10/files/patch-formats::format_g729.c47
-rw-r--r--net/asterisk10/files/patch-pbx::Makefile23
-rw-r--r--net/asterisk10/files/patch-res::Makefile14
25 files changed, 0 insertions, 1800 deletions
diff --git a/net/asterisk10/files/patch-Makefile b/net/asterisk10/files/patch-Makefile
deleted file mode 100644
index 1e4ffbe62070..000000000000
--- a/net/asterisk10/files/patch-Makefile
+++ /dev/null
@@ -1,301 +0,0 @@
-
-$FreeBSD$
-
---- Makefile.orig Wed Jan 14 08:48:38 2004
-+++ Makefile Fri Jan 30 02:25:09 2004
-@@ -43,10 +43,10 @@
- #K6OPT = -DK6OPT
-
- #Tell gcc to optimize the asterisk's code
--OPTIMIZE=-O6
-+#OPTIMIZE=-O6
-
- #Include debug symbols in the executables (-g) and profiling info (-pg)
--DEBUG=-g #-pg
-+#DEBUG=-g #-pg
-
- # New hangup routines for chan_zap.c
- # If this flag is uncommented then you need to have new libpri code in your system
-@@ -68,7 +68,7 @@
-
- # Where to install asterisk after compiling
- # Default -> leave empty
--INSTALL_PREFIX=
-+INSTALL_PREFIX=$(PREFIX)
-
- # Staging directory
- # Files are copied here temporarily during the install process
-@@ -88,28 +88,26 @@
- # Don't use together with -DBUSYDETECT_TONEONLY
- BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
-
--ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
--ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
-+ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
-+ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
- ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
--ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
--ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
--ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
-+ASTSPOOLDIR=/var/spool/asterisk
-+ASTLOGDIR=/var/log/asterisk
-+ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
- ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
--ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
--ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
--ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
-+ASTBINDIR=$(INSTALL_PREFIX)/bin
-+ASTSBINDIR=$(INSTALL_PREFIX)/sbin
-+ASTVARRUNDIR=/var/run
-
- MODULES_DIR=$(ASTLIBDIR)/modules
- AGI_DIR=$(ASTVARLIBDIR)/agi-bin
-
- INCLUDE=-Iinclude -I../include
--CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
-+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
- CFLAGS+=$(OPTIMIZE)
--CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
- CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
- ifeq (${OSARCH},FreeBSD)
--CFLAGS+=-pthread
--INCLUDE+=-I/usr/local/include
-+CFLAGS+=$(PTHREAD_CFLAGS)
- endif
- ifeq (${OSARCH},OpenBSD)
- CFLAGS+=-pthread
-@@ -151,7 +149,7 @@
- LIBS=-pthread
- else
- ifeq (${OSARCH},FreeBSD)
--LIBS=-pthread
-+LIBS=$(PTHREAD_LIBS)
- else
- endif
- endif
-@@ -179,7 +177,7 @@
- SOLINK=-shared -Xlinker -x
- endif
-
--CC=gcc
-+CC?=gcc
- INSTALL=install
-
- _all: all
-@@ -200,13 +198,13 @@
- cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
- $(MAKE) -C editline libedit.a
-
--db1-ast/libdb1.a: FORCE
-- @if [ -d db1-ast ]; then \
-- $(MAKE) -C db1-ast libdb1.a ; \
-- else \
-- echo "You need to do a cvs update -d not just cvs update"; \
-- exit 1; \
-- fi
-+#db1-ast/libdb1.a: FORCE
-+# @if [ -d db1-ast ]; then \
-+# $(MAKE) -C db1-ast libdb1.a ; \
-+# else \
-+# echo "You need to do a cvs update -d not just cvs update"; \
-+# exit 1; \
-+# fi
-
- ifneq ($(wildcard .depend),)
- include .depend
-@@ -244,8 +242,8 @@
- exit 1; \
- fi
-
--asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
-- $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a
-+asterisk: editline/libedit.a stdtime/libtime.a $(OBJS)
-+ $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBS) $(LIBEDIT) stdtime/libtime.a
-
- subdirs:
- for x in $(SUBDIRS); do $(MAKE) -C $$x || exit 1 ; done
-@@ -260,10 +258,10 @@
- $(MAKE) -C stdtime clean
-
- datafiles: all
-- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
-+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
- for x in sounds/digits/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
- else \
- echo "No description for $$x"; \
- exit 1; \
-@@ -271,18 +269,18 @@
- done
- for x in sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
- else \
- echo "No description for $$x"; \
- exit 1; \
- fi; \
- done
-- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
-- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/images
-+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
-+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/images
- for x in images/*.jpg; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
- done
-- mkdir -p $(DESTDIR)$(AGI_DIR)
-+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
-
- update:
- @if [ -d CVS ]; then \
-@@ -294,105 +292,74 @@
- fi
-
- bininstall: all
-- mkdir -p $(DESTDIR)$(MODULES_DIR)
-- mkdir -p $(DESTDIR)$(ASTSBINDIR)
-- mkdir -p $(DESTDIR)$(ASTETCDIR)
-- mkdir -p $(DESTDIR)$(ASTBINDIR)
-- mkdir -p $(DESTDIR)$(ASTSBINDIR)
-- mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
-- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
-- install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-+ $(MKDIR) $(DESTDIR)$(MODULES_DIR)
-+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTBINDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTVARRUNDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail
-+ $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
- if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
-- install -m 755 contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
- fi
- for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
-- install -d $(DESTDIR)$(ASTHEADERDIR)
-- install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR)
-+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/vm
-- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
-- if [ ! -h $(DESTDIR)$(ASTSPOOLDIR)/vm ] && [ -d $(DESTDIR)$(ASTSPOOLDIR)/vm ]; then \
-- mv $(DESTDIR)$(ASTSPOOLDIR)/vm $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- else \
-- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- rm -f $(DESTDIR)$(ASTSPOOLDIR)/vm; \
-- fi
-- ln -s $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
-- rm -f $(DESTDIR)$(MODULES_DIR)/chan_ixj.so
-- rm -f $(DESTDIR)$(MODULES_DIR)/chan_tor.so
-- rm -f $(DESTDIR)$(MODULES_DIR)/cdr_mysql.so
-- rm -f $(DESTDIR)$(MODULES_DIR)/cdr_unixodbc.so
-- rm -f $(DESTDIR)$(MODULES_DIR)/codec_mp3_d.so
-- rm -f $(DESTDIR)$(MODULES_DIR)/format_mp3.so
-- rm -f $(DESTDIR)$(MODULES_DIR)/app_voicemail2.so
-- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
-- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
-- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/vm . )
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
-- @echo " +---- Asterisk Installation Complete -------+"
-- @echo " + +"
-- @echo " + YOU MUST READ THE SECURITY DOCUMENT +"
-- @echo " + +"
-- @echo " + Asterisk has successfully been installed. +"
-- @echo " + If you would like to install the sample +"
-- @echo " + configuration files (overwriting any +"
-- @echo " + existing config files), run: +"
-- @echo " + +"
-- @echo " + $(MAKE) samples +"
-- @echo " + +"
-- @echo " +----------------- or ---------------------+"
-- @echo " + +"
-- @echo " + You can go ahead and install the asterisk +"
-- @echo " + program documentation now or later run: +"
-- @echo " + +"
-- @echo " + $(MAKE) progdocs +"
-- @echo " + +"
-- @echo " + **Note** This requires that you have +"
-- @echo " + doxygen installed on your local system +"
-- @echo " +-------------------------------------------+"
-+ ln -sf $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
-+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds
-+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-csv
-+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/keys
-+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds; ln -sf $(ASTSPOOLDIR)/vm . )
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds; ln -sf $(ASTSPOOLDIR)/voicemail . )
-
--install: all datafiles bininstall
-+install: all datafiles bininstall samples
-
- upgrade: all bininstall
-
- adsi: all
-- mkdir -p $(DESTDIR)$(ASTETCDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
- for x in configs/*.adsi; do \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x`-dist; \
- if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
- fi ; \
- done
-
- samples: all datafiles adsi
-- mkdir -p $(DESTDIR)$(ASTETCDIR)
-- for x in configs/*.sample; do \
-- if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-- mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
-+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
-+ for x in configs/*.sample channels/h323/*.sample; do \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`-dist;\
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
- fi ; \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
- done
-- echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-+ echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \
-+ $(BSD_INSTALL_DATA) $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist $(DESTDIR)$(ASTETCDIR)/asterisk.conf; \
-+ fi
- for x in sounds/demo-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
- else \
- echo "No description for $$x"; \
- exit 1; \
- fi; \
- done
- for x in sounds/*.mp3; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
- done
-- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
-+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
- :> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
- for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
- cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
diff --git a/net/asterisk10/files/patch-agi::Makefile b/net/asterisk10/files/patch-agi::Makefile
deleted file mode 100644
index 567c30f5624e..000000000000
--- a/net/asterisk10/files/patch-agi::Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-
-$FreeBSD$
-
---- agi/Makefile.orig Sat Oct 25 20:27:53 2003
-+++ agi/Makefile Fri Jan 30 02:31:07 2004
-@@ -11,21 +11,24 @@
- # the GNU General Public License
- #
-
--AGIS=agi-test.agi eagi-test eagi-sphinx-test
-+AGIS_BIN=eagi-test eagi-sphinx-test
-+AGIS_SCR=agi-test.agi
-+AGIS=$(AGIS_SCR) $(AGIS_BIN)
-
- CFLAGS+=
-
- all: depend $(AGIS)
-
- install: all
-- mkdir -p $(DESTDIR)$(AGI_DIR)
-- for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done
-+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
-+ for x in $(AGIS_BIN); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(AGI_DIR) ; done
-+ for x in $(AGIS_SCR); do $(BSD_INSTALL_SCRIPT) $$x $(DESTDIR)$(AGI_DIR) ; done
-
- eagi-test: eagi-test.o
-- $(CC) -o eagi-test eagi-test.o
-+ $(CC) $(CFLAGS) -o eagi-test eagi-test.o
-
- eagi-sphinx-test: eagi-sphinx-test.o
-- $(CC) -o eagi-sphinx-test eagi-sphinx-test.o
-+ $(CC) $(CFLAGS) -o eagi-sphinx-test eagi-sphinx-test.o
-
- clean:
- rm -f *.so *.o look .depend
diff --git a/net/asterisk10/files/patch-apps::Makefile b/net/asterisk10/files/patch-apps::Makefile
deleted file mode 100644
index 901ba694c33a..000000000000
--- a/net/asterisk10/files/patch-apps::Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-
-$FreeBSD$
-
---- apps/Makefile.orig Mon Jan 12 03:56:38 2004
-+++ apps/Makefile Fri Jan 30 01:47:34 2004
-@@ -59,17 +59,17 @@
- $(CC) $(SOLINK) -o $@ $< -ltonezone
-
- install: all
-- for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
-+ for x in $(APPS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- app_todd.o: app_todd.c
-- gcc -pipe -O6 -g -Iinclude -I../include -D_REENTRANT -march=i586 -DDO_CRASH -c -o app_todd.o app_todd.c
-+ $(CC) $(CFLAGS) -Iinclude -I../include -D_REENTRANT -DDO_CRASH -c -o app_todd.o app_todd.c
-
- app_todd.so: app_todd.o
-- $(CC) $(SOLINK) -o $@ $< -L/usr/local/ssl/lib -lssl -lcrypto
-+ $(CC) $(SOLINK) -o $@ $< -lssl -lcrypto
-
- app_voicemail.so : app_voicemail.o
- ifeq ($(USE_MYSQL_VM_INTERFACE),1)
-- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L/usr/lib/mysql -lmysqlclient -lz
-+ $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L$(LOCALBASE)/lib/mysql -lmysqlclient -lz
- else
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -lpq
-@@ -88,7 +88,7 @@
- $(CC) $(SOLINK) -o $@ $< -lodbc
-
- look: look.c
-- gcc -pipe -O6 -g look.c -o look -lncurses
-+ $(CC) $(CFLAGS) look.c -o look -lncurses
-
- ifneq ($(wildcard .depend),)
- include .depend
diff --git a/net/asterisk10/files/patch-apps::app_intercom.c b/net/asterisk10/files/patch-apps::app_intercom.c
deleted file mode 100644
index e4ac57f8e31b..000000000000
--- a/net/asterisk10/files/patch-apps::app_intercom.c
+++ /dev/null
@@ -1,14 +0,0 @@
-
-$FreeBSD$
-
---- apps/app_intercom.c.orig Wed Oct 22 06:10:24 2003
-+++ apps/app_intercom.c Fri Jan 30 01:52:03 2004
-@@ -29,7 +29,7 @@
- #ifdef __linux__
- #include <linux/soundcard.h>
- #elif defined(__FreeBSD__)
--#include <machine/soundcard.h>
-+#include <sys/soundcard.h>
- #else
- #include <soundcard.h>
- #endif
diff --git a/net/asterisk10/files/patch-astman::Makefile b/net/asterisk10/files/patch-astman::Makefile
deleted file mode 100644
index cf31005257cf..000000000000
--- a/net/asterisk10/files/patch-astman::Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-
-$FreeBSD$
-
---- astman/Makefile.orig Sat Oct 25 20:27:53 2003
-+++ astman/Makefile Fri Jan 30 01:47:34 2004
-@@ -8,7 +8,7 @@
- install:
- if [ "$(TARGET)" != "none" ]; then \
- for x in $(TARGET); do \
-- install -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
-+ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
- done ; \
- fi
-
diff --git a/net/asterisk10/files/patch-cdr::Makefile b/net/asterisk10/files/patch-cdr::Makefile
deleted file mode 100644
index 2ede608f9019..000000000000
--- a/net/asterisk10/files/patch-cdr::Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-
-$FreeBSD$
-
---- cdr/Makefile.orig Sun Jan 11 21:17:02 2004
-+++ cdr/Makefile Fri Jan 30 01:47:34 2004
-@@ -43,7 +43,7 @@
- all: depend $(MODS)
-
- install: all
-- for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
-+ for x in $(MODS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- clean:
- rm -f *.so *.o .depend
diff --git a/net/asterisk10/files/patch-channels::Makefile b/net/asterisk10/files/patch-channels::Makefile
deleted file mode 100644
index d05ee2c13676..000000000000
--- a/net/asterisk10/files/patch-channels::Makefile
+++ /dev/null
@@ -1,52 +0,0 @@
-
-$FreeBSD$
-
---- channels/Makefile.orig Fri Jan 23 22:57:48 2004
-+++ channels/Makefile Thu Feb 19 01:48:41 2004
-@@ -26,12 +26,10 @@
- #
- #CHANNEL_LIBS+=chan_vofr
-
--ifneq (${OSARCH},Darwin)
- CHANNEL_LIBS+=chan_oss.so
--endif
-
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
-+CHANNEL_LIBS+=chan_h323.so
-
- CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
- CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
-@@ -99,10 +97,8 @@
-
- chan_oss.o: chan_oss.c busy.h ringtone.h
-
--ifeq (${OSARCH},OpenBSD)
- chan_oss.so: chan_oss.o
-- $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
--endif
-+ $(CC) $(SOLINK) -o $@ chan_oss.o
-
- chan_iax2.so: chan_iax2.o iax2-parser.o
- ifeq ($(USE_MYSQL_FRIENDS),1)
-@@ -146,15 +142,17 @@
- chan_vpb.so: chan_vpb.o
- $(CXX) $(SOLINK) -o $@ $< -lvpb -lpthread -lm -ldl
-
--chan_h323.so: chan_h323.o h323/libchanh323.a
-- $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a -L$(PWLIBDIR)/lib -lpt_linux_x86_r -L$(OPENH323DIR)/lib -lh323_linux_x86_r -L/usr/lib -lpthread -ldl -lcrypto -lssl -lexpat
-+chan_h323.so: chan_h323.o h323/ast_h323.o
-+ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r_s -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -lcrypto -lssl -L$(LOCALBASE)/lib -lexpat -llber -lldap -lldap_r
-
-+h323/ast_h323.o:
-+ $(MAKE) -C h323 ast_h323.o
-
- #chan_modem.so : chan_modem.o
- # $(CC) -rdynamic -shared -Xlinker -x -o $@ $<
-
- install: all
-- for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
-+ for x in $(CHANNEL_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- depend: .depend
-
diff --git a/net/asterisk10/files/patch-channels::chan_h323.c b/net/asterisk10/files/patch-channels::chan_h323.c
deleted file mode 100644
index e413bd8ecec8..000000000000
--- a/net/asterisk10/files/patch-channels::chan_h323.c
+++ /dev/null
@@ -1,13 +0,0 @@
-
-$FreeBSD$
-
---- channels/chan_h323.c.orig Tue Jan 13 11:24:26 2004
-+++ channels/chan_h323.c Fri Jan 30 01:47:34 2004
-@@ -54,6 +54,7 @@
- #include <fcntl.h>
- #include <netdb.h>
- #include <sys/signal.h>
-+#include <netinet/in_systm.h>
- #include <netinet/ip.h>
-
-
diff --git a/net/asterisk10/files/patch-channels::chan_oss.c b/net/asterisk10/files/patch-channels::chan_oss.c
deleted file mode 100644
index 1006b377874e..000000000000
--- a/net/asterisk10/files/patch-channels::chan_oss.c
+++ /dev/null
@@ -1,14 +0,0 @@
-
-$FreeBSD$
-
---- channels/chan_oss.c.orig Wed Oct 22 06:10:34 2003
-+++ channels/chan_oss.c Fri Jan 30 01:50:35 2004
-@@ -36,7 +36,7 @@
- #ifdef __linux
- #include <linux/soundcard.h>
- #elif defined(__FreeBSD__)
--#include <machine/soundcard.h>
-+#include <sys/soundcard.h>
- #else
- #include <soundcard.h>
- #endif
diff --git a/net/asterisk10/files/patch-channels::h323::Makefile b/net/asterisk10/files/patch-channels::h323::Makefile
deleted file mode 100644
index a9159b4441c1..000000000000
--- a/net/asterisk10/files/patch-channels::h323::Makefile
+++ /dev/null
@@ -1,64 +0,0 @@
-
-$FreeBSD$
-
---- channels/h323/Makefile.orig Sun Jan 11 04:22:32 2004
-+++ channels/h323/Makefile Fri Jan 30 01:47:34 2004
-@@ -19,7 +19,7 @@
- #
- # This needs to be updated to deal with more than just little endian machines
- #
--CFLAGS += -march=$(shell uname -m) -DPBYTE_ORDER=PLITTLE_ENDIAN
-+CFLAGS += -DPBYTE_ORDER=PLITTLE_ENDIAN
-
-
- #############################################
-@@ -27,38 +27,39 @@
- # Only change below if you know WTF your doing
- #
- CFLAGS += -DNDEBUG -DDO_CRASH -DDEBUG_THREADS
--CFLAGS += -pipe -Wall -fPIC -Wmissing-prototypes -Wmissing-declarations
--CFLAGS += -DP_LINUX -D_REENTRANT -D_GNU_SOURCE
-+CFLAGS += -Wall -fPIC
-+CFLAGS += -DP_FREEBSD=$(OSVERSION) -D_REENTRANT -D_GNU_SOURCE
- CFLAGS += -DP_HAS_SEMAPHORES -DP_SSL -DP_PTHREADS
- CFLAGS += -DPHAS_TEMPLATES -DPTRACING -DP_USE_PRAGMA
- CFLAGS += -I../../include
- CFLAGS += -I$(PWLIBDIR)/include/ptlib/unix -I$(PWLIBDIR)/include
--CFLAGS += -I$(OPENH323DIR)/include -Wno-missing-prototypes -Wno-missing-declarations
-+CFLAGS += -I$(OPENH323DIR)/include
-
-
- all: libchanh323.a
-
- samples:
-- if [ -f $(ASTETCDIR)/h323.conf ]; then \
-- mv -f $(ASTETCDIR)/h323.conf $(ASTETCDIR)/h323.conf.old ; \
-+ $(BSD_INSTALL_DATA) h323.conf.sample $(ASTETCDIR)/h323.conf-dist
-+ if ! [ -f $(ASTETCDIR)/h323.conf ]; then \
-+ $(BSD_INSTALL_DATA) h323.conf.sample $(ASTETCDIR)/h323.conf; \
- fi ;
-- install h323.conf.sample $(ASTETCDIR)/h323.conf
-
-
- ast_h323.o: ast_h323.cpp
-- g++ -g -c -o $@ $(CFLAGS) $<
-+ $(CXX) -c -o $@ $(CFLAGS) $<
-
- libchanh323.a: ast_h323.o
- ar cr libchanh323.a ast_h323.o
-
- chan_h323.so:
-- g++ -g -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r -L$(OPENH323DIR)/lib -lh323_linux_x86_r -L/usr/lib -lpthread -ldl -lcrypto -lssl -lexpat
-+ $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r $(PTHREAD_LIBS) -lcrypto -lssl -lexpat
-
- chan_h323_d.so: chan_h323.o ast_h323.o
-- g++ -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_d -L$(OPENH323DIR)/lib -lh323_linux_x86_d -L/usr/lib -lpthread -ldl -lcrypto -lssl -lexpat
-+ $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_d $(PTHREAD_LIBS) -lcrypto -lssl -lexpat
-
- chan_h323_s.so: chan_h323.o ast_h323.o
-- g++ -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r_s -L/usr/lib -lpthread -ldl -lcrypto -lssl -lexpat
-+ $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r_s $(PTHREAD_LIBS) -lcrypto -lssl -lexpat
-+
- clean:
- rm -f *.o *.so core.* libchanh323.a
-
diff --git a/net/asterisk10/files/patch-codecs::Makefile b/net/asterisk10/files/patch-codecs::Makefile
deleted file mode 100644
index b802dc1233e8..000000000000
--- a/net/asterisk10/files/patch-codecs::Makefile
+++ /dev/null
@@ -1,44 +0,0 @@
-
-$FreeBSD$
-
---- codecs/Makefile.orig Tue Nov 4 04:40:09 2003
-+++ codecs/Makefile Fri Jan 30 01:47:34 2004
-@@ -17,23 +17,22 @@
- # g723.1b)
- #
- #MODG723=codec_g723_1.so codec_g723_1b.so
--MODG723=$(shell [ -f g723.1/coder.c ] && echo "codec_g723_1.so")
--MODG723+=$(shell [ -f g723.1b/coder2.c ] && echo "codec_g723_1b.so")
--MODSPEEX=$(shell [ -f /usr/include/speex.h ] || [ -f /usr/local/include/speex.h ] && echo "codec_speex.so")
-+MODG723=codec_g723_1_dummy.so
-+MODG729=codec_g729_dummy.so
-+MODSPEEX=codec_speex.so
- MODILBC=$(shell [ -f ilbc/iLBC_decode.h ] && echo "codec_ilbc.so")
--CFLAGS+=-fPIC
--CFLAGS+=$(shell [ -f /usr/local/include/speex.h ] && echo "-I/usr/local/include")
-+CFLAGS+=-fPIC -I$(LOCALBASE)/include
-
- LIBG723=g723.1/libg723.a
- LIBG723B=g723.1b/libg723b.a
- LIBGSM=gsm/lib/libgsm.a
- LIBGSMT=gsm/lib/libgsm.a
- LIBLPC10=lpc10/liblpc10.a
--LIBSPEEX=$(shell [ -f /usr/local/lib/libspeex.a ] && echo "-L/usr/local/lib")
-+LIBSPEEX=-L$(LOCALBASE)/lib
- LIBSPEEX+=-lspeex -lm
- LIBILBC=ilbc/libilbc.a
-
--CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
-+CODECS+=$(MODG723) $(MODG729) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
- codec_adpcm.so codec_ulaw.so codec_alaw.so codec_a_mu.so
-
- all: depend $(CODECS)
-@@ -88,7 +87,7 @@
- include .depend
-
- install: all
-- for x in $(CODECS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
-+ for x in $(CODECS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- depend: .depend
-
diff --git a/net/asterisk10/files/patch-codecs::codec_g723_1_dummy.c b/net/asterisk10/files/patch-codecs::codec_g723_1_dummy.c
deleted file mode 100644
index 661ff2d88602..000000000000
--- a/net/asterisk10/files/patch-codecs::codec_g723_1_dummy.c
+++ /dev/null
@@ -1,314 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/codec_g723_1_dummy.c Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,308 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.723.1 (dummy!)
-+ *
-+ * The G.723.1 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#define TYPE_HIGH 0x0
-+#define TYPE_LOW 0x1
-+#define TYPE_SILENCE 0x2
-+#define TYPE_DONTSEND 0x3
-+#define TYPE_MASK 0x3
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g723_ex.h"
-+#include "g723_slin_ex.h"
-+
-+static ast_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.723.1/PCM16 Codec Translator";
-+
-+struct g723_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g723_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g723tolin_new()
-+{
-+ struct g723_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog723_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g723_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g723_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g723_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g723tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G723_1;
-+ f.datalen = sizeof(g723_slin_ex);
-+ /* All frames are 30 ms long */
-+ f.samples = 30;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g723_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog723_new()
-+{
-+ struct g723_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g723tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g723_len(unsigned char buf)
-+{
-+ switch(buf & TYPE_MASK) {
-+ case TYPE_DONTSEND:
-+ return 2;
-+ break;
-+ case TYPE_SILENCE:
-+ return 4;
-+ break;
-+ case TYPE_HIGH:
-+ return 24;
-+ break;
-+ case TYPE_LOW:
-+ return 20;
-+ break;
-+ default:
-+ ast_log(LOG_WARNING, "Badly encoded frame (%d)\n", buf & TYPE_MASK);
-+ }
-+ return -1;
-+}
-+
-+static int g723tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ int len = 0;
-+ int res;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ res = g723_len(((unsigned char *)f->data + len)[0]);
-+ if (res < 0) {
-+ ast_log(LOG_WARNING, "Invalid data\n");
-+ return -1;
-+ }
-+ if (res + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 480 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 480);
-+ tmp->tail+=480;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += res;
-+ }
-+ return 0;
-+}
-+
-+static int lintog723_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog723_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 480)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G723_1;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 480) {
-+ /* Encode a frame of data */
-+ if (cnt + 24 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 24);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 30;
-+ cnt += 24;
-+ tmp->tail -= 480;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 480, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g723_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g723tolin =
-+ { "g723tolin_dummy",
-+ AST_FORMAT_G723_1, AST_FORMAT_SLINEAR,
-+ g723tolin_new,
-+ g723tolin_framein,
-+ g723tolin_frameout,
-+ g723_destroy,
-+ g723tolin_sample
-+ };
-+
-+static struct ast_translator lintog723 =
-+ { "lintog723_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G723_1,
-+ lintog723_new,
-+ lintog723_framein,
-+ lintog723_frameout,
-+ g723_destroy,
-+ lintog723_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog723);
-+ if (!res)
-+ res = ast_unregister_translator(&g723tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g723tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog723);
-+ else
-+ ast_unregister_translator(&g723tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk10/files/patch-codecs::codec_g729_dummy.c b/net/asterisk10/files/patch-codecs::codec_g729_dummy.c
deleted file mode 100644
index c3e27d98e27e..000000000000
--- a/net/asterisk10/files/patch-codecs::codec_g729_dummy.c
+++ /dev/null
@@ -1,281 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/codec_g729_dummy.c Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,275 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.729 (dummy!)
-+ *
-+ * The G.729 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g729_ex.h"
-+#include "g729_slin_ex.h"
-+
-+static ast_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.729/PCM16 Codec Translator";
-+
-+struct g729_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g729_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g729tolin_new()
-+{
-+ struct g729_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog729_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g729_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g729_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g729_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g729tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G729A;
-+ f.datalen = sizeof(g729_slin_ex);
-+ /* All frames are 10 ms long */
-+ f.samples = 10;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g729_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog729_new()
-+{
-+ struct g729_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g729tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g729tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ int len = 0;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ if (10 + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 160 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 160);
-+ tmp->tail+=160;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += 10;
-+ }
-+ return 0;
-+}
-+
-+static int lintog729_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog729_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 160)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G729A;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 160) {
-+ /* Encode a frame of data */
-+ if (cnt + 10 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 10);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 10;
-+ cnt += 10;
-+ tmp->tail -= 160;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 160, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g729_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g729tolin =
-+ { "g729tolin_dummy",
-+ AST_FORMAT_G729A, AST_FORMAT_SLINEAR,
-+ g729tolin_new,
-+ g729tolin_framein,
-+ g729tolin_frameout,
-+ g729_destroy,
-+ g729tolin_sample
-+ };
-+
-+static struct ast_translator lintog729 =
-+ { "lintog729_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G729A,
-+ lintog729_new,
-+ lintog729_framein,
-+ lintog729_frameout,
-+ g729_destroy,
-+ lintog729_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog729);
-+ if (!res)
-+ res = ast_unregister_translator(&g729tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g729tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog729);
-+ else
-+ ast_unregister_translator(&g729tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk10/files/patch-codecs::g729_slin_ex.h b/net/asterisk10/files/patch-codecs::g729_slin_ex.h
deleted file mode 100644
index 44e60f2de848..000000000000
--- a/net/asterisk10/files/patch-codecs::g729_slin_ex.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/g729_slin_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,14 @@
-+/*
-+ * g729_slin_ex.h --
-+ *
-+ * 8-bit G.729 data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Copyright (C) 2004, Maxim Sobolev <sobomax@FreeBSD.org>
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static unsigned char g729_slin_ex[] = {
-+120,82,175,64,0,250,219,0,7,214
-+};
diff --git a/net/asterisk10/files/patch-codecs::gsm::Makefile b/net/asterisk10/files/patch-codecs::gsm::Makefile
deleted file mode 100644
index d60ed11f3298..000000000000
--- a/net/asterisk10/files/patch-codecs::gsm::Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-
-$FreeBSD$
-
---- codecs/gsm/Makefile.orig Thu Jan 8 18:52:11 2004
-+++ codecs/gsm/Makefile Fri Jan 30 01:47:34 2004
-@@ -60,8 +60,8 @@
- # CC = /usr/lang/acc
- # CCFLAGS = -c -O
-
--CC = gcc $(OPTIMIZE) -fomit-frame-pointer
--CCFLAGS += -c -DNeedFunctionPrototypes=1 -funroll-loops -fPIC
-+CC ?= gcc
-+CCFLAGS += -c -DNeedFunctionPrototypes=1 -funroll-loops -fPIC $(OPTIMIZE) -fomit-frame-pointer
-
- LD = $(CC)
-
-@@ -146,7 +146,7 @@
- DEBUG = -DNDEBUG
- ######### Remove -DNDEBUG to enable assertions.
-
--CFLAGS = $(PG) $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) \
-+CFLAGS += $(PG) $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) \
- $(LTP_CUT) $(WAV49) $(K6OPT) $(CCINC) -I$(INC)
- ######### It's $(CC) $(CFLAGS)
-
diff --git a/net/asterisk10/files/patch-codecs::ilbc::Makefile b/net/asterisk10/files/patch-codecs::ilbc::Makefile
deleted file mode 100644
index 7770e07550a4..000000000000
--- a/net/asterisk10/files/patch-codecs::ilbc::Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-
-$FreeBSD$
-
---- codecs/ilbc/Makefile.orig Sun Apr 27 21:13:11 2003
-+++ codecs/ilbc/Makefile Fri Jan 30 01:47:34 2004
-@@ -1,4 +1,4 @@
--CFLAGS+= -fPIC -O3
-+CFLAGS+= -fPIC
- LIB=libilbc.a
-
- OBJS= anaFilter.o iCBSearch.o packing.o \
diff --git a/net/asterisk10/files/patch-codecs::lpc10::Makefile b/net/asterisk10/files/patch-codecs::lpc10::Makefile
deleted file mode 100644
index 68c98c064f70..000000000000
--- a/net/asterisk10/files/patch-codecs::lpc10::Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-
-$FreeBSD$
-
---- codecs/lpc10/Makefile.orig Thu Jan 8 18:52:11 2004
-+++ codecs/lpc10/Makefile Fri Jan 30 02:06:54 2004
-@@ -3,7 +3,7 @@
- #
-
- # default C compiler
--CC= gcc
-+CC?= gcc
-
- #
- # These definitions for CFLAGS and LIB_TARGET_DIR are used when one
-@@ -22,14 +22,14 @@
- #
-
- WARNINGS = -Wall -Wno-comment -Wno-error
--CFLAGS = $(OPTIMIZE) -I$(LIB_TARGET_DIR) $(WARNINGS) -fPIC
-+CFLAGS += $(OPTIMIZE) -I$(LIB_TARGET_DIR) $(WARNINGS) -fPIC
- #CFLAGS+= $(shell if uname -m | grep -q 86; then echo "-mpentium" ; fi)
-
- #fix for PPC processors
- ifneq ($(OSARCH),Darwin)
- ifneq ($(PROC),ppc)
- ifneq ($(PROC),x86_64)
-- CFLAGS+= -march=$(PROC)
-+ CFLAGS+=
- endif
- endif
- endif
diff --git a/net/asterisk10/files/patch-codecs::slin_g729_ex.h b/net/asterisk10/files/patch-codecs::slin_g729_ex.h
deleted file mode 100644
index e1236d2498dc..000000000000
--- a/net/asterisk10/files/patch-codecs::slin_g729_ex.h
+++ /dev/null
@@ -1,31 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/slin_g729_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,25 @@
-+/*
-+ * slin_g729_ex.h --
-+ *
-+ * Signed 16-bit audio data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Source: g723.example
-+ *
-+ * Copyright (C) 2001, Linux Support Services, Inc.
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static signed short slin_g729_ex[] = {
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-+};
diff --git a/net/asterisk10/files/patch-db.c b/net/asterisk10/files/patch-db.c
deleted file mode 100644
index 59e5cef87770..000000000000
--- a/net/asterisk10/files/patch-db.c
+++ /dev/null
@@ -1,14 +0,0 @@
-
-$FreeBSD$
-
---- db.c.orig Tue Dec 2 17:12:56 2003
-+++ db.c Fri Jan 30 01:47:34 2004
-@@ -32,7 +32,7 @@
- #include <asterisk/options.h>
- #include <asterisk/astdb.h>
- #include <asterisk/cli.h>
--#include "db1-ast/include/db.h"
-+#include <db.h>
- #include "asterisk.h"
- #include "astconf.h"
-
diff --git a/net/asterisk10/files/patch-editline::configure b/net/asterisk10/files/patch-editline::configure
deleted file mode 100644
index f6b9c5b76eee..000000000000
--- a/net/asterisk10/files/patch-editline::configure
+++ /dev/null
@@ -1,14 +0,0 @@
-
-$FreeBSD$
-
---- editline/configure.orig Sun Apr 27 21:13:11 2003
-+++ editline/configure Fri Jan 30 01:47:34 2004
-@@ -1906,7 +1906,7 @@
- CPPFLAGS="$CPPFLAGS -DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG"
- CPPFLAGS="$CPPFLAGS -DDEBUG_REFRESH -DDEBUG_PASTE"
- else
-- CFLAGS="$CFLAGS -O"
-+ CFLAGS="$CFLAGS"
- fi
-
-
diff --git a/net/asterisk10/files/patch-formats::Makefile b/net/asterisk10/files/patch-formats::Makefile
deleted file mode 100644
index dacfd7b08303..000000000000
--- a/net/asterisk10/files/patch-formats::Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-
-$FreeBSD$
-
---- formats/Makefile.orig Tue Nov 4 04:40:09 2003
-+++ formats/Makefile Fri Jan 30 01:47:34 2004
-@@ -18,7 +18,7 @@
- #
- # G723 simple frame is depricated
- #
--#FORMAT_LIBS+=format_g723.so
-+FORMAT_LIBS+=format_g723_1.so
-
- GSMLIB=../codecs/gsm/lib/libgsm.a
-
-@@ -40,7 +40,7 @@
- $(CC) $(SOLINK) -o $@ $< -lm
-
- install: all
-- for x in $(FORMAT_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
-+ for x in $(FORMAT_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- depend: .depend
-
diff --git a/net/asterisk10/files/patch-formats::format_g723_1.c b/net/asterisk10/files/patch-formats::format_g723_1.c
deleted file mode 100644
index 8d0755e14205..000000000000
--- a/net/asterisk10/files/patch-formats::format_g723_1.c
+++ /dev/null
@@ -1,351 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ formats/format_g723_1.c Fri Jan 30 01:58:19 2004
-@@ -0,0 +1,345 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Save and read raw, headerless G723.1 Annex A data.
-+ *
-+ * Copyright (C) 1999, Mark Spencer <markster@linux-support.net>
-+ * Copyright (C) 2003, Maxim Sobolev <sobomax@FreeBSD.org>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#include <asterisk/lock.h>
-+#include <asterisk/channel.h>
-+#include <asterisk/file.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/sched.h>
-+#include <asterisk/module.h>
-+#include <netinet/in.h>
-+#include <arpa/inet.h>
-+#include <stdlib.h>
-+#include <sys/time.h>
-+#include <stdio.h>
-+#include <unistd.h>
-+#include <errno.h>
-+#include <string.h>
-+#include <pthread.h>
-+#ifdef __linux__
-+#include <endian.h>
-+#else
-+#include <machine/endian.h>
-+#endif
-+
-+/* Based on format_g729.c */
-+
-+#define TYPE_HIGH 0x0
-+#define TYPE_LOW 0x1
-+#define TYPE_SILENCE 0x2
-+#define TYPE_DONTSEND 0x3
-+#define TYPE_MASK 0x3
-+
-+struct ast_filestream {
-+ void *reserved[AST_RESERVED_POINTERS];
-+ /* This is what a filestream means to us */
-+ int fd; /* Descriptor */
-+ struct ast_frame fr; /* Frame information */
-+ char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
-+ char empty; /* Empty character */
-+ unsigned char g723[24]; /* One Real G723.1 Frame */
-+};
-+
-+static long g723_tell(struct ast_filestream *);
-+
-+static ast_mutex_t g723_lock = AST_MUTEX_INITIALIZER;
-+static int glistcnt = 0;
-+
-+static char *name = "g723";
-+static char *desc = "Raw G723.1 Annex A data";
-+static char *exts = "g723";
-+
-+static int g723_len(unsigned char buf)
-+{
-+ switch(buf & TYPE_MASK) {
-+ case TYPE_DONTSEND:
-+ return 2;
-+ break;
-+ case TYPE_SILENCE:
-+ return 4;
-+ break;
-+ case TYPE_HIGH:
-+ return 24;
-+ break;
-+ case TYPE_LOW:
-+ return 20;
-+ break;
-+ default:
-+ ast_log(LOG_WARNING, "Badly encoded G723.1 frame (%d)\n", buf & TYPE_MASK);
-+ }
-+ return -1;
-+}
-+
-+static struct ast_filestream *g723_open(int fd)
-+{
-+ /* We don't have any header to read or anything really, but
-+ if we did, it would go here. We also might want to check
-+ and be sure it's a valid file. */
-+ struct ast_filestream *tmp;
-+ if ((tmp = malloc(sizeof(struct ast_filestream)))) {
-+ memset(tmp, 0, sizeof(struct ast_filestream));
-+ if (ast_mutex_lock(&g723_lock)) {
-+ ast_log(LOG_WARNING, "Unable to lock g723 list\n");
-+ free(tmp);
-+ return NULL;
-+ }
-+ tmp->fd = fd;
-+ tmp->fr.data = tmp->g723;
-+ tmp->fr.frametype = AST_FRAME_VOICE;
-+ tmp->fr.subclass = AST_FORMAT_G723_1;
-+ /* datalen will vary for each frame */
-+ tmp->fr.src = name;
-+ tmp->fr.mallocd = 0;
-+ glistcnt++;
-+ ast_mutex_unlock(&g723_lock);
-+ ast_update_use_count();
-+ }
-+ return tmp;
-+}
-+
-+static struct ast_filestream *g723_rewrite(int fd, char *comment)
-+{
-+ /* We don't have any header to read or anything really, but
-+ if we did, it would go here. We also might want to check
-+ and be sure it's a valid file. */
-+ struct ast_filestream *tmp;
-+ if ((tmp = malloc(sizeof(struct ast_filestream)))) {
-+ memset(tmp, 0, sizeof(struct ast_filestream));
-+ if (ast_mutex_lock(&g723_lock)) {
-+ ast_log(LOG_WARNING, "Unable to lock g723 list\n");
-+ free(tmp);
-+ return NULL;
-+ }
-+ tmp->fd = fd;
-+ glistcnt++;
-+ ast_mutex_unlock(&g723_lock);
-+ ast_update_use_count();
-+ } else
-+ ast_log(LOG_WARNING, "Out of memory\n");
-+ return tmp;
-+}
-+
-+static void g723_close(struct ast_filestream *s)
-+{
-+ if (ast_mutex_lock(&g723_lock)) {
-+ ast_log(LOG_WARNING, "Unable to lock g723 list\n");
-+ return;
-+ }
-+ glistcnt--;
-+ ast_mutex_unlock(&g723_lock);
-+ ast_update_use_count();
-+ close(s->fd);
-+ free(s);
-+ s = NULL;
-+}
-+
-+static struct ast_frame *g723_read(struct ast_filestream *s, int *whennext)
-+{
-+ int res;
-+ /* Send a frame from the file to the appropriate channel */
-+ s->fr.frametype = AST_FRAME_VOICE;
-+ s->fr.subclass = AST_FORMAT_G723_1;
-+ s->fr.offset = AST_FRIENDLY_OFFSET;
-+ s->fr.samples = 240;
-+ s->fr.mallocd = 0;
-+ s->fr.data = s->g723;
-+ if ((res = read(s->fd, s->g723, 1)) != 1) {
-+ if (res)
-+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
-+ return NULL;
-+ }
-+ s->fr.datalen = g723_len(s->g723[0]);
-+ if (s->fr.datalen < 0) {
-+ ast_log(LOG_WARNING, "Invalid G723.1 frame!\n");
-+ return NULL;
-+ }
-+ if (s->fr.datalen > 1 && (res = read(s->fd, s->g723 + 1, s->fr.datalen - 1)) != s->fr.datalen - 1) {
-+ if (res)
-+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
-+ return NULL;
-+ }
-+ *whennext = s->fr.samples;
-+ return &s->fr;
-+}
-+
-+static int g723_write(struct ast_filestream *fs, struct ast_frame *f)
-+{
-+ int res;
-+ unsigned char *cp;
-+ if (f->frametype != AST_FRAME_VOICE) {
-+ ast_log(LOG_WARNING, "Asked to write non-voice frame!\n");
-+ return -1;
-+ }
-+ if (f->subclass != AST_FORMAT_G723_1) {
-+ ast_log(LOG_WARNING, "Asked to write non-G723.1 frame (%d)!\n", f->subclass);
-+ return -1;
-+ }
-+ for (cp = f->data; cp < (unsigned char *)f->data + f->datalen; cp += res) {
-+ res = g723_len(cp[0]);
-+ if (res < 0) {
-+ ast_log(LOG_WARNING, "Asked to write invalid G723.1 frame!\n");
-+ return -1;
-+ }
-+ }
-+ if (cp != (unsigned char *)f->data + f->datalen) {
-+ ast_log(LOG_WARNING, "Invalid G723.1 data length, %d\n", f->datalen);
-+ return -1;
-+ }
-+ if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) {
-+ ast_log(LOG_WARNING, "Bad write %d: %s\n", res, strerror(errno));
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static char *g723_getcomment(struct ast_filestream *s)
-+{
-+ return NULL;
-+}
-+
-+static int g723_seek(struct ast_filestream *fs, long sample_offset, int whence)
-+{
-+ long cur, offset, max;
-+ off_t coffset, moffset, soffset;
-+ int res;
-+ unsigned char c;
-+
-+ offset = 0; /* Shut up gcc warning */
-+ if (whence == SEEK_SET) {
-+ offset = sample_offset;
-+ } else if (whence == SEEK_CUR || whence == SEEK_FORCECUR) {
-+ if ((cur = g723_tell(fs)) == -1) {
-+ ast_log(LOG_WARNING, "Can't get current position!\n");
-+ return -1;
-+ }
-+ offset = cur + sample_offset;
-+ }
-+ if ((moffset = lseek(fs->fd, 0, SEEK_END)) == -1) {
-+ ast_log(LOG_WARNING, "Can't seek stream to an end!\n");
-+ return -1;
-+ }
-+ if (whence == SEEK_END) {
-+ if ((max = g723_tell(fs)) == -1) {
-+ ast_log(LOG_WARNING, "Can't get maximum position!\n");
-+ return -1;
-+ }
-+ offset = max - sample_offset;
-+ }
-+ if (offset < 0)
-+ offset = 0;
-+ soffset = -1;
-+ for (coffset = 0; coffset < moffset && offset > 0; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
-+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", coffset);
-+ return -1;
-+ }
-+ if (read(fs->fd, &c, 1) != 1) {
-+ ast_log(LOG_WARNING, "Can't read from offset %lli!\n", coffset);
-+ return -1;
-+ }
-+ soffset = coffset;
-+ if ((res = g723_len(c)) < 0) {
-+ ast_log(LOG_WARNING, "Invalid G723.1 frame at offset %lli!\n", coffset);
-+ return -1;
-+ }
-+ if (res > 1)
-+ offset -= 240;
-+ }
-+ if (soffset != -1 && lseek(fs->fd, soffset, SEEK_SET) != soffset) {
-+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", soffset);
-+ return -1;
-+ }
-+
-+ return 0;
-+}
-+
-+static int g723_trunc(struct ast_filestream *fs)
-+{
-+ /* Truncate file to current length */
-+ if (ftruncate(fs->fd, lseek(fs->fd, 0, SEEK_CUR)) < 0)
-+ return -1;
-+ return 0;
-+}
-+
-+static long g723_tell(struct ast_filestream *fs)
-+{
-+ off_t offset, coffset;
-+ int res;
-+ long rval;
-+ unsigned char c;
-+
-+ offset = lseek(fs->fd, 0, SEEK_CUR);
-+ rval = 0;
-+ for (coffset = 0; coffset < offset; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
-+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", coffset);
-+ return -1;
-+ }
-+ if (read(fs->fd, &c, 1) != 1) {
-+ ast_log(LOG_WARNING, "Can't read from offset %llu!\n", coffset);
-+ return -1;
-+ }
-+ if ((res = g723_len(c)) < 0) {
-+ ast_log(LOG_WARNING, "Invalid G723.1 frame at offset %llu!\n", coffset);
-+ return -1;
-+ }
-+ if (res > 1)
-+ rval += 240;
-+ }
-+ if (lseek(fs->fd, offset, SEEK_SET) != offset) {
-+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", offset);
-+ return -1;
-+ }
-+ return rval;
-+}
-+
-+int load_module()
-+{
-+ return ast_format_register(name, exts, AST_FORMAT_G723_1,
-+ g723_open,
-+ g723_rewrite,
-+ g723_write,
-+ g723_seek,
-+ g723_trunc,
-+ g723_tell,
-+ g723_read,
-+ g723_close,
-+ g723_getcomment);
-+}
-+
-+int unload_module()
-+{
-+ return ast_format_unregister(name);
-+}
-+
-+int usecount()
-+{
-+ int res;
-+ if (ast_mutex_lock(&g723_lock)) {
-+ ast_log(LOG_WARNING, "Unable to lock g723 list\n");
-+ return -1;
-+ }
-+ res = glistcnt;
-+ ast_mutex_unlock(&g723_lock);
-+ return res;
-+}
-+
-+char *description()
-+{
-+ return desc;
-+}
-+
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk10/files/patch-formats::format_g729.c b/net/asterisk10/files/patch-formats::format_g729.c
deleted file mode 100644
index a144d1b0f6bf..000000000000
--- a/net/asterisk10/files/patch-formats::format_g729.c
+++ /dev/null
@@ -1,47 +0,0 @@
-
-$FreeBSD$
-
---- formats/format_g729.c.orig Wed Jan 28 23:32:48 2004
-+++ formats/format_g729.c Thu Feb 19 01:03:30 2004
-@@ -45,7 +45,7 @@
- struct ast_frame fr; /* Frame information */
- char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
- char empty; /* Empty character */
-- unsigned char g729[20]; /* Two Real G729 Frames */
-+ unsigned char g729[10]; /* One Real G729 Frame */
- };
-
-
-@@ -126,11 +126,11 @@
- s->fr.frametype = AST_FRAME_VOICE;
- s->fr.subclass = AST_FORMAT_G729A;
- s->fr.offset = AST_FRIENDLY_OFFSET;
-- s->fr.samples = 160;
-- s->fr.datalen = 20;
-+ s->fr.samples = 80;
-+ s->fr.datalen = 10;
- s->fr.mallocd = 0;
- s->fr.data = s->g729;
-- if ((res = read(s->fd, s->g729, 20)) != 20) {
-+ if ((res = read(s->fd, s->g729, 10)) != 10) {
- if (res)
- ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
- return NULL;
-@@ -174,7 +174,7 @@
- cur = lseek(fs->fd, 0, SEEK_CUR);
- max = lseek(fs->fd, 0, SEEK_END);
-
-- bytes = 20 * (sample_offset / 160);
-+ bytes = 10 * (sample_offset / 80);
- if (whence == SEEK_SET)
- offset = bytes;
- else if (whence == SEEK_CUR || whence == SEEK_FORCECUR)
-@@ -202,7 +202,7 @@
- {
- off_t offset;
- offset = lseek(fs->fd, 0, SEEK_CUR);
-- return (offset/20)*160;
-+ return (offset/10)*80;
- }
-
- int load_module()
diff --git a/net/asterisk10/files/patch-pbx::Makefile b/net/asterisk10/files/patch-pbx::Makefile
deleted file mode 100644
index dca6672c389a..000000000000
--- a/net/asterisk10/files/patch-pbx::Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-
-$FreeBSD$
-
---- pbx/Makefile.orig Sun Oct 26 20:50:49 2003
-+++ pbx/Makefile Fri Jan 30 01:47:34 2004
-@@ -16,7 +16,7 @@
- PBX_LIBS=pbx_config.so pbx_wilcalu.so pbx_spool.so # pbx_gtkconsole.so pbx_kdeconsole.so
-
- # Add GTK console if appropriate
--PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
-+#PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
- # Add KDE Console if appropriate
- #PBX_LIBS+=$(shell [ "$$QTDIR" != "" ] && echo "pbx_kdeconsole.so")
-
-@@ -62,7 +62,7 @@
- endif
-
- install: all
-- for x in $(PBX_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
-+ for x in $(PBX_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- depend: .depend
-
diff --git a/net/asterisk10/files/patch-res::Makefile b/net/asterisk10/files/patch-res::Makefile
deleted file mode 100644
index ccd0a35dd59d..000000000000
--- a/net/asterisk10/files/patch-res::Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-
-$FreeBSD$
-
---- res/Makefile.orig Sun Oct 26 20:50:49 2003
-+++ res/Makefile Fri Jan 30 01:47:34 2004
-@@ -25,7 +25,7 @@
- all: depend $(MODS)
-
- install: all
-- for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
-+ for x in $(MODS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- res_crypto.so: res_crypto.o
- $(CC) $(SOLINK) -o $@ $< $(CRYPTO_LIBS)