diff options
author | sobomax <sobomax@FreeBSD.org> | 2004-04-30 13:21:08 +0800 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2004-04-30 13:21:08 +0800 |
commit | b99d93794043cdde524e502cc7905c42b3d9e995 (patch) | |
tree | 434d4b17b45eebabaec6fd179da8d074a690205e /net/asterisk16 | |
parent | 3bc3546551c8171b536c494f804452391e420c24 (diff) | |
download | freebsd-ports-gnome-b99d93794043cdde524e502cc7905c42b3d9e995.tar.gz freebsd-ports-gnome-b99d93794043cdde524e502cc7905c42b3d9e995.tar.zst freebsd-ports-gnome-b99d93794043cdde524e502cc7905c42b3d9e995.zip |
- Update to 0.9.0;
- add optional support for building with Zaptel module.
Diffstat (limited to 'net/asterisk16')
-rw-r--r-- | net/asterisk16/Makefile | 16 | ||||
-rw-r--r-- | net/asterisk16/distinfo | 4 | ||||
-rw-r--r-- | net/asterisk16/files/patch-Makefile | 26 | ||||
-rw-r--r-- | net/asterisk16/files/patch-channels::Makefile | 38 | ||||
-rw-r--r-- | net/asterisk16/files/patch-channels::chan_iax2.c | 14 | ||||
-rw-r--r-- | net/asterisk16/files/patch-channels::chan_sip.c | 120 | ||||
-rw-r--r-- | net/asterisk16/files/patch-channels::chan_zap.c | 14 | ||||
-rw-r--r-- | net/asterisk16/files/patch-codecs::lpc10::Makefile | 13 | ||||
-rw-r--r-- | net/asterisk16/files/patch-rtp.c | 42 | ||||
-rw-r--r-- | net/asterisk16/pkg-plist | 8 |
10 files changed, 264 insertions, 31 deletions
diff --git a/net/asterisk16/Makefile b/net/asterisk16/Makefile index 82db2899e80a..363d7a4f78b9 100644 --- a/net/asterisk16/Makefile +++ b/net/asterisk16/Makefile @@ -6,7 +6,7 @@ # PORTNAME= asterisk -PORTVERSION= 0.7.2 +PORTVERSION= 0.9.0 CATEGORIES= net MASTER_SITES= ftp://ftp.asterisk.org/pub/telephony/asterisk/ \ ftp://ftp.asterisk.org/pub/telephony/asterisk/old-releases/ @@ -14,8 +14,6 @@ MASTER_SITES= ftp://ftp.asterisk.org/pub/telephony/asterisk/ \ MAINTAINER= sobomax@FreeBSD.org COMMENT= An Open Source PBX and telephony toolkit -FORBIDDEN= http://people.freebsd.org/~eik/portaudit/27c331d5-64c7-11d8-80e3-0020ed76ef5a.html - ONLY_FOR_ARCHS= i386 BUILD_DEPENDS= ${LOCALBASE}/lib/mysql/libmysqlclient.a:${PORTSDIR}/databases/mysql40-client \ @@ -36,4 +34,14 @@ MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \ OSVERSION=${OSVERSION} \ CXX="${CXX}" -.include <bsd.port.mk> +.include <bsd.port.pre.mk> + +.if defined(WITH_ZAPTEL) || exists(${LOCALBASE}/include/zaptel.h) +BUILD_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel +RUN_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel +PLIST_SUB= ZAPTEL="" +.else +PLIST_SUB= ZAPTEL="@comment " +.endif + +.include <bsd.port.post.mk> diff --git a/net/asterisk16/distinfo b/net/asterisk16/distinfo index 13e376bb0fae..a12f4a79e431 100644 --- a/net/asterisk16/distinfo +++ b/net/asterisk16/distinfo @@ -1,2 +1,2 @@ -MD5 (asterisk-0.7.2.tar.gz) = a1f9485f5f85a4e4129782b6e642e236 -SIZE (asterisk-0.7.2.tar.gz) = 2779788 +MD5 (asterisk-0.9.0.tar.gz) = cb0fbb5185fdf2356ee30bdcf4ad9b9c +SIZE (asterisk-0.9.0.tar.gz) = 2787458 diff --git a/net/asterisk16/files/patch-Makefile b/net/asterisk16/files/patch-Makefile index 1e4ffbe62070..94155a666be0 100644 --- a/net/asterisk16/files/patch-Makefile +++ b/net/asterisk16/files/patch-Makefile @@ -1,8 +1,8 @@ $FreeBSD$ ---- Makefile.orig Wed Jan 14 08:48:38 2004 -+++ Makefile Fri Jan 30 02:25:09 2004 +--- Makefile.orig Thu Apr 1 01:43:10 2004 ++++ Makefile Wed Apr 14 22:08:43 2004 @@ -43,10 +43,10 @@ #K6OPT = -DK6OPT @@ -25,7 +25,7 @@ $FreeBSD$ # Staging directory # Files are copied here temporarily during the install process -@@ -88,28 +88,26 @@ +@@ -88,28 +88,27 @@ # Don't use together with -DBUSYDETECT_TONEONLY BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE @@ -51,11 +51,11 @@ $FreeBSD$ MODULES_DIR=$(ASTLIBDIR)/modules AGI_DIR=$(ASTVARLIBDIR)/agi-bin - INCLUDE=-Iinclude -I../include + 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=-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 $(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 @@ -64,7 +64,7 @@ $FreeBSD$ endif ifeq (${OSARCH},OpenBSD) CFLAGS+=-pthread -@@ -151,7 +149,7 @@ +@@ -151,7 +150,7 @@ LIBS=-pthread else ifeq (${OSARCH},FreeBSD) @@ -73,7 +73,7 @@ $FreeBSD$ else endif endif -@@ -179,7 +177,7 @@ +@@ -179,7 +178,7 @@ SOLINK=-shared -Xlinker -x endif @@ -82,7 +82,7 @@ $FreeBSD$ INSTALL=install _all: all -@@ -200,13 +198,13 @@ +@@ -200,13 +199,13 @@ cd editline && unset CFLAGS LIBS && test -f config.h || ./configure $(MAKE) -C editline libedit.a @@ -103,7 +103,7 @@ $FreeBSD$ ifneq ($(wildcard .depend),) include .depend -@@ -244,8 +242,8 @@ +@@ -244,8 +243,8 @@ exit 1; \ fi @@ -114,7 +114,7 @@ $FreeBSD$ subdirs: for x in $(SUBDIRS); do $(MAKE) -C $$x || exit 1 ; done -@@ -260,10 +258,10 @@ +@@ -260,10 +259,10 @@ $(MAKE) -C stdtime clean datafiles: all @@ -127,7 +127,7 @@ $FreeBSD$ else \ echo "No description for $$x"; \ exit 1; \ -@@ -271,18 +269,18 @@ +@@ -271,18 +270,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 \ @@ -151,7 +151,7 @@ $FreeBSD$ update: @if [ -d CVS ]; then \ -@@ -294,105 +292,74 @@ +@@ -294,105 +293,74 @@ fi bininstall: all diff --git a/net/asterisk16/files/patch-channels::Makefile b/net/asterisk16/files/patch-channels::Makefile index d05ee2c13676..fd855e7a2710 100644 --- a/net/asterisk16/files/patch-channels::Makefile +++ b/net/asterisk16/files/patch-channels::Makefile @@ -1,9 +1,9 @@ $FreeBSD$ ---- channels/Makefile.orig Fri Jan 23 22:57:48 2004 -+++ channels/Makefile Thu Feb 19 01:48:41 2004 -@@ -26,12 +26,10 @@ +--- channels/Makefile.orig Thu Mar 25 11:43:36 2004 ++++ channels/Makefile Thu Apr 29 14:36:36 2004 +@@ -33,12 +33,10 @@ # #CHANNEL_LIBS+=chan_vofr @@ -17,7 +17,25 @@ $FreeBSD$ CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API") -@@ -99,10 +97,8 @@ +@@ -48,7 +46,7 @@ + CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR") + ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri") + ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2") +-CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING") ++CFLAGS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "-DIAX_TRUNKING -I$(LOCALBASE)/include") + CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" ) + CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX") + +@@ -69,7 +67,7 @@ + + ZAPDIR=/usr/lib + +-CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so") ++CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "chan_zap.so") + + CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" ) + +@@ -110,10 +108,8 @@ chan_oss.o: chan_oss.c busy.h ringtone.h @@ -29,7 +47,16 @@ $FreeBSD$ chan_iax2.so: chan_iax2.o iax2-parser.o ifeq ($(USE_MYSQL_FRIENDS),1) -@@ -146,15 +142,17 @@ +@@ -133,7 +129,7 @@ + $(CC) -c $(CFLAGS) -o chan_zap.o chan_zap.c + + chan_zap.so: chan_zap.o +- $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -ltonezone ++ $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -L$(LOCALBASE)/lib -ltonezone + + chan_sip.so: chan_sip.o + ifeq ($(USE_MYSQL_FRIENDS),1) +@@ -157,16 +153,17 @@ chan_vpb.so: chan_vpb.o $(CXX) $(SOLINK) -o $@ $< -lvpb -lpthread -lm -ldl @@ -46,6 +73,7 @@ $FreeBSD$ 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/asterisk16/files/patch-channels::chan_iax2.c b/net/asterisk16/files/patch-channels::chan_iax2.c new file mode 100644 index 000000000000..9127bee41cb6 --- /dev/null +++ b/net/asterisk16/files/patch-channels::chan_iax2.c @@ -0,0 +1,14 @@ + +$FreeBSD$ + +--- channels/chan_iax2.c 2004/04/29 21:36:51 1.1 ++++ channels/chan_iax2.c 2004/04/29 21:37:10 +@@ -52,7 +52,7 @@ + #include <sys/stat.h> + #ifdef IAX_TRUNKING + #include <sys/ioctl.h> +-#include <linux/zaptel.h> ++#include <zaptel.h> + #endif + #ifdef MYSQL_FRIENDS + #include <mysql/mysql.h> diff --git a/net/asterisk16/files/patch-channels::chan_sip.c b/net/asterisk16/files/patch-channels::chan_sip.c new file mode 100644 index 000000000000..b98f9d185009 --- /dev/null +++ b/net/asterisk16/files/patch-channels::chan_sip.c @@ -0,0 +1,120 @@ + +$FreeBSD$ + +--- channels/chan_sip.c.orig Wed Jan 14 08:10:53 2004 ++++ channels/chan_sip.c Fri Jan 30 01:47:34 2004 +@@ -124,7 +124,7 @@ + static int restart_monitor(void); + + /* Codecs that we support by default: */ +-static int capability = AST_FORMAT_ULAW | AST_FORMAT_ALAW | AST_FORMAT_GSM | AST_FORMAT_H263; ++static int capability = AST_FORMAT_ULAW | AST_FORMAT_ALAW | AST_FORMAT_GSM | AST_FORMAT_H263 | AST_FORMAT_G723_1 | AST_FORMAT_G729A; + static int noncodeccapability = AST_RTP_DTMF; + + static char ourhost[256]; +@@ -176,6 +176,7 @@ + struct sip_route { + struct sip_route *next; + char hop[0]; ++ int lr; + }; + + static struct sip_pvt { +@@ -3417,6 +3418,10 @@ + /* Make a struct route */ + thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1); + if (thishop) { ++ if (strnstr(rr, ";lr", len) != NULL) ++ thishop->lr = 1; ++ else ++ thishop->lr = 0; + strncpy(thishop->hop, rr, len); + thishop->hop[len] = '\0'; + ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop); +@@ -3440,31 +3445,41 @@ + rr += len+1; + } + } +- /* 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 (strlen(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, ">"); +- } else { +- /* No <> - just take the lot */ +- c = contact; len = strlen(contact); +- } +- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1); ++ /* 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) { +- strncpy(thishop->hop, c, len); +- thishop->hop[len] = '\0'; +- 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 (strlen(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, ">"); ++ } else { ++ /* No <> - just take the lot */ ++ c = contact; len = strlen(contact); ++ } ++ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1); ++ if (thishop) { ++ strncpy(thishop->hop, c, len); ++ thishop->hop[len] = '\0'; ++ thishop->next = NULL; ++ /* Goes at the end */ ++ if (tail) ++ tail->next = thishop; ++ else ++ head = thishop; ++ } + } + } + /* Store as new route */ +@@ -5143,7 +5158,11 @@ + /* Get destination right away */ + 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) { +@@ -5165,7 +5184,6 @@ + c = sip_new(p, AST_STATE_DOWN, strlen(p->username) ? p->username : NULL); + *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); diff --git a/net/asterisk16/files/patch-channels::chan_zap.c b/net/asterisk16/files/patch-channels::chan_zap.c new file mode 100644 index 000000000000..e5a3ffc6afec --- /dev/null +++ b/net/asterisk16/files/patch-channels::chan_zap.c @@ -0,0 +1,14 @@ + +$FreeBSD$ + +--- channels/chan_zap.c 2004/04/29 21:36:51 1.1 ++++ channels/chan_zap.c 2004/04/29 21:37:17 +@@ -45,7 +45,7 @@ + #include <stdint.h> + #include <unistd.h> + #include <sys/ioctl.h> +-#include <linux/zaptel.h> ++#include <zaptel.h> + #include <math.h> + #include <tonezone.h> + #include <ctype.h> diff --git a/net/asterisk16/files/patch-codecs::lpc10::Makefile b/net/asterisk16/files/patch-codecs::lpc10::Makefile index 68c98c064f70..1674119a4836 100644 --- a/net/asterisk16/files/patch-codecs::lpc10::Makefile +++ b/net/asterisk16/files/patch-codecs::lpc10::Makefile @@ -1,8 +1,8 @@ $FreeBSD$ ---- codecs/lpc10/Makefile.orig Thu Jan 8 18:52:11 2004 -+++ codecs/lpc10/Makefile Fri Jan 30 02:06:54 2004 +--- codecs/lpc10/Makefile.orig Mon Mar 15 18:52:28 2004 ++++ codecs/lpc10/Makefile Wed Apr 14 22:13:47 2004 @@ -3,7 +3,7 @@ # @@ -12,7 +12,7 @@ $FreeBSD$ # # These definitions for CFLAGS and LIB_TARGET_DIR are used when one -@@ -22,14 +22,14 @@ +@@ -22,7 +22,7 @@ # WARNINGS = -Wall -Wno-comment -Wno-error @@ -20,12 +20,13 @@ $FreeBSD$ +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) + #fix for PPC processors and ALPHA too +@@ -30,7 +30,7 @@ ifneq ($(PROC),ppc) ifneq ($(PROC),x86_64) + ifneq ($(PROC),alpha) - CFLAGS+= -march=$(PROC) -+ CFLAGS+= ++ CFLAGS+= endif endif endif diff --git a/net/asterisk16/files/patch-rtp.c b/net/asterisk16/files/patch-rtp.c new file mode 100644 index 000000000000..11767dca198f --- /dev/null +++ b/net/asterisk16/files/patch-rtp.c @@ -0,0 +1,42 @@ + +$FreeBSD$ + +--- rtp.c.orig Tue Nov 25 23:15:28 2003 ++++ rtp.c Fri Jan 30 01:47:34 2004 +@@ -114,7 +114,7 @@ + { + switch(buf & TYPE_MASK) { + case TYPE_DONTSEND: +- return 0; ++ return 2; + break; + case TYPE_SILENCE: + return 4; +@@ -1028,19 +1028,6 @@ + while((f = ast_smoother_read(rtp->smoother))) + ast_rtp_raw_write(rtp, f, codec); + break; +- case AST_FORMAT_G729A: +- if (!rtp->smoother) { +- rtp->smoother = ast_smoother_new(20); +- } +- if (!rtp->smoother) { +- ast_log(LOG_WARNING, "Unable to create g729 smoother :(\n"); +- return -1; +- } +- ast_smoother_feed(rtp->smoother, _f); +- +- while((f = ast_smoother_read(rtp->smoother))) +- ast_rtp_raw_write(rtp, f, codec); +- break; + case AST_FORMAT_GSM: + if (!rtp->smoother) { + rtp->smoother = ast_smoother_new(33); +@@ -1071,6 +1058,7 @@ + case AST_FORMAT_H261: + case AST_FORMAT_H263: + case AST_FORMAT_G723_1: ++ case AST_FORMAT_G729A: + case AST_FORMAT_SPEEX: + // Don't buffer outgoing frames; send them one-per-packet: + if (_f->offset < hdrlen) { diff --git a/net/asterisk16/pkg-plist b/net/asterisk16/pkg-plist index ab3eff23ff6e..eb427fa04447 100644 --- a/net/asterisk16/pkg-plist +++ b/net/asterisk16/pkg-plist @@ -200,7 +200,6 @@ lib/asterisk/modules/app_zapateller.so lib/asterisk/modules/cdr_csv.so lib/asterisk/modules/chan_agent.so lib/asterisk/modules/chan_h323.so -lib/asterisk/modules/chan_iax.so lib/asterisk/modules/chan_iax2.so lib/asterisk/modules/chan_local.so lib/asterisk/modules/chan_mgcp.so @@ -211,6 +210,7 @@ lib/asterisk/modules/chan_modem_i4l.so lib/asterisk/modules/chan_oss.so lib/asterisk/modules/chan_sip.so lib/asterisk/modules/chan_skinny.so +%%ZAPTEL%%lib/asterisk/modules/chan_zap.so lib/asterisk/modules/codec_a_mu.so lib/asterisk/modules/codec_adpcm.so lib/asterisk/modules/codec_alaw.so @@ -377,6 +377,11 @@ share/asterisk/sounds/tt-monkeysintro.gsm share/asterisk/sounds/tt-somethingwrong.gsm share/asterisk/sounds/tt-weasels.gsm share/asterisk/sounds/vm +share/asterisk/sounds/vm-Cust1.gsm +share/asterisk/sounds/vm-Cust2.gsm +share/asterisk/sounds/vm-Cust3.gsm +share/asterisk/sounds/vm-Cust4.gsm +share/asterisk/sounds/vm-Cust5.gsm share/asterisk/sounds/vm-Family.gsm share/asterisk/sounds/vm-Friends.gsm share/asterisk/sounds/vm-INBOX.gsm @@ -447,6 +452,7 @@ share/asterisk/sounds/voicemail @dirrm lib/asterisk @dirrm include/asterisk @dirrm etc/asterisk +@unexec rm -f %D/share/asterisk/astdb @cwd /var spool/asterisk/vm spool/asterisk/voicemail/default/1234/busy.gsm |