diff options
Diffstat (limited to 'net/asterisk14/files')
27 files changed, 0 insertions, 2439 deletions
diff --git a/net/asterisk14/files/asterisk.sh.in b/net/asterisk14/files/asterisk.sh.in deleted file mode 100644 index 4489cb50be04..000000000000 --- a/net/asterisk14/files/asterisk.sh.in +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -# PROVIDE: asterisk -# REQUIRE: DAEMON -# KEYWORD: shutdown -# -# Add the following lines to /etc/rc.conf to enable asterisk: -# -# asterisk_enable="YES" -# - -. %%RC_SUBR%% - -name=asterisk -rcvar=`set_rcvar` - -command=%%PREFIX%%/sbin/asterisk - -load_rc_config $name - -pidfile=${asterisk_pidfile:-"/var/run/asterisk.pid"} - -asterisk_enable=${asterisk_enable:-"NO"} - -run_rc_command "$1" diff --git a/net/asterisk14/files/patch-Makefile b/net/asterisk14/files/patch-Makefile deleted file mode 100644 index 876ddddd5cd6..000000000000 --- a/net/asterisk14/files/patch-Makefile +++ /dev/null @@ -1,493 +0,0 @@ ---- Makefile.orig Tue Sep 26 18:41:55 2006 -+++ Makefile Tue Sep 26 18:47:32 2006 -@@ -19,8 +19,8 @@ - # CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be- - # CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/ - # CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target --CC=$(CROSS_COMPILE)gcc --HOST_CC=gcc -+CC?=$(CROSS_COMPILE)gcc -+HOST_CC=${CC} - # CROSS_ARCH=Linux - # CROSS_PROC=arm - # SUB_PROC=xscale # or maverick -@@ -47,14 +47,14 @@ - #K6OPT = -DK6OPT - - #Tell gcc to optimize the code --OPTIMIZE+=-O6 -+#OPTIMIZE+=-O6 - endif - - #Overwite config files on "make samples" --OVERWRITE=y -+OVERWRITE=n - - #Include debug and macro symbols in the executables (-g) and profiling info (-pg) --DEBUG=-g3 #-pg -+#DEBUG=-g3 #-pg - - #Set NOCRYPTO to yes if you do not want to have crypto support or - #dependencies -@@ -88,7 +88,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 -@@ -111,17 +111,17 @@ - BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE - - ifneq ($(OSARCH),SunOS) -- 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 -- ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man -+ ASTBINDIR=$(INSTALL_PREFIX)/bin -+ ASTSBINDIR=$(INSTALL_PREFIX)/sbin -+ ASTVARRUNDIR=/var/run -+ ASTMANDIR=$(INSTALL_PREFIX)/man - MODULES_DIR=$(ASTLIBDIR)/modules - AGI_DIR=$(ASTVARLIBDIR)/agi-bin - else -@@ -226,25 +226,25 @@ - endif - - INCLUDE+=-Iinclude -I../include --ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY --ASTCFLAGS+=$(OPTIMIZE) -+ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE -DMAKE_VALGRIND_HAPPY -+#ASTCFLAGS+=$(OPTIMIZE) - ASTOBJ=-o asterisk - - ifeq ($(findstring BSD,$(OSARCH)),BSD) - PROC=$(shell uname -m) -- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib -+ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib - endif - - 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) -+# ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi) - endif - - ifeq ($(PROC),ppc) - ASTCFLAGS+=-fsigned-char - endif - --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h),) -- ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/local/include/osp -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h),) -+ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp - else - ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),) - ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/include/osp -@@ -253,27 +253,24 @@ - - ifeq ($(OSARCH),FreeBSD) - BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk) -- ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi) -- LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi) -- ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp),) -- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp -+ ASTCFLAGS+=$(PTHREAD_CFLAGS) -+ LIBS+=$(PTHREAD_LIBS) -+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp),) -+ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp - endif - MPG123TARG=freebsd - -- # XXX FreeBSD paths -- PREFIX?=/usr/local -- ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk -- ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk -- ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk -- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk -- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk -- ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk -+ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk -+ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk -+ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk -+ ASTSPOOLDIR=/var/spool/asterisk -+ ASTLOGDIR=/var/log/asterisk -+ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk - ASTCONFPATH=$(ASTETCDIR)/asterisk.conf -- ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin -- ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin -- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run -- ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man -- # XXX end FreeBSD paths -+ ASTBINDIR=$(INSTALL_PREFIX)/bin -+ ASTSBINDIR=$(INSTALL_PREFIX)/sbin -+ ASTVARRUNDIR=/var/run -+ ASTMANDIR=$(INSTALL_PREFIX)/man - - endif # FreeBSD - -@@ -307,7 +304,7 @@ - - ifndef WITHOUT_ZAPTEL - --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),) -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),) - ASTCFLAGS+=-DZAPTEL_OPTIMIZATIONS - endif - -@@ -414,7 +411,7 @@ - endif - - # This is used when generating the doxygen documentation --ifneq ($(wildcard /usr/local/bin/dot)$(wildcard /usr/bin/dot),) -+ifneq ($(wildcard $(LOCALBASE)/bin/dot)$(wildcard /usr/bin/dot),) - HAVEDOT=yes - else - HAVEDOT=no -@@ -431,7 +428,7 @@ - @echo " + $(MAKE) install +" - @echo " +-------------------------------------------+" - --all: cleantest depend asterisk subdirs -+all: cleantest depend asterisk subdirs manpage - - #ifneq ($(wildcard tags),) - ctags: tags -@@ -450,13 +447,13 @@ - cd editline && unset CFLAGS LIBS && test -f config.h || CFLAGS="$(OPTIMIZE)" ./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 -@@ -480,10 +477,10 @@ - - manpage: asterisk.8 - --asterisk.8: asterisk.sgml -- rm -f asterisk.8 -- docbook2man asterisk.sgml -- mv ./*.8 asterisk.8 -+#asterisk.8: asterisk.sgml -+# rm -f asterisk.8 -+# docbook2man asterisk.sgml -+# mv ./*.8 asterisk.8 - - asterisk.pdf: asterisk.sgml - docbook2pdf asterisk.sgml -@@ -523,14 +520,14 @@ - cygwin_a: - $(MAKE) -C cygwin all - --asterisk: $(CYGLOADER) editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS) -+asterisk: $(CYGLOADER) editline/libedit.a stdtime/libtime.a $(OBJS) - build_tools/make_build_h > include/asterisk/build.h.tmp - if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \ - mv include/asterisk/build.h.tmp include/asterisk/build.h ; \ - fi - rm -f include/asterisk/build.h.tmp - $(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c -- $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS) -+ $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) stdtime/libtime.a $(LIBS) - - muted: muted.o - $(CC) $(AUDIO_LIBS) -o muted muted.o -@@ -552,38 +549,38 @@ - - datafiles: all - if [ x`$(ID) -un` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros - 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; \ - fi; \ - done -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate - for x in sounds/dictate/*.gsm; do \ - if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \ -- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \ - else \ - echo "No description for $$x"; \ - exit 1; \ - fi; \ - done -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters - for x in sounds/letters/*.gsm; do \ - if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \ -- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \ - else \ - echo "No description for $$x"; \ - exit 1; \ - fi; \ - done -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic - for x in sounds/phonetic/*.gsm; do \ - if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \ -- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \ - else \ - echo "No description for $$x"; \ - exit 1; \ -@@ -591,18 +588,18 @@ - done - for x in sounds/demo-* sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-* sounds/hours* sounds/minute* sounds/second* ; 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 .svn ]; then \ -@@ -631,47 +628,47 @@ - OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h))) - - bininstall: all -- mkdir -p $(DESTDIR)$(MODULES_DIR) -- mkdir -p $(DESTDIR)$(ASTSBINDIR) -- mkdir -p $(DESTDIR)$(ASTETCDIR) -- mkdir -p $(DESTDIR)$(ASTBINDIR) -- mkdir -p $(DESTDIR)$(ASTVARRUNDIR) -- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail -- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate -- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system -- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp -- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme -- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor -- if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi -- if [ -f cygwin/asterisk.exe ]; then $(INSTALL) -m 755 cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi -- if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi -+ $(MKDIR) $(DESTDIR)$(MODULES_DIR) -+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR) -+ $(MKDIR) $(DESTDIR)$(ASTETCDIR) -+ $(MKDIR) $(DESTDIR)$(ASTBINDIR) -+ $(MKDIR) $(DESTDIR)$(ASTVARRUNDIR) -+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail -+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/dictate -+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/system -+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/tmp -+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/meetme -+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/monitor -+ if [ -f asterisk ]; then $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/; fi -+ if [ -f cygwin/asterisk.exe ]; then $(BSD_INSTALL_PROGRAM) cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi -+ if [ -f asterisk.dll ]; then $(BSD_INSTALL_PROGRAM) asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi - $(LN) -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk -- $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/ -- $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/ -+ $(BSD_INSTALL_SCRIPT) contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/ -+ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/ - if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \ - cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\ - chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\ - fi -- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR) -- $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR) -+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR) -+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR) - if [ -n "$(OLDHEADERS)" ]; then \ - rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\ - fi -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds -- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv -- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax -- mkdir -p $(DESTDIR)$(ASTMANDIR)/man8 -- $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys -- $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys -- $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8 -- $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8 -- $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8 -- $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8 -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds -+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-csv -+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-custom -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/keys -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax -+ $(MKDIR) $(DESTDIR)$(ASTMANDIR)/man8 -+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys -+ $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys -+ $(BSD_INSTALL_DATA) asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8 -+ $(BSD_INSTALL_DATA) contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8 -+ $(BSD_INSTALL_DATA) contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8 -+ $(BSD_INSTALL_DATA) contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8 - if [ -d contrib/firmware/iax ]; then \ -- $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \ -+ $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \ - else \ - echo "You need to do cvs update -d not just cvs update" ; \ - fi -@@ -701,46 +698,28 @@ - echo " WARNING WARNING WARNING" ;\ - fi - --install: all datafiles bininstall install-subdirs -+install: all datafiles bininstall install-subdirs samples - @if [ -x /usr/sbin/asterisk-post-install ]; then \ - /usr/sbin/asterisk-post-install $(DESTDIR) . ; \ - fi -- @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 " +-------------------------------------------+" - @$(MAKE) -s oldmodcheck - - upgrade: all bininstall - - adsi: -- 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: adsi -- mkdir -p $(DESTDIR)$(ASTETCDIR) -+ echo ADSI INSTALL $(BSD_INSTALL_DATA) -+ $(MKDIR) $(DESTDIR)$(ASTETCDIR) - for x in configs/*.sample; do \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`-dist;\ - if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \ - if [ "$(OVERWRITE)" = "y" ]; then \ - if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \ -@@ -753,7 +732,7 @@ - continue; \ - fi ;\ - fi ; \ -- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\ - done - if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \ - ( \ -@@ -813,25 +792,25 @@ - echo "; Default: strict"; \ - echo ";"; \ - echo ";translation_algorithm = strict"; \ -- ) > $(DESTDIR)$(ASTCONFPATH) ; \ -+ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \ - else \ - echo "Skipping asterisk.conf creation"; \ - fi -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ - 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 -- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \ -+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \ - for x in sounds/*.mp3; do \ -- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \ - done - rm -f $(DESTDIR)$(ASTVARLIBDIR)/mohmp3/sample-hold.mp3 -- 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 ; \ -@@ -845,9 +824,9 @@ - @[ -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 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi -- mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk -+ $(MKDIR) $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk - for x in images/*.gif; do \ -- $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \ - done - @echo " +--------- Asterisk Web Voicemail ----------+" - @echo " + +" -@@ -874,10 +853,10 @@ - - __rpm: include/asterisk/version.h spec - rm -rf /tmp/asterisk ; \ -- mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \ -+ $(MKDIR) /tmp/asterisk/redhat/RPMS/i386 ; \ - $(MAKE) DESTDIR=/tmp/asterisk install ; \ - $(MAKE) DESTDIR=/tmp/asterisk samples ; \ -- mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \ -+ $(MKDIR) /tmp/asterisk/etc/rc.d/init.d ; \ - cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \ - rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec - diff --git a/net/asterisk14/files/patch-agi::Makefile b/net/asterisk14/files/patch-agi::Makefile deleted file mode 100644 index 4615eef8ec94..000000000000 --- a/net/asterisk14/files/patch-agi::Makefile +++ /dev/null @@ -1,25 +0,0 @@ ---- agi/Makefile.orig Sun Jan 22 17:53:44 2006 -+++ agi/Makefile Sun Jan 22 17:55:53 2006 -@@ -11,7 +11,9 @@ - # 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+= - -@@ -27,8 +29,9 @@ - all: depend $(AGIS) - - install: all -- mkdir -p $(DESTDIR)$(AGI_DIR) -- for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done -+ $(MKDIR) -p $(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) $(CFLAGS) -o eagi-test eagi-test.o $(LIBS) diff --git a/net/asterisk14/files/patch-apps::Makefile b/net/asterisk14/files/patch-apps::Makefile deleted file mode 100644 index 9881ae1f3831..000000000000 --- a/net/asterisk14/files/patch-apps::Makefile +++ /dev/null @@ -1,69 +0,0 @@ ---- apps/Makefile.orig Sun Apr 30 16:38:22 2006 -+++ apps/Makefile Wed Jun 14 14:03:42 2006 -@@ -45,25 +45,27 @@ - #APPS+=app_rpt.so - - ifndef WITHOUT_ZAPTEL --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),) -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h),) - APPS+=app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so app_page.so - endif - endif # WITHOUT_ZAPTEL - --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),) -+ifdef WITH_FAX -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp.h),) -+APPS+=app_rxfax.so app_txfax.so -+endif -+endif -+ -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),) - APPS+=app_osplookup.so - endif - - ifeq ($(findstring BSD,${OSARCH}),BSD) --CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib -+CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib - endif - --CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs) --ifneq ($(shell if [[ 0x`$(CROSS_COMPILE_BIN)curl-config --vernum` -ge 0x70907 ]]; then echo "OK" ; fi),) -- ifneq (${CURLLIBS},) -- APPS+=app_curl.so -- endif --endif -+CURLLIBS=$(shell $(CROSS_COMPILE_BIN)$(LOCALBASE)/bin/curl-config --libs) -+APPS+=app_curl.so - - ifeq (${OSARCH},CYGWIN) - CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols -@@ -95,18 +97,26 @@ - $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -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 - rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so - rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so - - app_curl.so: app_curl.o - $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS) - -+ifdef WITH_FAX -+app_rxfax.so : app_rxfax.o -+ $(CC) $(SOLINK) -o $@ $< -L$(LOCALBASE)/lib -lspandsp -ltiff -+ -+app_txfax.so : app_txfax.o -+ $(CC) $(SOLINK) -o $@ $< -L$(LOCALBASE)/lib -lspandsp -ltiff -+endif -+ - app_sql_postgres.o: app_sql_postgres.c -- $(CC) -pipe -I$(CROSS_COMPILE_TARGET)/usr/local/pgsql/include -I$(CROSS_COMPILE_TARGET)/usr/include/postgresql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c -+ $(CC) -I$(LOCALBASE)/include/pgsql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c - - app_sql_postgres.so: app_sql_postgres.o -- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq -+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L$(LOCALBASE)/lib -lpq - - app_sql_odbc.so: app_sql_odbc.o - $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc diff --git a/net/asterisk14/files/patch-apps::app_rxfax.c b/net/asterisk14/files/patch-apps::app_rxfax.c deleted file mode 100644 index cabfb1a98604..000000000000 --- a/net/asterisk14/files/patch-apps::app_rxfax.c +++ /dev/null @@ -1,399 +0,0 @@ - -$FreeBSD$ - ---- apps/app_rxfax.c.orig -+++ apps/app_rxfax.c -@@ -0,0 +1,393 @@ -+/* -+ * Asterisk -- A telephony toolkit for Linux. -+ * -+ * Trivial application to receive a TIFF FAX file -+ * -+ * Copyright (C) 2003, Steve Underwood -+ * -+ * Steve Underwood <steveu@coppice.org> -+ * -+ * This program is free software, distributed under the terms of -+ * the GNU General Public License -+ */ -+ -+#include <string.h> -+#include <stdlib.h> -+#include <stdio.h> -+#if !defined(__FreeBSD__) || __FreeBSD_version < 500028 -+#include <inttypes.h> -+#else -+#include <stdint.h> -+#endif -+#include <pthread.h> -+#include <errno.h> -+#if !defined(__FreeBSD__) || __FreeBSD_version >= 503000 -+#include <tgmath.h> -+#endif -+#include <tiffio.h> -+ -+#include <spandsp.h> -+ -+#include "asterisk.h" -+ -+ASTERISK_FILE_VERSION(__FILE__, "$Revision:$") -+ -+#include "asterisk/lock.h" -+#include "asterisk/file.h" -+#include "asterisk/logger.h" -+#include "asterisk/channel.h" -+#include "asterisk/pbx.h" -+#include "asterisk/module.h" -+#include "asterisk/translate.h" -+#include "asterisk/dsp.h" -+#include "asterisk/manager.h" -+ -+static char *tdesc = "Trivial FAX Receive Application"; -+ -+static char *app = "RxFAX"; -+ -+static char *synopsis = "Receive a FAX to a file"; -+ -+static char *descrip = -+" RxFAX(filename[|caller][|debug]): Receives a FAX from the channel into the\n" -+"given filename. If the file exists it will be overwritten. The file\n" -+"should be in TIFF/F format.\n" -+"The \"caller\" option makes the application behave as a calling machine,\n" -+"rather than the answering machine. The default behaviour is to behave as\n" -+"an answering machine.\n" -+"Uses LOCALSTATIONID to identify itself to the remote end.\n" -+" LOCALHEADERINFO to generate a header line on each page.\n" -+"Sets REMOTESTATIONID to the sender CSID.\n" -+" FAXPAGES to the number of pages received.\n" -+" FAXBITRATE to the transmition rate.\n" -+" FAXRESOLUTION to the resolution.\n" -+"Returns -1 when the user hangs up.\n" -+"Returns 0 otherwise.\n"; -+ -+STANDARD_LOCAL_USER; -+ -+LOCAL_USER_DECL; -+ -+#define MAX_BLOCK_SIZE 240 -+ -+static void span_message(int level, const char *msg) -+{ -+ int ast_level; -+ -+ if (level == SPAN_LOG_WARNING) -+ ast_level = __LOG_WARNING; -+ else if (level == SPAN_LOG_WARNING) -+ ast_level = __LOG_WARNING; -+ else -+ ast_level = __LOG_DEBUG; -+ ast_log(ast_level, __FILE__, __LINE__, __PRETTY_FUNCTION__, msg); -+} -+/*- End of function --------------------------------------------------------*/ -+ -+static void t30_flush(t30_state_t *s, int which) -+{ -+ //TODO: -+} -+/*- End of function --------------------------------------------------------*/ -+ -+static void phase_e_handler(t30_state_t *s, void *user_data, int result) -+{ -+ struct ast_channel *chan; -+ t30_stats_t t; -+ char local_ident[21]; -+ char far_ident[21]; -+ char buf[11]; -+ -+ chan = (struct ast_channel *) user_data; -+ if (result == T30_ERR_OK) -+ { -+ t30_get_transfer_statistics(s, &t); -+ t30_get_far_ident(s, far_ident); -+ t30_get_local_ident(s, local_ident); -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ ast_log(LOG_DEBUG, "Fax successfully received.\n"); -+ ast_log(LOG_DEBUG, "Remote station id: %s\n", far_ident); -+ ast_log(LOG_DEBUG, "Local station id: %s\n", local_ident); -+ ast_log(LOG_DEBUG, "Pages transferred: %i\n", t.pages_transferred); -+ ast_log(LOG_DEBUG, "Image resolution: %i x %i\n", t.column_resolution, t.row_resolution); -+ ast_log(LOG_DEBUG, "Transfer Rate: %i\n", t.bit_rate); -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ manager_event(EVENT_FLAG_CALL, -+ "FaxReceived", "Channel: %s\nExten: %s\nCallerID: %s\nRemoteStationID: %s\nLocalStationID: %s\nPagesTransferred: %i\nResolution: %i\nTransferRate: %i\nFileName: %s\n", -+ chan->name, -+ chan->exten, -+ (chan->cid.cid_num) ? chan->cid.cid_num : "", -+ far_ident, -+ local_ident, -+ t.pages_transferred, -+ t.row_resolution, -+ t.bit_rate, -+ s->rx_file); -+ pbx_builtin_setvar_helper(chan, "REMOTESTATIONID", far_ident); -+ snprintf(buf, sizeof(buf), "%i", t.pages_transferred); -+ pbx_builtin_setvar_helper(chan, "FAXPAGES", buf); -+ snprintf(buf, sizeof(buf), "%i", t.row_resolution); -+ pbx_builtin_setvar_helper(chan, "FAXRESOLUTION", buf); -+ snprintf(buf, sizeof(buf), "%i", t.bit_rate); -+ pbx_builtin_setvar_helper(chan, "FAXBITRATE", buf); -+ } -+ else -+ { -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ ast_log(LOG_DEBUG, "Fax receive not successful - result (%d) %s.\n", result, t30_completion_code_to_str(result)); -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ } -+} -+/*- End of function --------------------------------------------------------*/ -+ -+static void phase_d_handler(t30_state_t *s, void *user_data, int result) -+{ -+ struct ast_channel *chan; -+ t30_stats_t t; -+ -+ chan = (struct ast_channel *) user_data; -+ if (result) -+ { -+ t30_get_transfer_statistics(s, &t); -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ ast_log(LOG_DEBUG, "Pages transferred: %i\n", t.pages_transferred); -+ ast_log(LOG_DEBUG, "Image size: %i x %i\n", t.columns, t.rows); -+ ast_log(LOG_DEBUG, "Image resolution %i x %i\n", t.column_resolution, t.row_resolution); -+ ast_log(LOG_DEBUG, "Transfer Rate: %i\n", t.bit_rate); -+ ast_log(LOG_DEBUG, "Bad rows %i\n", t.bad_rows); -+ ast_log(LOG_DEBUG, "Longest bad row run %i\n", t.longest_bad_row_run); -+ ast_log(LOG_DEBUG, "Compression type %i\n", t.encoding); -+ ast_log(LOG_DEBUG, "Image size (bytes) %i\n", t.image_size); -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ } -+} -+/*- End of function --------------------------------------------------------*/ -+ -+static int rxfax_exec(struct ast_channel *chan, void *data) -+{ -+ int res = 0; -+ char template_file[256]; -+ char target_file[256]; -+ char *s; -+ char *t; -+ char *v; -+ char *x; -+ int option; -+ int len; -+ int i; -+ t30_state_t fax; -+ int calling_party; -+ int verbose; -+ int samples; -+ -+ struct localuser *u; -+ struct ast_frame *inf = NULL; -+ struct ast_frame outf; -+ -+ int original_read_fmt; -+ int original_write_fmt; -+ -+ uint8_t __buf[sizeof(uint16_t)*MAX_BLOCK_SIZE + 2*AST_FRIENDLY_OFFSET]; -+ uint8_t *buf = __buf + AST_FRIENDLY_OFFSET; -+ -+ if (chan == NULL) -+ { -+ ast_log(LOG_WARNING, "Fax receive channel is NULL. Giving up.\n"); -+ return -1; -+ } -+ -+ span_set_message_handler(span_message); -+ -+ /* The next few lines of code parse out the filename and header from the input string */ -+ if (data == NULL) -+ { -+ /* No data implies no filename or anything is present */ -+ ast_log(LOG_WARNING, "Rxfax requires an argument (filename)\n"); -+ return -1; -+ } -+ -+ calling_party = FALSE; -+ verbose = FALSE; -+ target_file[0] = '\0'; -+ -+ for (option = 0, v = s = data; v; option++, s++) -+ { -+ t = s; -+ v = strchr(s, '|'); -+ s = (v) ? v : s + strlen(s); -+ strncpy((char *) buf, t, s - t); -+ buf[s - t] = '\0'; -+ if (option == 0) -+ { -+ /* The first option is always the file name */ -+ len = s - t; -+ if (len > 255) -+ len = 255; -+ strncpy(target_file, t, len); -+ target_file[len] = '\0'; -+ /* Allow the use of %d in the file name for a wild card of sorts, to -+ create a new file with the specified name scheme */ -+ if ((x = strchr(target_file, '%')) && x[1] == 'd') -+ { -+ strcpy(template_file, target_file); -+ i = 0; -+ do -+ { -+ snprintf(target_file, 256, template_file, 1); -+ i++; -+ } -+ while (ast_fileexists(target_file, "", chan->language) != -1); -+ } -+ } -+ else if (strncmp("caller", t, s - t) == 0) -+ { -+ calling_party = TRUE; -+ } -+ else if (strncmp("debug", t, s - t) == 0) -+ { -+ verbose = TRUE; -+ } -+ } -+ -+ /* Done parsing */ -+ -+ LOCAL_USER_ADD(u); -+ -+ if (chan->_state != AST_STATE_UP) -+ { -+ /* Shouldn't need this, but checking to see if channel is already answered -+ * Theoretically asterisk should already have answered before running the app */ -+ res = ast_answer(chan); -+ } -+ -+ if (!res) -+ { -+ original_read_fmt = chan->readformat; -+ if (original_read_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_read_format(chan, AST_FORMAT_SLINEAR); -+ if (res < 0) -+ { -+ ast_log(LOG_WARNING, "Unable to set to linear read mode, giving up\n"); -+ return -1; -+ } -+ } -+ original_write_fmt = chan->writeformat; -+ if (original_write_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_write_format(chan, AST_FORMAT_SLINEAR); -+ if (res < 0) -+ { -+ ast_log(LOG_WARNING, "Unable to set to linear write mode, giving up\n"); -+ res = ast_set_read_format(chan, original_read_fmt); -+ if (res) -+ ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name); -+ return -1; -+ } -+ } -+ fax_init(&fax, calling_party, NULL); -+ if (verbose) -+ fax.logging.level = SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW; -+ x = pbx_builtin_getvar_helper(chan, "LOCALSTATIONID"); -+ if (x && x[0]) -+ t30_set_local_ident(&fax, x); -+ x = pbx_builtin_getvar_helper(chan, "LOCALHEADERINFO"); -+ if (x && x[0]) -+ t30_set_header_info(&fax, x); -+ t30_set_rx_file(&fax, target_file, -1); -+ //t30_set_phase_b_handler(&fax, phase_b_handler, chan); -+ t30_set_phase_d_handler(&fax, phase_d_handler, chan); -+ t30_set_phase_e_handler(&fax, phase_e_handler, chan); -+ while (ast_waitfor(chan, -1) > -1) -+ { -+ inf = ast_read(chan); -+ if (inf == NULL) -+ { -+ res = -1; -+ break; -+ } -+ if (inf->frametype == AST_FRAME_VOICE) -+ { -+ if (fax_rx(&fax, inf->data, inf->samples)) -+ break; -+ samples = (inf->samples <= MAX_BLOCK_SIZE) ? inf->samples : MAX_BLOCK_SIZE; -+ len = fax_tx(&fax, (int16_t *) &buf[AST_FRIENDLY_OFFSET], samples); -+ if (len) -+ { -+ memset(&outf, 0, sizeof(outf)); -+ outf.frametype = AST_FRAME_VOICE; -+ outf.subclass = AST_FORMAT_SLINEAR; -+ outf.datalen = len*sizeof(int16_t); -+ outf.samples = len; -+ outf.data = &buf[AST_FRIENDLY_OFFSET]; -+ outf.offset = AST_FRIENDLY_OFFSET; -+ outf.src = "RxFAX"; -+ if (ast_write(chan, &outf) < 0) -+ { -+ ast_log(LOG_WARNING, "Unable to write frame to channel; %s\n", strerror(errno)); -+ break; -+ } -+ } -+ } -+ ast_frfree(inf); -+ } -+ if (inf == NULL) -+ { -+ ast_log(LOG_DEBUG, "Got hangup\n"); -+ res = -1; -+ } -+ if (original_read_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_read_format(chan, original_read_fmt); -+ if (res) -+ ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name); -+ } -+ if (original_write_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_write_format(chan, original_write_fmt); -+ if (res) -+ ast_log(LOG_WARNING, "Unable to restore write format on '%s'\n", chan->name); -+ } -+ fax_release(&fax); -+ } -+ else -+ { -+ ast_log(LOG_WARNING, "Could not answer channel '%s'\n", chan->name); -+ } -+ LOCAL_USER_REMOVE(u); -+ return res; -+} -+/*- End of function --------------------------------------------------------*/ -+ -+int unload_module(void) -+{ -+ STANDARD_HANGUP_LOCALUSERS; -+ return ast_unregister_application(app); -+} -+/*- End of function --------------------------------------------------------*/ -+ -+int load_module(void) -+{ -+ return ast_register_application(app, rxfax_exec, synopsis, descrip); -+} -+ -+char *description(void) -+{ -+ return tdesc; -+} -+/*- End of function --------------------------------------------------------*/ -+ -+int usecount(void) -+{ -+ int res; -+ STANDARD_USECOUNT(res); -+ return res; -+} -+/*- End of function --------------------------------------------------------*/ -+ -+char *key(void) -+{ -+ return ASTERISK_GPL_KEY; -+} -+/*- End of function --------------------------------------------------------*/ -+/*- End of file ------------------------------------------------------------*/ diff --git a/net/asterisk14/files/patch-apps::app_txfax.c b/net/asterisk14/files/patch-apps::app_txfax.c deleted file mode 100644 index 8d81a55ae13c..000000000000 --- a/net/asterisk14/files/patch-apps::app_txfax.c +++ /dev/null @@ -1,326 +0,0 @@ - -$FreeBSD$ - ---- apps/app_txfax.c.orig -+++ apps/app_txfax.c -@@ -0,0 +1,320 @@ -+/* -+ * Asterisk -- A telephony toolkit for Linux. -+ * -+ * Trivial application to send a TIFF file as a FAX -+ * -+ * Copyright (C) 2003, Steve Underwood -+ * -+ * Steve Underwood <steveu@coppice.org> -+ * -+ * This program is free software, distributed under the terms of -+ * the GNU General Public License -+ */ -+ -+#include <string.h> -+#include <stdlib.h> -+#include <stdio.h> -+#if !defined(__FreeBSD__) || __FreeBSD_version < 500028 -+#include <inttypes.h> -+#else -+#include <stdint.h> -+#endif -+#include <pthread.h> -+#include <errno.h> -+#if !defined(__FreeBSD__) || __FreeBSD_version >= 503000 -+#include <tgmath.h> -+#endif -+#include <tiffio.h> -+ -+#include <spandsp.h> -+ -+#include "asterisk.h" -+ -+ASTERISK_FILE_VERSION(__FILE__, "$Revision:$") -+ -+#include "asterisk/lock.h" -+#include "asterisk/file.h" -+#include "asterisk/logger.h" -+#include "asterisk/channel.h" -+#include "asterisk/pbx.h" -+#include "asterisk/module.h" -+#include "asterisk/translate.h" -+ -+static char *tdesc = "Trivial FAX Transmit Application"; -+ -+static char *app = "TxFAX"; -+ -+static char *synopsis = "Send a FAX file"; -+ -+static char *descrip = -+" TxFAX(filename[|caller][|debug]): Send a given TIFF file to the channel as a FAX.\n" -+"The \"caller\" option makes the application behave as a calling machine,\n" -+"rather than the answering machine. The default behaviour is to behave as\n" -+"an answering machine.\n" -+"Uses LOCALSTATIONID to identify itself to the remote end.\n" -+" LOCALHEADERINFO to generate a header line on each page.\n" -+"Sets REMOTESTATIONID to the receiver CSID.\n" -+"Returns -1 when the user hangs up, or if the file does not exist.\n" -+"Returns 0 otherwise.\n"; -+ -+STANDARD_LOCAL_USER; -+ -+LOCAL_USER_DECL; -+ -+#define MAX_BLOCK_SIZE 240 -+ -+static void span_message(int level, const char *msg) -+{ -+ int ast_level; -+ -+ if (level == SPAN_LOG_WARNING) -+ ast_level = __LOG_WARNING; -+ else if (level == SPAN_LOG_WARNING) -+ ast_level = __LOG_WARNING; -+ else -+ ast_level = __LOG_DEBUG; -+ ast_log(ast_level, __FILE__, __LINE__, __PRETTY_FUNCTION__, msg); -+} -+/*- End of function --------------------------------------------------------*/ -+ -+static void t30_flush(t30_state_t *s, int which) -+{ -+ //TODO: -+} -+/*- End of function --------------------------------------------------------*/ -+ -+static void phase_e_handler(t30_state_t *s, void *user_data, int result) -+{ -+ struct ast_channel *chan; -+ char far_ident[21]; -+ -+ chan = (struct ast_channel *) user_data; -+ if (result == T30_ERR_OK) -+ { -+ t30_get_far_ident(s, far_ident); -+ pbx_builtin_setvar_helper(chan, "REMOTESTATIONID", far_ident); -+ } -+ else -+ { -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ ast_log(LOG_DEBUG, "Fax send not successful - result (%d) %s.\n", result, t30_completion_code_to_str(result)); -+ ast_log(LOG_DEBUG, "==============================================================================\n"); -+ } -+} -+/*- End of function --------------------------------------------------------*/ -+ -+static int txfax_exec(struct ast_channel *chan, void *data) -+{ -+ int res = 0; -+ char source_file[256]; -+ char *x; -+ char *s; -+ char *t; -+ char *v; -+ int option; -+ int len; -+ t30_state_t fax; -+ int calling_party; -+ int verbose; -+ int samples; -+ -+ struct localuser *u; -+ struct ast_frame *inf = NULL; -+ struct ast_frame outf; -+ -+ int original_read_fmt; -+ int original_write_fmt; -+ -+ uint8_t __buf[sizeof(uint16_t)*MAX_BLOCK_SIZE + 2*AST_FRIENDLY_OFFSET]; -+ uint8_t *buf = __buf + AST_FRIENDLY_OFFSET; -+ -+ if (chan == NULL) -+ { -+ ast_log(LOG_WARNING, "Fax transmit channel is NULL. Giving up.\n"); -+ return -1; -+ } -+ -+ span_set_message_handler(span_message); -+ -+ /* The next few lines of code parse out the filename and header from the input string */ -+ if (data == NULL) -+ { -+ /* No data implies no filename or anything is present */ -+ ast_log(LOG_WARNING, "Txfax requires an argument (filename)\n"); -+ return -1; -+ } -+ -+ calling_party = FALSE; -+ verbose = FALSE; -+ source_file[0] = '\0'; -+ -+ for (option = 0, v = s = data; v; option++, s++) -+ { -+ t = s; -+ v = strchr(s, '|'); -+ s = (v) ? v : s + strlen(s); -+ strncpy((char *) buf, t, s - t); -+ buf[s - t] = '\0'; -+ if (option == 0) -+ { -+ /* The first option is always the file name */ -+ len = s - t; -+ if (len > 255) -+ len = 255; -+ strncpy(source_file, t, len); -+ source_file[len] = '\0'; -+ } -+ else if (strncmp("caller", t, s - t) == 0) -+ { -+ calling_party = TRUE; -+ } -+ else if (strncmp("debug", t, s - t) == 0) -+ { -+ verbose = TRUE; -+ } -+ } -+ -+ /* Done parsing */ -+ -+ LOCAL_USER_ADD(u); -+ -+ if (chan->_state != AST_STATE_UP) -+ { -+ /* Shouldn't need this, but checking to see if channel is already answered -+ * Theoretically asterisk should already have answered before running the app */ -+ res = ast_answer(chan); -+ } -+ -+ if (!res) -+ { -+ original_read_fmt = chan->readformat; -+ if (original_read_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_read_format(chan, AST_FORMAT_SLINEAR); -+ if (res < 0) -+ { -+ ast_log(LOG_WARNING, "Unable to set to linear read mode, giving up\n"); -+ return -1; -+ } -+ } -+ original_write_fmt = chan->writeformat; -+ if (original_write_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_write_format(chan, AST_FORMAT_SLINEAR); -+ if (res < 0) -+ { -+ ast_log(LOG_WARNING, "Unable to set to linear write mode, giving up\n"); -+ res = ast_set_read_format(chan, original_read_fmt); -+ if (res) -+ ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name); -+ return -1; -+ } -+ } -+ fax_init(&fax, calling_party, NULL); -+ if (verbose) -+ fax.logging.level = SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW; -+ -+ x = pbx_builtin_getvar_helper(chan, "LOCALSTATIONID"); -+ if (x && x[0]) -+ t30_set_local_ident(&fax, x); -+ x = pbx_builtin_getvar_helper(chan, "LOCALHEADERINFO"); -+ if (x && x[0]) -+ t30_set_header_info(&fax, x); -+ t30_set_tx_file(&fax, source_file, -1, -1); -+ //t30_set_phase_b_handler(&fax, phase_b_handler, chan); -+ //t30_set_phase_d_handler(&fax, phase_d_handler, chan); -+ t30_set_phase_e_handler(&fax, phase_e_handler, chan); -+ while (ast_waitfor(chan, -1) > -1) -+ { -+ inf = ast_read(chan); -+ if (inf == NULL) -+ { -+ res = -1; -+ break; -+ } -+ if (inf->frametype == AST_FRAME_VOICE) -+ { -+ if (fax_rx(&fax, inf->data, inf->samples)) -+ break; -+ samples = (inf->samples <= MAX_BLOCK_SIZE) ? inf->samples : MAX_BLOCK_SIZE; -+ len = fax_tx(&fax, (int16_t *) &buf[AST_FRIENDLY_OFFSET], samples); -+ if (len) -+ { -+ memset(&outf, 0, sizeof(outf)); -+ outf.frametype = AST_FRAME_VOICE; -+ outf.subclass = AST_FORMAT_SLINEAR; -+ outf.datalen = len*sizeof(int16_t); -+ outf.samples = len; -+ outf.data = &buf[AST_FRIENDLY_OFFSET]; -+ outf.offset = AST_FRIENDLY_OFFSET; -+ if (ast_write(chan, &outf) < 0) -+ { -+ ast_log(LOG_WARNING, "Unable to write frame to channel; %s\n", strerror(errno)); -+ break; -+ } -+ } -+ } -+ ast_frfree(inf); -+ } -+ if (inf == NULL) -+ { -+ ast_log(LOG_DEBUG, "Got hangup\n"); -+ res = -1; -+ } -+ if (original_read_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_read_format(chan, original_read_fmt); -+ if (res) -+ ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name); -+ } -+ if (original_write_fmt != AST_FORMAT_SLINEAR) -+ { -+ res = ast_set_write_format(chan, original_write_fmt); -+ if (res) -+ ast_log(LOG_WARNING, "Unable to restore write format on '%s'\n", chan->name); -+ } -+ fax_release(&fax); -+ } -+ else -+ { -+ ast_log(LOG_WARNING, "Could not answer channel '%s'\n", chan->name); -+ } -+ LOCAL_USER_REMOVE(u); -+ return res; -+} -+/*- End of function --------------------------------------------------------*/ -+ -+int unload_module(void) -+{ -+ STANDARD_HANGUP_LOCALUSERS; -+ return ast_unregister_application(app); -+} -+/*- End of function --------------------------------------------------------*/ -+ -+int load_module(void) -+{ -+ return ast_register_application(app, txfax_exec, synopsis, descrip); -+} -+/*- End of function --------------------------------------------------------*/ -+ -+char *description(void) -+{ -+ return tdesc; -+} -+/*- End of function --------------------------------------------------------*/ -+ -+int usecount(void) -+{ -+ int res; -+ -+ STANDARD_USECOUNT(res); -+ return res; -+} -+/*- End of function --------------------------------------------------------*/ -+ -+char *key(void) -+{ -+ return ASTERISK_GPL_KEY; -+} -+/*- End of function --------------------------------------------------------*/ -+/*- End of file ------------------------------------------------------------*/ diff --git a/net/asterisk14/files/patch-cdr::Makefile b/net/asterisk14/files/patch-cdr::Makefile deleted file mode 100644 index ff9bae81cfd4..000000000000 --- a/net/asterisk14/files/patch-cdr::Makefile +++ /dev/null @@ -1,71 +0,0 @@ ---- cdr/Makefile.orig Thu Sep 21 17:18:19 2006 -+++ cdr/Makefile Thu Oct 19 10:52:51 2006 -@@ -21,8 +21,8 @@ - endif - - ifeq ($(findstring BSD,${OSARCH}),BSD) -- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib -+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -+ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib - endif - - #The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only. -@@ -38,21 +38,21 @@ - # - # unixODBC stuff... - # --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),) -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/odbcinst.h),) - MODS+=cdr_odbc.so - endif - - # - # FreeTDS stuff... - # --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/freetds/tds.h),) -- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.64),1) -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/freetds/tds.h),) -+ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.64),1) - CFLAGS += -DFREETDS_0_64 - else -- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.63),1) -+ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.63),1) - CFLAGS += -DFREETDS_0_63 - else -- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.62),1) -+ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.62),1) - CFLAGS += -DFREETDS_0_62 - else - CFLAGS += -DFREETDS_PRE_0_62 -@@ -65,7 +65,7 @@ - # - # PGSQL stuff... Autoconf anyone?? - # --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),) -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),) - MODS+=cdr_pgsql.so - endif - -@@ -86,9 +86,9 @@ - MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib/pgsql - endif - --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql),) -- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/pgsql -- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib/pgsql -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql),) -+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql -+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/pgsql - endif - - ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include),) -@@ -114,7 +114,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/asterisk14/files/patch-channels::Makefile b/net/asterisk14/files/patch-channels::Makefile deleted file mode 100644 index 872026dfdca2..000000000000 --- a/net/asterisk14/files/patch-channels::Makefile +++ /dev/null @@ -1,83 +0,0 @@ - -$FreeBSD$ - ---- channels/Makefile.orig -+++ channels/Makefile -@@ -48,8 +48,8 @@ - endif - - ifeq (${OSARCH},FreeBSD) -- PTLIB=-lpt_FreeBSD_x86_r -- H323LIB=-lh323_FreeBSD_x86_r -+ PTLIB=-lpt_r -+ H323LIB=-lh323_r - CHANH323LIB=-pthread - endif - -@@ -73,11 +73,11 @@ - SOLINK+=-lrt - endif - --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/ixjuser.h),) -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/ixjuser.h),) - CHANNEL_LIBS+=chan_phone.so - endif - --ifneq ($(wildcard h323/libchanh323.a),) -+ifdef WITH_H323 - CHANNEL_LIBS+=chan_h323.so - endif - -@@ -91,12 +91,12 @@ - CHANNEL_LIBS+=chan_alsa.so - endif - --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libpri.so.1),) -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libpri.so.1),) - CFLAGS+=-DZAPATA_PRI - ZAPPRI=-lpri - endif - --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libmfcr2.so.1),) -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libmfcr2.so.1),) - CFLAGS+=-DZAPATA_R2 - ZAPR2=-lmfcr2 - endif -@@ -109,12 +109,12 @@ - endif - - ifndef WITHOUT_ZAPTEL --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),) -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),) - ifeq (${OSARCH},NetBSD) - SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/pkg/lib - endif - ifeq (${OSARCH},FreeBSD) -- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib -+ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib - endif - CFLAGS+=-DIAX_TRUNKING - CHANNEL_LIBS+=chan_zap.so -@@ -229,8 +229,10 @@ - chan_h323.so: chan_h323.o h323/libchanh323.a h323/Makefile.ast - $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++ - else --chan_h323.so: chan_h323.o h323/libchanh323.a -- $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat -+chan_h323.so: chan_h323.o h323/ast_h323.o -+ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o $(CHANH323LIB) -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L/usr/lib -lcrypto -lssl -lexpat -L$(LOCALBASE)/lib -llber -lldap -lldap_r -+h323/ast_h323.o: -+ $(MAKE) -C h323 ast_h323.o - endif - - chan_misdn.so: chan_misdn.o chan_misdn_config.o misdn/chan_misdn_lib.a -@@ -244,8 +246,7 @@ - # $(CC) -rdynamic -shared -Xlinker -x -o $@ $< - - install: all -- for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done -- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi -+ for x in $(CHANNEL_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done - - depend: .depend - diff --git a/net/asterisk14/files/patch-channels::chan_h323.c b/net/asterisk14/files/patch-channels::chan_h323.c deleted file mode 100644 index 4ca048812ecd..000000000000 --- a/net/asterisk14/files/patch-channels::chan_h323.c +++ /dev/null @@ -1,13 +0,0 @@ - -$FreeBSD$ - ---- channels/chan_h323.c.orig -+++ channels/chan_h323.c -@@ -31,6 +31,7 @@ - * \ingroup channel_drivers - */ - -+#include <sys/types.h> - #include <sys/socket.h> - #include <sys/signal.h> - #include <sys/param.h> diff --git a/net/asterisk14/files/patch-channels::chan_sip.c b/net/asterisk14/files/patch-channels::chan_sip.c deleted file mode 100644 index 8c24eff3a3aa..000000000000 --- a/net/asterisk14/files/patch-channels::chan_sip.c +++ /dev/null @@ -1,154 +0,0 @@ - -$FreeBSD$ - ---- channels/chan_sip.c.orig -+++ channels/chan_sip.c -@@ -340,7 +340,7 @@ - - static char default_language[MAX_LANGUAGE] = ""; - --#define DEFAULT_CALLERID "asterisk" -+#define DEFAULT_CALLERID "Unknown" - static char default_callerid[AST_MAX_EXTENSION] = DEFAULT_CALLERID; - - static char default_fromdomain[AST_MAX_EXTENSION] = ""; -@@ -483,6 +483,7 @@ - - struct sip_route { - struct sip_route *next; -+ int lr; - char hop[0]; - }; - -@@ -2815,6 +2816,8 @@ - ast_codec_pref_remove2(&tmp->nativeformats, ~i->usercapability); - fmt = ast_codec_pref_index_audio(&tmp->nativeformats, 0); - -+ pbx_builtin_setvar_helper(tmp, "SIP_CODEC_USED", ast_getformatname(fmt)); -+ - if (title) - snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%08x", title, (int)(long) i); - else if (strchr(i->fromdomain,':')) -@@ -6222,6 +6225,7 @@ - /* Make a struct route */ - thishop = malloc(sizeof(*thishop) + len); - if (thishop) { -+ thishop->lr = (strnstr(rr, ";lr", len) != NULL ? 1 : 0); - ast_copy_string(thishop->hop, rr, len); - ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop); - /* Link in */ -@@ -6247,31 +6251,41 @@ - - /* Only append the contact if we are dealing with a strict router */ - if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) { -- /* 2nd append the Contact: if there is one */ -- /* Can be multiple Contact headers, comma separated values - we just take the first */ -- contact = get_header(req, "Contact"); -- if (!ast_strlen_zero(contact)) { -- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact); -- /* Look for <: delimited address */ -- c = strchr(contact, '<'); -- if (c) { -- /* Take to > */ -- ++c; -- len = strcspn(c, ">") + 1; -- } else { -- /* No <> - just take the lot */ -- c = contact; -- len = strlen(contact) + 1; -- } -- thishop = malloc(sizeof(*thishop) + len); -+ /* Duplicate first route from the list */ -+ if (head && head->lr) { -+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1); - if (thishop) { -- ast_copy_string(thishop->hop, c, len); -- thishop->next = NULL; -- /* Goes at the end */ -- if (tail) -- tail->next = thishop; -- else -- head = thishop; -+ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1); -+ thishop->next = head; -+ head = thishop; -+ } -+ } else { -+ /* Append the Contact: if there is one and first route is w/o `lr' param */ -+ /* Can be multiple Contact headers, comma separated values - we just take the first */ -+ contact = get_header(req, "Contact"); -+ if (!ast_strlen_zero(contact)) { -+ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact); -+ /* Look for <: delimited address */ -+ c = strchr(contact, '<'); -+ if (c) { -+ /* Take to > */ -+ ++c; -+ len = strcspn(c, ">") + 1; -+ } else { -+ /* No <> - just take the lot */ -+ c = contact; -+ len = strlen(contact) + 1; -+ } -+ thishop = malloc(sizeof(*thishop) + len); -+ if (thishop) { -+ ast_copy_string(thishop->hop, c, len); -+ thishop->next = NULL; -+ /* Goes at the end */ -+ if (tail) -+ tail->next = thishop; -+ else -+ head = thishop; -+ } - } - } - } -@@ -9248,6 +9262,13 @@ - secret = p->peersecret; - md5secret = p->peermd5secret; - } -+ /* No authentication. Try to get auth info from channel vars */ -+ if (ast_strlen_zero(username)) -+ { -+ username = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_NAME"); -+ secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_SECRET"); -+ md5secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_MD5SECRET"); -+ } - if (ast_strlen_zero(username)) /* We have no authentication */ - return -1; - -@@ -10621,7 +10642,11 @@ - gotdest = get_destination(p, NULL); - - get_rdnis(p, NULL); -- extract_uri(p, req); -+ build_route(p, req, 0); -+ if (!p->route->lr) -+ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1); -+ else -+ extract_uri(p, req); - build_contact(p); - - if (gotdest) { -@@ -10649,7 +10674,6 @@ - c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username ); - *recount = 1; - /* Save Record-Route for any later requests we make on this dialogue */ -- build_route(p, req, 0); - if (c) { - /* Pre-lock the call */ - ast_mutex_lock(&c->lock); -@@ -10735,7 +10759,12 @@ - transmit_response(p, "180 Ringing", req); - break; - case AST_STATE_UP: -- /* Here we have reINVITE request - try to renegotiate codecs with */ -+ /* Assuming this to be reinvite, process new SDP portion */ -+ if (!ast_strlen_zero(get_header(req, "Content-Type"))) { -+ process_sdp(p, req); -+ } else { -+ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n"); -+ } - transmit_response_with_sdp(p, "200 OK", req, 1); - break; - default: diff --git a/net/asterisk14/files/patch-channels::chan_skinny.c b/net/asterisk14/files/patch-channels::chan_skinny.c deleted file mode 100644 index acefb8f7222c..000000000000 --- a/net/asterisk14/files/patch-channels::chan_skinny.c +++ /dev/null @@ -1,14 +0,0 @@ - -$FreeBSD$ - ---- channels/chan_skinny.c.orig -+++ channels/chan_skinny.c -@@ -99,7 +99,7 @@ - #define htolel(x) (x) - #define htoles(x) (x) - #else --#if defined(SOLARIS) || defined(__Darwin__) || defined(__NetBSD__) -+#if defined(SOLARIS) || defined(__Darwin__) || defined(__NetBSD__) || defined(__FreeBSD__) - #define __bswap_16(x) \ - ((((x) & 0xff00) >> 8) | \ - (((x) & 0x00ff) << 8)) diff --git a/net/asterisk14/files/patch-channels::chan_zap.c b/net/asterisk14/files/patch-channels::chan_zap.c deleted file mode 100644 index ab02c02af962..000000000000 --- a/net/asterisk14/files/patch-channels::chan_zap.c +++ /dev/null @@ -1,80 +0,0 @@ - -$FreeBSD$ - ---- channels/chan_zap.c.orig Tue Nov 29 20:24:39 2005 -+++ channels/chan_zap.c Fri Jan 13 13:28:33 2006 -@@ -638,6 +638,7 @@ static struct zt_pvt { - int cidlen; - int ringt; - int ringt_base; -+ int waitnorings; - int stripmsd; - int callwaitcas; - int callwaitrings; -@@ -2308,6 +2309,19 @@ static int zt_hangup(struct ast_channel - } - - ast_mutex_lock(&p->lock); -+ switch (p->sig) { -+ case SIG_FXSGS: -+ case SIG_FXSKS: -+ case SIG_FXSLS: -+ if((ast->_state == AST_STATE_RING) && (p->ringt > 1)) -+ { -+ p->waitnorings = 1; -+ } -+ break; -+ default: -+ break; -+ }; -+ - - index = zt_get_index(ast, p, 1); - -@@ -6129,7 +6143,37 @@ static void *ss_thread(void *data) - ast_setstate(chan, AST_STATE_RING); - chan->rings = 1; - p->ringt = p->ringt_base; -+ p->waitnorings = 0; - res = ast_pbx_run(chan); -+ -+ if(p->waitnorings) -+ { -+ p->ringt = p->ringt_base; -+ for(;;) -+ { -+ int i,j=0; -+ i = ZT_IOMUX_SIGEVENT | ZT_IOMUX_NOWAIT; -+ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1) -+ break; -+ -+ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1) -+ break; -+ -+ if(j == ZT_EVENT_RINGOFFHOOK) -+ p->ringt = p->ringt_base; -+ -+ usleep(20000); -+ -+ if (p->ringt <= 0) -+ break; -+ -+ else if (p->ringt > 0) -+ p->ringt--; -+ } -+ p->ringt = 0; -+ p->waitnorings = 0; -+ } -+ - if (res) { - ast_hangup(chan); - ast_log(LOG_WARNING, "PBX exited non-zero\n"); -@@ -6431,7 +6475,7 @@ static void *do_monitor(void *data) - i = iflist; - while(i) { - if ((i->subs[SUB_REAL].zfd > -1) && i->sig && (!i->radio)) { -- if (!i->owner && !i->subs[SUB_REAL].owner) { -+ if (!i->owner && !i->subs[SUB_REAL].owner && !i->waitnorings) { - /* This needs to be watched, as it lacks an owner */ - pfds[count].fd = i->subs[SUB_REAL].zfd; - pfds[count].events = POLLPRI; diff --git a/net/asterisk14/files/patch-codecs::Makefile b/net/asterisk14/files/patch-codecs::Makefile deleted file mode 100644 index ab5cbc4aef2c..000000000000 --- a/net/asterisk14/files/patch-codecs::Makefile +++ /dev/null @@ -1,53 +0,0 @@ - -$FreeBSD$ - ---- codecs/Makefile.orig Tue Nov 29 20:24:39 2005 -+++ codecs/Makefile Fri Jan 13 10:33:21 2006 -@@ -30,8 +30,8 @@ - - UI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex.h) - UIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex/speex.h) --ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex.h) --ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex/speex.h) -+ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex.h) -+ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex/speex.h) - ifneq (${UI_SPEEX},) - MODSPEEX=codec_speex.so - LIBSPEEX+=-lspeex -lm -@@ -43,14 +43,14 @@ - endif - ifneq (${ULI_SPEEX},) - MODSPEEX=codec_speex.so -- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib -+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -+ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib - LIBSPEEX+=-lspeex -lm - endif - ifneq (${ULIS_SPEEX},) - MODSPEEX=codec_speex.so -- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/speex -- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib -+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex -+ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib - LIBSPEEX+=-lspeex -lm - endif - -@@ -65,7 +65,7 @@ - LIBLPC10=lpc10/liblpc10.a - - ifeq ($(findstring BSD,${OSARCH}),BSD) -- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib -+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib - endif - - CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \ -@@ -126,7 +126,7 @@ - endif - - 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/asterisk14/files/patch-codecs::gsm::Makefile b/net/asterisk14/files/patch-codecs::gsm::Makefile deleted file mode 100644 index 756d43ca6fcd..000000000000 --- a/net/asterisk14/files/patch-codecs::gsm::Makefile +++ /dev/null @@ -1,11 +0,0 @@ ---- codecs/gsm/Makefile.orig Tue May 30 22:18:30 2006 -+++ codecs/gsm/Makefile Wed Jun 14 14:07:42 2006 -@@ -51,7 +51,7 @@ - ifneq (${PROC},ppc) - ifneq (${PROC},ppc64) - ifneq (${PROC},s390) --OPTIMIZE+=-march=$(PROC) -+#OPTIMIZE+=-march=$(PROC) - endif - endif - endif diff --git a/net/asterisk14/files/patch-codecs::ilbc::Makefile b/net/asterisk14/files/patch-codecs::ilbc::Makefile deleted file mode 100644 index 26a2f20e5529..000000000000 --- a/net/asterisk14/files/patch-codecs::ilbc::Makefile +++ /dev/null @@ -1,12 +0,0 @@ - -$FreeBSD$ - ---- codecs/ilbc/Makefile.orig Fri Jan 13 11:01:07 2006 -+++ codecs/ilbc/Makefile Fri Jan 13 11:01:51 2006 -@@ -1,5 +1,5 @@ - ARCH=$(PROC) --CFLAGS+=-Wall -O3 -funroll-loops -+CFLAGS+=-Wall -funroll-loops - ifneq (${OSARCH},CYGWIN) - CFLAGS += -fPIC - endif diff --git a/net/asterisk14/files/patch-configs::musiconhold.conf.sample b/net/asterisk14/files/patch-configs::musiconhold.conf.sample deleted file mode 100644 index ff63cc9ff08b..000000000000 --- a/net/asterisk14/files/patch-configs::musiconhold.conf.sample +++ /dev/null @@ -1,14 +0,0 @@ - -$FreeBSD$ - ---- configs/musiconhold.conf.sample.orig Tue Nov 29 20:24:39 2005 -+++ configs/musiconhold.conf.sample Fri Jan 13 11:38:39 2006 -@@ -4,7 +4,7 @@ - - [default] - mode=quietmp3 --directory=/var/lib/asterisk/mohmp3 -+directory=/usr/local/share/asterisk/mohmp3 - - ; valid mode options: - ; quietmp3 -- default diff --git a/net/asterisk14/files/patch-db.c b/net/asterisk14/files/patch-db.c deleted file mode 100644 index ba7f3f206b78..000000000000 --- a/net/asterisk14/files/patch-db.c +++ /dev/null @@ -1,21 +0,0 @@ - -$FreeBSD$ - ---- db.c.orig Fri Jan 13 11:05:32 2006 -+++ db.c Fri Jan 13 11:06:55 2006 -@@ -35,6 +35,7 @@ - #include <errno.h> - #include <unistd.h> - #include <dirent.h> -+#include <db.h> - - #include "asterisk.h" - -@@ -51,7 +52,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi - #include "asterisk/utils.h" - #include "asterisk/lock.h" - #include "asterisk/manager.h" --#include "db1-ast/include/db.h" - - #ifdef __CYGWIN__ - #define dbopen __dbopen diff --git a/net/asterisk14/files/patch-formats::Makefile b/net/asterisk14/files/patch-formats::Makefile deleted file mode 100644 index b2b1db5a37bd..000000000000 --- a/net/asterisk14/files/patch-formats::Makefile +++ /dev/null @@ -1,23 +0,0 @@ - -$FreeBSD$ - ---- formats/Makefile.orig Fri Jan 13 11:16:07 2006 -+++ formats/Makefile Fri Jan 13 11:47:25 2006 -@@ -20,7 +20,7 @@ - # - # G723 simple frame is deprecated - # --FORMAT_LIBS+=format_g723.so -+FORMAT_LIBS+=format_g723_1.so - - # - # OGG/Vorbis format -@@ -60,7 +60,7 @@ - $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -logg -lvorbis -lvorbisenc -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/asterisk14/files/patch-formats::format_g723_1.c b/net/asterisk14/files/patch-formats::format_g723_1.c deleted file mode 100644 index ae814f197a1e..000000000000 --- a/net/asterisk14/files/patch-formats::format_g723_1.c +++ /dev/null @@ -1,354 +0,0 @@ - -$FreeBSD$ - ---- /dev/null Fri Jan 13 12:18:51 2006 -+++ formats/format_g723_1.c Fri Jan 13 12:18:41 2006 -@@ -0,0 +1,348 @@ -+/* -+ * 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 <stdio.h> -+#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 <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 */ -+ FILE *f; /* 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 *); -+ -+AST_MUTEX_DEFINE_STATIC(g723_lock); -+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(FILE *f) -+{ -+ /* 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->f = f; -+ 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(FILE *f, const 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->f = f; -+ 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(); -+ fclose(s->f); -+ 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 = fread(s->g723, 1, 1, s->f)) != 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 = fread(s->g723 + 1, 1, s->fr.datalen - 1, s->f)) != 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 = fwrite(f->data, 1, f->datalen, fs->f)) != 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 (fseeko(fs->f, 0, SEEK_END) == -1) { -+ ast_log(LOG_WARNING, "Can't seek stream to an end!\n"); -+ return -1; -+ } -+ else { -+ moffset = ftello(fs->f); -+ } -+ 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 (fseeko(fs->f, coffset, SEEK_SET) == -1) { -+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", coffset); -+ return -1; -+ } -+ if (fread(&c, 1, 1, fs->f) != 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 && fseeko(fs->f, soffset, SEEK_SET) == -1) { -+ 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(fileno(fs->f), ftello(fs->f)) < 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 = ftello(fs->f); -+ rval = 0; -+ for (coffset = 0; coffset < offset; coffset += res) { -+ if (fseeko(fs->f, coffset, SEEK_SET) == -1) { -+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", coffset); -+ return -1; -+ } -+ if (fread(&c, 1, 1, fs->f) != 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 (fseeko(fs->f, offset, SEEK_SET) == -1) { -+ 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/asterisk14/files/patch-formats::format_g729.c b/net/asterisk14/files/patch-formats::format_g729.c deleted file mode 100644 index 11be5281608f..000000000000 --- a/net/asterisk14/files/patch-formats::format_g729.c +++ /dev/null @@ -1,47 +0,0 @@ - -$FreeBSD$ - ---- formats/format_g729.c.orig Fri Jan 13 12:20:53 2006 -+++ formats/format_g729.c Fri Jan 13 12:23:33 2006 -@@ -60,7 +60,7 @@ struct ast_filestream { - 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 */ - }; - - -@@ -141,11 +141,11 @@ static struct ast_frame *g729_read(struc - 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 = fread(s->g729, 1, 20, s->f)) != 20) { -+ if ((res = fread(s->g729, 1, 10, s->f)) != 10) { - if (res && (res != 10)) - ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno)); - return NULL; -@@ -190,7 +190,7 @@ static int g729_seek(struct ast_filestre - fseek(fs->f, 0, SEEK_END); - max = ftell(fs->f); - -- bytes = 20 * (sample_offset / 160); -+ bytes = 10 * (sample_offset / 80); - if (whence == SEEK_SET) - offset = bytes; - else if (whence == SEEK_CUR || whence == SEEK_FORCECUR) -@@ -219,7 +219,7 @@ static long g729_tell(struct ast_filestr - { - off_t offset; - offset = ftell(fs->f); -- return (offset/20)*160; -+ return (offset/10)*80; - } - - int load_module() diff --git a/net/asterisk14/files/patch-frame.c b/net/asterisk14/files/patch-frame.c deleted file mode 100644 index 753253c7af0d..000000000000 --- a/net/asterisk14/files/patch-frame.c +++ /dev/null @@ -1,14 +0,0 @@ - -$FreeBSD$ - ---- frame.c.orig Wed Jan 25 13:22:43 2006 -+++ frame.c Wed Jan 25 13:21:25 2006 -@@ -1170,7 +1170,7 @@ static int g723_len(unsigned char buf) - { - switch(buf & TYPE_MASK) { - case TYPE_DONTSEND: -- return 0; -+ return 2; - break; - case TYPE_SILENCE: - return 4; diff --git a/net/asterisk14/files/patch-funcs::Makefile b/net/asterisk14/files/patch-funcs::Makefile deleted file mode 100644 index a14daeed285c..000000000000 --- a/net/asterisk14/files/patch-funcs::Makefile +++ /dev/null @@ -1,14 +0,0 @@ - -$FreeBSD$ - ---- funcs/Makefile.orig Tue Nov 29 20:24:39 2005 -+++ funcs/Makefile Fri Jan 13 12:36:57 2006 -@@ -67,7 +67,7 @@ - $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} - - install: all -- for x in $(FUNCS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done -+ for x in $(FUNCS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done - - ifneq ($(wildcard .depend),) - include .depend diff --git a/net/asterisk14/files/patch-include::asterisk::utils.h b/net/asterisk14/files/patch-include::asterisk::utils.h deleted file mode 100644 index a06f7d065c84..000000000000 --- a/net/asterisk14/files/patch-include::asterisk::utils.h +++ /dev/null @@ -1,13 +0,0 @@ - -$FreeBSD$ - ---- include/asterisk/utils.h 2004/10/10 12:55:50 1.1 -+++ include/asterisk/utils.h 2004/10/10 12:56:43 -@@ -37,7 +37,6 @@ - #ifdef inet_ntoa - #undef inet_ntoa - #endif --#define inet_ntoa __dont__use__inet_ntoa__use__ast_inet_ntoa__instead__ - - #ifdef LINUX - #define ast_pthread_create pthread_create diff --git a/net/asterisk14/files/patch-pbx::Makefile b/net/asterisk14/files/patch-pbx::Makefile deleted file mode 100644 index 97d03e10f871..000000000000 --- a/net/asterisk14/files/patch-pbx::Makefile +++ /dev/null @@ -1,25 +0,0 @@ - -$FreeBSD$ - ---- pbx/Makefile.orig -+++ pbx/Makefile -@@ -23,8 +23,8 @@ - # Add KDE Console if appropriate - #PBX_LIBS+=$(shell [ "$$QTDIR" != "" ] && echo "pbx_kdeconsole.so") - --GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread` --GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread` -+#GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread` -+#GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread` - MOC=$(QTDIR)/bin/moc - KDE_FLAGS=-I$(KDEDIR)/include -I$(KDEDIR)/include/kde -I$(QTDIR)/include - KDE_LIBS=-L$(KDEDIR)/lib -L$(QTDIR)/lib -lqt -lkdecore -lkdeui -@@ -72,7 +72,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/asterisk14/files/patch-res::Makefile b/net/asterisk14/files/patch-res::Makefile deleted file mode 100644 index de5c365db34d..000000000000 --- a/net/asterisk14/files/patch-res::Makefile +++ /dev/null @@ -1,35 +0,0 @@ - -$FreeBSD$ - ---- res/Makefile -+++ res/Makefile -@@ -37,8 +37,8 @@ - endif - - ifeq ($(findstring BSD,${OSARCH}),BSD) -- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib -+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -+ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib - endif - - ifeq (${OSARCH},CYGWIN) -@@ -55,9 +55,7 @@ - CFLAGS+= - - ifndef WITHOUT_ZAPTEL --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),) - CFLAGS+=-DZAPATA_MOH --endif - endif # WITHOUT_ZAPTEL - - # -@@ -75,7 +73,7 @@ - rm -f $(DESTDIR)$(ASTHEADERDIR)/parking.h - rm -f $(DESTDIR)$(MODULES_DIR)/app_agi.so - rm -f $(DESTDIR)$(MODULES_DIR)/res_parking.so -- 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 - @if [ x`which mpg123 2>/dev/null | grep -v '^no'` != x ] ; then \ - if mpg123 --longhelp 2>&1 | grep -q .59r 2>&1 >/dev/null ; then echo ; else \ - echo "*************************************************************";\ diff --git a/net/asterisk14/files/patch-rtp.c b/net/asterisk14/files/patch-rtp.c deleted file mode 100644 index bbc2649929f9..000000000000 --- a/net/asterisk14/files/patch-rtp.c +++ /dev/null @@ -1,17 +0,0 @@ - -$FreeBSD$ - ---- rtp.c.orig Fri Jan 13 13:38:01 2006 -+++ rtp.c Fri Jan 13 13:40:50 2006 -@@ -950,8 +950,10 @@ struct ast_rtp *ast_rtp_new_with_bindadd - rtp->us.sin_port = htons(x); - rtp->us.sin_addr = addr; - /* If there's rtcp, initialize it as well. */ -- if (rtp->rtcp) -+ if (rtp->rtcp) { - rtp->rtcp->us.sin_port = htons(x + 1); -+ rtp->rtcp->us.sin_addr = addr; -+ } - /* Try to bind it/them. */ - if (!(first = bind(rtp->s, (struct sockaddr *)&rtp->us, sizeof(rtp->us))) && - (!rtp->rtcp || !bind(rtp->rtcp->s, (struct sockaddr *)&rtp->rtcp->us, sizeof(rtp->rtcp->us)))) diff --git a/net/asterisk14/files/patch-utils::Makefile b/net/asterisk14/files/patch-utils::Makefile deleted file mode 100644 index f3164c0f478a..000000000000 --- a/net/asterisk14/files/patch-utils::Makefile +++ /dev/null @@ -1,34 +0,0 @@ - -$FreeBSD$ - ---- utils/Makefile -+++ utils/Makefile -@@ -17,16 +17,16 @@ - CFLAGS+=-DNO_AST_MM - - ifeq ($(findstring BSD,${OSARCH}),BSD) -- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib -+ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib - endif - - TARGET=stereorize streamplayer - --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/popt.h),) -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/popt.h),) - TARGET+=smsq - endif - --ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/newt.h),) -+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/newt.h),) - TARGET+=astman - endif - -@@ -40,7 +40,7 @@ - install: - for x in $(TARGET); do \ - if [ "$$x" != "none" ]; then \ -- $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \ -+ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \ - fi; \ - done - |