Add asterisk 1.8 port.

Submitted by:	Florian Smeets
This commit is contained in:
Max Khon 2010-11-28 19:33:57 +00:00
parent 36913d2825
commit 9f0462bca7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=265329
61 changed files with 22099 additions and 0 deletions

View file

@ -27,6 +27,7 @@
SUBDIR += asfrecorder
SUBDIR += asio
SUBDIR += aslookup
SUBDIR += asterisk
SUBDIR += asterisk-app-ldap
SUBDIR += asterisk-app-notify
SUBDIR += asterisk-bristuff

244
net/asterisk/Makefile Normal file
View file

@ -0,0 +1,244 @@
# New ports collection makefile for: asterisk
# Date created: 17 October 2003
# Whom: Maxim Sobolev <sobomax@portaone.com>
#
# $FreeBSD$
#
PORTNAME= asterisk
PORTVERSION= 1.8.0
CATEGORIES= net
MASTER_SITES= http://downloads.asterisk.org/pub/telephony/asterisk/ \
http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/
PKGNAMESUFFIX= 18
MAINTAINER= flo@smeets.im
COMMENT= An Open Source PBX and telephony toolkit
LIB_DEPENDS= speex.1:${PORTSDIR}/audio/speex \
newt.52:${PORTSDIR}/devel/newt \
execinfo:${PORTSDIR}/devel/libexecinfo
RUN_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
ONLY_FOR_ARCHS= i386 amd64 sparc64
GNU_CONFIGURE= yes
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -I${LOCALBASE}/include/openh323" \
LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ARGS= --with-gsm=${LOCALBASE} --localstatedir=/var
CPPFLAGS= -I${LOCALBASE}/include -I${LOCALBASE}/include/openh323
USE_GMAKE= yes
USE_GNOME= libxml2
USE_BISON= build
USE_RC_SUBR= asterisk.sh
MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
PTHREAD_LIBS="${PTHREAD_LIBS}" \
MKDIR="${MKDIR}" \
PWLIBDIR=${LOCALBASE}/share/pwlib \
OPENH323DIR=${LOCALBASE}/share/openh323 \
OSVERSION=${OSVERSION} \
NOISY_BUILD=YES \
DOCSDIR=${DOCSDIR} \
ASTCFLAGS="${CFLAGS}"
MAN8= asterisk.8 astgenkey.8 autosupport.8 safe_asterisk.8
CONFLICTS= asterisk*-1.2* asterisk*-1.4* asterisk*-1.6*
OPTIONS= OGGVORBIS "Enable Ogg Vorbis support" on \
ODBC "Enable ODBC support" on \
POSTGRES "Enable PostgreSQL support" on \
RADIUS "Enable RADIUS accounting support" on \
SNMP "Enable SNMP support" on \
H323 "Enable H.323 support" on \
FREETDS "Enable FreeTDS support" on \
JABBER "Enable Jabber and Gtalk support" on \
SQLITE "Enable SQLITE support" on \
GSM "Enable GSM codec" on \
CURL "Enable CURL support" on \
ILBC "Enable iLBC codec" off \
SPANDSP "Enable Spandsp faxing support" off \
EXCHANGE "Enable Exchange calendar support" off
ASTERISK_USER?= asterisk
ASTERISK_GROUP?= asterisk
USERS= ${ASTERISK_USER}
GROUPS= ${ASTERISK_GROUP} dahdi
.include <bsd.port.pre.mk>
.if ${ARCH} == "i386" || ${ARCH} == "amd64"
OPTIONS+= DAHDI "Enable DAHDI support" on
# Include this since we have altered OPTIONS.
.include <bsd.port.options.mk>
.endif
SUB_LIST+= ASTERISK_USER=${ASTERISK_USER}
PLIST_SUB+= ASTERISK_USER=${ASTERISK_USER}
PLIST_SUB+= ASTERISK_GROUP=${ASTERISK_GROUP}
.if !defined(WITH_H323)
PLIST_SUB+= WITH_H323="@comment "
CONFIGURE_ARGS+= --without-h323
.else
PLIST_SUB+= WITH_H323=""
CONFIGURE_ARGS+= --with-h323=${LOCALBASE}
LIB_DEPENDS+= pt_r.1:${PORTSDIR}/devel/pwlib \
h323_r.1:${PORTSDIR}/net/openh323
.endif
.if !defined(WITH_DAHDI)
PLIST_SUB+= WITH_DAHDI="@comment "
CONFIGURE_ARGS+= --without-dahdi
.else
PLIST_SUB+= WITH_DAHDI=""
CONFIGURE_ARGS+= --with-dahdi
BUILD_DEPENDS+= libpri>=1.4.10:${PORTSDIR}/misc/libpri \
${LOCALBASE}/include/dahdi/user.h:${PORTSDIR}/misc/dahdi
LIB_DEPENDS+= pri.1:${PORTSDIR}/misc/libpri
RUN_DEPENDS+= ${LOCALBASE}/lib/dahdi/dahdi.ko:${PORTSDIR}/misc/dahdi
.endif
#
# WITH_FREETDS, WITH_PGSQL and WITH_SQLITE can also be added to MAKE_ENV
# similarly
.if !defined(WITH_ODBC)
PLIST_SUB+= WITH_ODBC="@comment "
CONFIGURE_ARGS+= --without-unixodbc
.else
PLIST_SUB+= WITH_ODBC=""
CONFIGURE_ARGS+= --with-unixodbc --with-ltdl
LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
USE_AUTOTOOLS= libltdl
.endif
.if !defined(WITH_FREETDS)
PLIST_SUB+= WITH_FREETDS="@comment "
CONFIGURE_ARGS+= --without-tds
.else
PLIST_SUB+= WITH_FREETDS=""
CONFIGURE_ARGS+= --with-tds=${LOCALBASE}
LIB_DEPENDS+= tds.5:${PORTSDIR}/databases/freetds
.endif
.if !defined(WITH_POSTGRES)
PLIST_SUB+= WITH_POSTGRES="@comment "
CONFIGURE_ARGS+= --without-postgres
.else
PLIST_SUB+= WITH_POSTGRES=""
USE_PGSQL= yes
CONFIGURE_ARGS+= --with-postgres
.endif
.if !defined(WITH_OGGVORBIS)
PLIST_SUB+= WITH_OGGVORBIS="@comment "
CONFIGURE_ARGS+= --without-ogg
.else
PLIST_SUB+= WITH_OGGVORBIS=""
CONFIGURE_ARGS+= --with-ogg
LIB_DEPENDS+= vorbis.4:${PORTSDIR}/audio/libvorbis
.endif
.if !defined(WITH_RADIUS)
PLIST_SUB+= WITH_RADIUS="@comment "
CONFIGURE_ARGS+= --without-radius
.else
PLIST_SUB+= WITH_RADIUS=""
CONFIGURE_ARGS+= --with-radius
LIB_DEPENDS+= radiusclient-ng.2:${PORTSDIR}/net/radiusclient
.endif
.if !defined(WITH_SNMP)
PLIST_SUB+= WITH_SNMP="@comment "
CONFIGURE_ARGS+= --without-netsnmp
.else
PLIST_SUB+= WITH_SNMP=""
CONFIGURE_ARGS+= --with-netsnmp
LIB_DEPENDS+= netsnmp:${PORTSDIR}/net-mgmt/net-snmp
.endif
.if !defined(WITH_JABBER)
PLIST_SUB+= WITH_JABBER="@comment "
CONFIGURE_ARGS+= --without-iksemel
.else
PLIST_SUB+= WITH_JABBER=""
CONFIGURE_ARGS+= --with-iksemel
LIB_DEPENDS+= iksemel.4:${PORTSDIR}/textproc/iksemel
.endif
.if !defined(WITH_SQLITE)
PLIST_SUB+= WITH_SQLITE="@comment "
CONFIGURE_ARGS+= --without-sqlite \
--with-sqlite3=no
.else
PLIST_SUB+= WITH_SQLITE=""
CONFIGURE_ARGS+= --with-sqlite
LIB_DEPENDS+= sqlite:${PORTSDIR}/databases/sqlite2 \
sqlite3:${PORTSDIR}/databases/sqlite3
.endif
.if !defined(WITH_ILBC)
PLIST_SUB+= WITH_ILBC="@comment "
.else
PLIST_SUB+= WITH_ILBC=""
EXTRA_PATCHES+= ${PATCHDIR}/ilbc_enable.diff
.endif
.if !defined(WITH_GSM)
PLIST_SUB+= WITH_GSM="@comment "
CONFIGURE_ARGS+= --without-gsm
.else
PLIST_SUB+= WITH_GSM=""
CONFIGURE_ARGS+= --with-gsm
LIB_DEPENDS+= gsm.1:${PORTSDIR}/audio/gsm
.endif
.if !defined(WITH_CURL)
PLIST_SUB+= WITH_CURL="@comment "
CONFIGURE_ARGS+= --with-libcurl=no
.else
PLIST_SUB+= WITH_CURL=""
CONFIGURE_ARGS+= --with-libcurl
LIB_DEPENDS+= curl.6:${PORTSDIR}/ftp/curl
.endif
.if !defined(WITH_SPANDSP)
PLIST_SUB+= WITH_SPANDSP="@comment "
CONFIGURE_ARGS+= --without-spandsp
.else
PLIST_SUB+= WITH_SPANDSP=""
CONFIGURE_ARGS+= --with-spandsp
LIB_DEPENDS+= spandsp.2:${PORTSDIR}/comms/spandsp-devel
.endif
.if !defined(WITH_EXCHANGE)
CONFIGURE_ARGS+= --without-neon --without-neon29
PLIST_SUB+= WITH_EXCHANGE="@comment "
.else
LIB_DEPENDS+= neon.27:${PORTSDIR}/www/neon29
PLIST_SUB+= WITH_EXCHANGE=""
.endif
.if defined(WITH_MISC_PATCHES)
EXTRA_PATCHES+= ${PATCHDIR}/dtmf_debug.diff
EXTRA_PATCHES+= ${PATCHDIR}/feature_disconnect.diff
EXTRA_PATCHES+= ${PATCHDIR}/sip_force_callid.diff
EXTRA_PATCHES+= ${PATCHDIR}/sip_set_auth.diff
.if defined(WITH_CODEC_PATCH)
EXTRA_PATCHES+= ${PATCHDIR}/rtp_force_dtmf-codecnego.diff
.else
EXTRA_PATCHES+= ${PATCHDIR}/rtp_force_dtmf-nocodecnego.diff
.endif
.endif
post-extract:
${MKDIR} ${WRKSRC}/codecs/ilbc
${FIND} ${WRKSRC} -name '*.d' -delete
post-patch:
${REINPLACE_CMD} -e 's|/var/lib|${PREFIX}/share|g' ${WRKSRC}/configs/musiconhold.conf.sample
post-install:
@${CHOWN} -R ${ASTERISK_USER}:${ASTERISK_GROUP} /var/db/asterisk /var/log/asterisk /var/spool/asterisk
.include <bsd.port.post.mk>

2
net/asterisk/distinfo Normal file
View file

@ -0,0 +1,2 @@
SHA256 (asterisk-1.8.0.tar.gz) = 8f1edbc8fab23596a6f6ee2881d67c22b4a6cb20bfad84125fcdcb3ff2e1de1b
SIZE (asterisk-1.8.0.tar.gz) = 26035124

View file

@ -0,0 +1,34 @@
#!/bin/sh
# PROVIDE: asterisk
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable asterisk:
#
# asterisk_enable="YES"
#
. /etc/rc.subr
stop_cmd=asterisk_shutdown
asterisk_shutdown () {
echo 'Stopping asterisk'
%%PREFIX%%/sbin/asterisk -nqrx 'core stop now'
sleep 1
return 0
}
name=asterisk
rcvar=`set_rcvar`
command=%%PREFIX%%/sbin/asterisk
command_args="-n -U %%ASTERISK_USER%%"
load_rc_config $name
pidfile=${asterisk_pidfile:-"/var/run/asterisk.pid"}
asterisk_enable=${asterisk_enable:-"NO"}
run_rc_command "$1"

View file

@ -0,0 +1,219 @@
--- Makefile.orig 2009-11-20 17:48:05.000000000 +0200
+++ Makefile 2009-11-20 17:50:33.000000000 +0200
@@ -101,7 +101,7 @@
OVERWRITE=y
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
-DEBUG=-g3
+#DEBUG=-g3
# Staging directory
# Files are copied here temporarily during the install process
@@ -135,7 +135,7 @@
ASTMANDIR=$(mandir)
ifneq ($(findstring BSD,$(OSARCH)),)
ASTVARLIBDIR=$(prefix)/share/asterisk
- ASTVARRUNDIR=$(localstatedir)/run/asterisk
+ ASTVARRUNDIR=$(localstatedir)/run
else
ASTVARLIBDIR=$(localstatedir)/lib/asterisk
endif
@@ -225,9 +225,11 @@
_ASTLDFLAGS+=-L/usr/local/lib
endif
+ifneq ($(OSARCH),FreeBSD)
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)
endif
+endif
ifeq ($(PROC),ppc)
_ASTCFLAGS+=-fsigned-char
@@ -235,7 +237,7 @@
ifeq ($(OSARCH),FreeBSD)
# -V is understood by BSD Make, not by GNU make.
- BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
+ BSDVERSION=$(OSVERSION)
_ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
AST_LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
endif
@@ -416,15 +418,15 @@
# Should static HTTP be installed during make samples or even with its own target ala
# webvoicemail? There are portions here that *could* be customized but might also be
# improved a lot. I'll put it here for now.
- mkdir -p $(DESTDIR)$(ASTDATADIR)/static-http
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/static-http
for x in static-http/*; do \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
done
- mkdir -p $(DESTDIR)$(ASTDATADIR)/images
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/images
for x in images/*.jpg; do \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/images ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTDATADIR)/images ; \
done
- mkdir -p $(DESTDIR)$(AGI_DIR)
+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
$(MAKE) -C sounds install
update:
@@ -445,47 +447,47 @@
OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
installdirs:
- 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
+ $(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
bininstall: _all installdirs $(SUBDIRS_INSTALL)
- $(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
+ $(BSD_INSTALL_PROGRAM) main/asterisk $(DESTDIR)$(ASTSBINDIR)/
$(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)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
- chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
+ cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/scripts/safe_asterisk.out;\
+ ${BSD_INSTALL_SCRIPT} contrib/scripts/safe_asterisk.out $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
fi
- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
- $(INSTALL) -m 644 include/asterisk.h $(DESTDIR)$(includedir)
- $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR)
+ $(BSD_INSTALL_DATA) include/asterisk.h $(DESTDIR)$(includedir)
+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
if [ -n "$(OLDHEADERS)" ]; then \
rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
fi
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
- mkdir -p $(DESTDIR)$(ASTDATADIR)/keys
- mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware
- mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware/iax
- mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
- $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
- $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
- $(INSTALL) -m 644 doc/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)$(ASTLOGDIR)/cdr-csv
+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-custom
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/keys
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/firmware
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/firmware/iax
+ $(MKDIR) $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
+ $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
+ $(BSD_INSTALL_MAN) doc/asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_MAN) contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_MAN) contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_MAN) contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
if [ -f contrib/firmware/iax/iaxy.bin ] ; then \
- $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
+ $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
fi
$(SUBDIRS_INSTALL):
@@ -521,7 +523,7 @@
@exit 1
endif
-install: badshell datafiles bininstall
+install: badshell datafiles bininstall samples
@if [ -x /usr/sbin/asterisk-post-install ]; then \
/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
fi
@@ -559,31 +561,23 @@
upgrade: bininstall
adsi:
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.adsi; do \
if [ ! -f $(DESTDIR)$(ASTETCDIR)/$$x ]; then \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
fi ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`-dist ; \
done
samples: adsi
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.sample; do \
- if [ -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
- if [ "$(OVERWRITE)" = "y" ]; then \
- if cmp -s $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $$x ; then \
- echo "Config file $$x is unchanged"; \
- continue; \
- fi ; \
- mv -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`.old ; \
- else \
- echo "Skipping config file $$x"; \
- continue; \
- fi ;\
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`-dist ;\
+ if [ ! -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`;\
fi ; \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ;\
done
- if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ if true; then \
( \
echo "[directories]" ; \
echo "astetcdir => $(ASTETCDIR)" ; \
@@ -670,20 +664,23 @@
echo "; Default: strict"; \
echo ";"; \
echo ";translation_algorithm = strict"; \
- ) > $(DESTDIR)$(ASTCONFPATH) ; \
+ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \
+ if [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ cp $(DESTDIR)$(ASTCONFPATH)-dist $(DESTDIR)$(ASTCONFPATH); \
+ fi; \
else \
echo "Skipping asterisk.conf creation"; \
fi
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
webvmail:
@[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
@[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
$(INSTALL) -m 4755 -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 " + +"

View file

@ -0,0 +1,226 @@
--- channels/chan_sip.c.orig 2009-05-12 21:18:44.000000000 +0300
+++ channels/chan_sip.c 2009-05-26 12:50:22.000000000 +0300
@@ -3891,6 +3891,7 @@
ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, p->owner);
else {
p->owner = newchan;
+ ast_rtp_set_chan_name(p->rtp, newchan->name);
/* Re-invite RTP back to Asterisk. Needed if channel is masqueraded out of a native
RTP bridge (i.e., RTP not going through Asterisk): RTP bridge code might not be
able to do this if the masquerade happens before the bridge breaks (e.g., AMI
@@ -4168,6 +4169,7 @@
if (i->rtp) {
tmp->fds[0] = ast_rtp_fd(i->rtp);
tmp->fds[1] = ast_rtcp_fd(i->rtp);
+ ast_rtp_set_chan_id(i->rtp, i->callid);
}
if (needvideo && i->vrtp) {
tmp->fds[2] = ast_rtp_fd(i->vrtp);
@@ -4195,6 +4197,8 @@
if (!ast_strlen_zero(i->language))
ast_string_field_set(tmp, language, i->language);
i->owner = tmp;
+ ast_rtp_set_chan_name(i->rtp, tmp->name);
+
ast_module_ref(ast_module_info->self);
ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
/*Since it is valid to have extensions in the dialplan that have unescaped characters in them
@@ -4621,8 +4625,10 @@
build_via(p);
if (!callid)
build_callid_pvt(p);
- else
+ else {
ast_string_field_set(p, callid, callid);
+ ast_rtp_set_chan_id(p->rtp, p->callid);
+ }
/* Assign default music on hold class */
ast_string_field_set(p, mohinterpret, default_mohinterpret);
ast_string_field_set(p, mohsuggest, default_mohsuggest);
--- include/asterisk/rtp.h.orig 2008-03-04 20:05:28.000000000 +0200
+++ include/asterisk/rtp.h 2009-05-26 12:50:22.000000000 +0300
@@ -243,6 +243,9 @@
int ast_rtp_codec_getformat(int pt);
+void ast_rtp_set_chan_name(struct ast_rtp *, const char *);
+void ast_rtp_set_chan_id(struct ast_rtp *, const char *);
+
/*! \brief Set rtp timeout */
void ast_rtp_set_rtptimeout(struct ast_rtp *rtp, int timeout);
/*! \brief Set rtp hold timeout */
--- main/rtp.c.orig 2009-11-20 17:51:49.000000000 +0200
+++ main/rtp.c 2009-11-20 17:53:11.000000000 +0200
@@ -81,6 +81,7 @@
static int rtpstart; /*!< First port for RTP sessions (set in rtp.conf) */
static int rtpend; /*!< Last port for RTP sessions (set in rtp.conf) */
static int rtpdebug; /*!< Are we debugging? */
+static int rtpdebugdtmf; /*!< Are we debugging DTMFs? */
static int rtcpdebug; /*!< Are we debugging RTCP? */
static int rtcpstats; /*!< Are we debugging RTCP? */
static int rtcpinterval = RTCP_DEFAULT_INTERVALMS; /*!< Time between rtcp reports in millisecs */
@@ -170,6 +171,8 @@
struct ast_rtp *bridged; /*!< Who we are Packet bridged to */
int set_marker_bit:1; /*!< Whether to set the marker bit or not */
unsigned int constantssrc:1;
+ char chan_name[100];
+ char chan_id[100];
};
/* Forward declarations */
@@ -676,8 +679,8 @@
struct ast_frame *f = NULL;
event = ntohl(*((unsigned int *)(data)));
event &= 0x001F;
- if (option_debug > 2 || rtpdebug)
- ast_log(LOG_DEBUG, "Cisco DTMF Digit: %08x (len = %d)\n", event, len);
+ if (option_debug > 2 || rtpdebug || rtpdebugdtmf)
+ ast_log(LOG_DEBUG, "Channel: %s %s Cisco DTMF packet: %08x (len = %d)\n", rtp->chan_name, rtp->chan_id, event, len);
if (event < 10) {
resp = '0' + event;
} else if (event < 11) {
@@ -691,12 +694,25 @@
}
if (rtp->resp && (rtp->resp != resp)) {
f = send_dtmf(rtp, AST_FRAME_DTMF_END);
+ ast_log(LOG_DEBUG, "Channel: %s %s Cisco DTMF event: %c\n", rtp->chan_name, rtp->chan_id, rtp->resp);
}
rtp->resp = resp;
rtp->dtmf_timeout = 0;
return f;
}
+void ast_rtp_set_chan_id(struct ast_rtp *rtp, const char *chan_id) {
+ if (rtp == NULL || chan_id == NULL)
+ return;
+ snprintf(rtp->chan_id, sizeof(rtp->chan_id), "%s", chan_id);
+}
+
+void ast_rtp_set_chan_name(struct ast_rtp *rtp, const char *chan_name) {
+ if (rtp == NULL || chan_name == NULL)
+ return;
+ snprintf(rtp->chan_name, sizeof(rtp->chan_name), "%s", chan_name);
+}
+
/*!
* \brief Process RTP DTMF and events according to RFC 2833.
*
@@ -1101,6 +1117,10 @@
struct rtpPayloadType rtpPT;
int reconstruct = ntohl(rtpheader[0]);
+ /* If we are listening for DTMF - then feed all packets into the core to keep the RTP stream consistent when relaying DTMFs */
+ if (ast_test_flag(rtp, FLAG_P2P_NEED_DTMF))
+ return -1;
+
/* Get fields from packet */
payload = (reconstruct & 0x7f0000) >> 16;
mark = (((reconstruct & 0x800000) >> 23) != 0);
@@ -1108,10 +1128,6 @@
/* Check what the payload value should be */
rtpPT = ast_rtp_lookup_pt(rtp, payload);
- /* If the payload is DTMF, and we are listening for DTMF - then feed it into the core */
- if (ast_test_flag(rtp, FLAG_P2P_NEED_DTMF) && !rtpPT.isAstFormat && rtpPT.code == AST_RTP_DTMF)
- return -1;
-
/* Otherwise adjust bridged payload to match */
bridged_payload = ast_rtp_lookup_code(bridged, rtpPT.isAstFormat, rtpPT.code);
@@ -1306,11 +1322,12 @@
/* This is special in-band data that's not one of our codecs */
if (rtpPT.code == AST_RTP_DTMF) {
/* It's special -- rfc2833 process it */
- if (rtp_debug_test_addr(&sin)) {
+ if (rtp_debug_test_addr(&sin) || rtpdebugdtmf) {
unsigned char *data;
unsigned int event;
unsigned int event_end;
unsigned int duration;
+
data = rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen;
event = ntohl(*((unsigned int *)(data)));
event >>= 24;
@@ -1319,9 +1336,12 @@
event_end >>= 24;
duration = ntohl(*((unsigned int *)(data)));
duration &= 0xFFFF;
- ast_verbose("Got RTP RFC2833 from %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u, mark %d, event %08x, end %d, duration %-5.5d) \n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), payloadtype, seqno, timestamp, res - hdrlen, (mark?1:0), event, ((event_end & 0x80)?1:0), duration);
+
+ ast_verbose("Channel: %s %s Got RTP RFC2833 from %s:%u to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u, mark %d, event %08x, end %d, duration %-5.5d)\n", rtp->chan_name, rtp->chan_id, ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), ast_inet_ntoa(rtp->us.sin_addr), ntohs(rtp->us.sin_port), payloadtype, seqno, timestamp, res - hdrlen, (mark?1:0), event, ((event_end & 0x80)?1:0), duration);
}
f = process_rfc2833(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen, seqno, timestamp);
+ if (rtpdebugdtmf && f)
+ ast_verbose("Channel: %s %s Got RFC2833 DTMF event %c of type %s\n", rtp->chan_name, rtp->chan_id, f->subclass, (f->frametype == AST_FRAME_DTMF_BEGIN ? "DTMF BEGIN" : (f->frametype == AST_FRAME_DTMF_END ? "DTMF_END" : "UNKNOWN")));
} else if (rtpPT.code == AST_RTP_CISCO_DTMF) {
/* It's really special -- process it the Cisco way */
if (rtp->lastevent <= seqno || (rtp->lastevent >= 65530 && seqno <= 6)) {
@@ -2287,8 +2307,9 @@
ast_log(LOG_ERROR, "RTP Transmission error to %s:%u: %s\n",
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), strerror(errno));
- if (rtp_debug_test_addr(&rtp->them))
- ast_verbose("Sent RTP DTMF packet to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
+ if (rtp_debug_test_addr(&rtp->them) || rtpdebugdtmf)
+ ast_verbose("Channel: %s %s Sent RTP DTMF packet to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
+ rtp->chan_name, rtp->chan_id,
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
/* Increment sequence number */
@@ -2331,8 +2352,9 @@
ast_log(LOG_ERROR, "RTP Transmission error to %s:%d: %s\n",
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), strerror(errno));
- if (rtp_debug_test_addr(&rtp->them))
- ast_verbose("Sent RTP DTMF packet to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
+ if (rtp_debug_test_addr(&rtp->them) || rtpdebugdtmf)
+ ast_verbose("Channel: %s %s Sent RTP DTMF packet to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
+ rtp->chan_name, rtp->chan_id,
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), rtp->send_payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
@@ -3621,6 +3643,16 @@
return RESULT_SUCCESS;
}
+static int rtp_do_debug_dtmf(int fd, int argc, char *argv[])
+{
+ if (argc != 3)
+ return RESULT_SHOWUSAGE;
+
+ rtpdebugdtmf = 1;
+ ast_cli(fd, "RTP DTMF debugging enabled\n");
+ return RESULT_SUCCESS;
+}
+
static int rtp_do_debug(int fd, int argc, char *argv[])
{
if (argc != 2) {
@@ -3681,6 +3713,7 @@
if (argc != 3)
return RESULT_SHOWUSAGE;
rtpdebug = 0;
+ rtpdebugdtmf = 0;
ast_cli(fd,"RTP Debugging Disabled\n");
return RESULT_SUCCESS;
}
@@ -3741,7 +3774,7 @@
}
static char debug_usage[] =
- "Usage: rtp debug [ip host[:port]]\n"
+ "Usage: rtp debug [ip host[:port] | dtmf]\n"
" Enable dumping of all RTP packets to and from host.\n";
static char no_debug_usage[] =
@@ -3816,6 +3849,10 @@
rtp_do_debug, "Enable RTP debugging",
debug_usage },
+ { { "rtp", "debug", "dtmf", NULL },
+ rtp_do_debug_dtmf, "Enable RTP debugging on DTMFs",
+ debug_usage },
+
{ { "rtp", "debug", "off", NULL },
rtp_no_debug, "Disable RTP debugging",
no_debug_usage, NULL, &cli_rtp_no_debug_deprecated },

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,228 @@
--- Makefile.orig 2009-10-23 17:00:01.000000000 +0300
+++ Makefile 2009-11-23 16:44:36.000000000 +0200
@@ -101,7 +101,7 @@
OVERWRITE=y
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
-DEBUG=-g3
+#DEBUG=-g3
# Staging directory
# Files are copied here temporarily during the install process
@@ -135,7 +135,7 @@
ASTMANDIR=$(mandir)
ifneq ($(findstring BSD,$(OSARCH)),)
ASTVARLIBDIR=$(prefix)/share/asterisk
- ASTVARRUNDIR=$(localstatedir)/run/asterisk
+ ASTVARRUNDIR=$(localstatedir)/run
else
ASTVARLIBDIR=$(localstatedir)/lib/asterisk
endif
@@ -225,9 +225,11 @@
_ASTLDFLAGS+=-L/usr/local/lib
endif
+ifneq ($(OSARCH),FreeBSD)
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)
endif
+endif
ifeq ($(PROC),ppc)
_ASTCFLAGS+=-fsigned-char
@@ -235,7 +237,7 @@
ifeq ($(OSARCH),FreeBSD)
# -V is understood by BSD Make, not by GNU make.
- BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
+ BSDVERSION=$(OSVERSION)
_ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
AST_LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
endif
@@ -410,21 +412,21 @@
rm -f build_tools/menuselect-deps
datafiles: _all
- if [ `$(ID) -u` = 0 ]; then \
- CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; \
- fi
+ #if [ `$(ID) -u` = 0 ]; then \
+ # CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; \
+ #fi
# Should static HTTP be installed during make samples or even with its own target ala
# webvoicemail? There are portions here that *could* be customized but might also be
# improved a lot. I'll put it here for now.
- mkdir -p $(DESTDIR)$(ASTDATADIR)/static-http
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/static-http
for x in static-http/*; do \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
done
- mkdir -p $(DESTDIR)$(ASTDATADIR)/images
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/images
for x in images/*.jpg; do \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/images ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTDATADIR)/images ; \
done
- mkdir -p $(DESTDIR)$(AGI_DIR)
+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
$(MAKE) -C sounds install
update:
@@ -445,47 +447,47 @@
OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
installdirs:
- 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
+ $(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
bininstall: _all installdirs $(SUBDIRS_INSTALL)
- $(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
+ $(BSD_INSTALL_PROGRAM) main/asterisk $(DESTDIR)$(ASTSBINDIR)/
$(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)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
- chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
+ cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/scripts/safe_asterisk.out;\
+ ${BSD_INSTALL_SCRIPT} contrib/scripts/safe_asterisk.out $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
fi
- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
- $(INSTALL) -m 644 include/asterisk.h $(DESTDIR)$(includedir)
- $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR)
+ $(BSD_INSTALL_DATA) include/asterisk.h $(DESTDIR)$(includedir)
+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
if [ -n "$(OLDHEADERS)" ]; then \
rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
fi
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
- mkdir -p $(DESTDIR)$(ASTDATADIR)/keys
- mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware
- mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware/iax
- mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
- $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
- $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
- $(INSTALL) -m 644 doc/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)$(ASTLOGDIR)/cdr-csv
+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-custom
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/keys
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/firmware
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/firmware/iax
+ $(MKDIR) $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
+ $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
+ $(BSD_INSTALL_MAN) doc/asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_MAN) contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_MAN) contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_MAN) contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
if [ -f contrib/firmware/iax/iaxy.bin ] ; then \
- $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
+ $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
fi
$(SUBDIRS_INSTALL):
@@ -521,7 +523,7 @@
@exit 1
endif
-install: badshell datafiles bininstall
+install: badshell datafiles bininstall samples
@if [ -x /usr/sbin/asterisk-post-install ]; then \
/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
fi
@@ -559,31 +561,23 @@
upgrade: bininstall
adsi:
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.adsi; do \
if [ ! -f $(DESTDIR)$(ASTETCDIR)/$$x ]; then \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
fi ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`-dist ; \
done
samples: adsi
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.sample; do \
- if [ -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
- if [ "$(OVERWRITE)" = "y" ]; then \
- if cmp -s $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $$x ; then \
- echo "Config file $$x is unchanged"; \
- continue; \
- fi ; \
- mv -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`.old ; \
- else \
- echo "Skipping config file $$x"; \
- continue; \
- fi ;\
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`-dist ;\
+ if [ ! -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`;\
fi ; \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ;\
done
- if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ if true; then \
( \
echo "[directories]" ; \
echo "astetcdir => $(ASTETCDIR)" ; \
@@ -629,20 +623,23 @@
echo ";astctlowner = root" ; \
echo ";astctlgroup = apache" ; \
echo ";astctl = asterisk.ctl" ; \
- ) > $(DESTDIR)$(ASTCONFPATH) ; \
+ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \
+ if [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ cp $(DESTDIR)$(ASTCONFPATH)-dist $(DESTDIR)$(ASTCONFPATH); \
+ fi; \
else \
echo "Skipping asterisk.conf creation"; \
fi
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
webvmail:
@[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
@[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
$(INSTALL) -m 4755 -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 " + +"

View file

@ -0,0 +1,112 @@
--- Makefile.orig 2010-10-14 00:24:44.000000000 +0200
+++ Makefile 2010-11-17 12:24:32.000000000 +0100
@@ -122,7 +122,7 @@
OVERWRITE=y
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
-DEBUG=-g3
+#DEBUG=-g3
# Asterisk.conf is located in ASTETCDIR or by using the -C flag
# when starting Asterisk
@@ -220,11 +220,13 @@
_ASTCFLAGS+=-isystem /usr/local/include
endif
+ifneq ($(OSARCH),FreeBSD)
ifeq ($(findstring -march,$(_ASTCFLAGS) $(ASTCFLAGS)),)
ifneq ($(PROC),ultrasparc)
_ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
endif
endif
+endif
ifeq ($(PROC),ppc)
_ASTCFLAGS+=-fsigned-char
@@ -232,7 +234,7 @@
ifeq ($(OSARCH),FreeBSD)
# -V is understood by BSD Make, not by GNU make.
- BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
+ BSDVERSION=$(OSVERSION)
_ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
endif
@@ -460,13 +462,14 @@
done
$(INSTALL) -m 644 doc/core-en_US.xml $(DESTDIR)$(ASTDATADIR)/static-http;
if [ -d doc/tex/asterisk ] ; then \
- $(INSTALL) -d $(DESTDIR)$(ASTDATADIR)/static-http/docs ; \
+ $(INSTALL) -d $(DESTDIR)$(DOCSDIR) ; \
+ $(INSTALL) -d $(DESTDIR)$(DOCSDIR)/images ; \
for n in doc/tex/asterisk/* ; do \
- $(INSTALL) -m 644 $$n $(DESTDIR)$(ASTDATADIR)/static-http/docs ; \
+ $(INSTALL) -m 644 $$n $(DESTDIR)$(DOCSDIR) ; \
done \
fi
for x in images/*.jpg; do \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/images ; \
+ $(INSTALL) -m 644 $$x $(DESTDIR)$(DOCSDIR)/images ; \
done
$(MAKE) -C sounds install
@@ -526,6 +529,7 @@
$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/dictate"
$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/meetme"
$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/monitor"
+ $(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/outgoing"
$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/system"
$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/tmp"
$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/voicemail"
@@ -547,6 +551,7 @@
$(INSTALL) -d "$(DESTDIR)$(ASTDATADIR)/static-http"
$(INSTALL) -d "$(DESTDIR)$(ASTMANDIR)/man8"
$(INSTALL) -d "$(DESTDIR)$(AGI_DIR)"
+ $(INSTALL) -d "$(DESTDIR)$(ASTDBDIR)"
bininstall: _all installdirs $(SUBDIRS_INSTALL)
$(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
@@ -606,7 +611,7 @@
@exit 1
endif
-install: badshell bininstall datafiles
+install: badshell bininstall datafiles samples
@if [ -x /usr/sbin/asterisk-post-install ]; then \
/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
fi
@@ -648,29 +653,18 @@
else \
echo "Installing $$x" ; \
fi ; \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
+ $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`-dist ; \
done
samples: adsi
@echo Installing other config files...
@for x in configs/*.sample; do \
- dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`" ; \
- if [ -f $${dst} ]; then \
- if [ "$(OVERWRITE)" = "y" ]; then \
- if cmp -s $${dst} $$x ; then \
- echo "Config file $$x is unchanged"; \
- continue; \
- fi ; \
- mv -f $${dst} $${dst}.old ; \
- else \
- echo "Skipping config file $$x"; \
- continue; \
- fi ;\
+ $(INSTALL) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`-dist ; \
+ if [ ! -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
+ $(INSTALL) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`; \
fi ; \
- echo "Installing file $$x"; \
- $(INSTALL) -m 644 $$x $${dst} ;\
done
- if [ "$(OVERWRITE)" = "y" ]; then \
+ @if true; then \
echo "Updating asterisk.conf" ; \
sed -e 's|^astetcdir.*$$|astetcdir => $(ASTETCDIR)|' \
-e 's|^astmoddir.*$$|astmoddir => $(MODULES_DIR)|' \

View file

@ -0,0 +1,16 @@
--- Makefile.rules.orig 2009-09-28 22:09:25.000000000 +0300
+++ Makefile.rules 2009-11-23 16:15:23.000000000 +0200
@@ -37,11 +37,13 @@
OPTIMIZE?=-O6
+ifneq ($(OSARCH),FreeBSD)
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),)
_ASTCFLAGS+=$(OPTIMIZE)
else
_ASTCFLAGS+=-O0
endif
+endif
# shortcuts for common combinations of flags; these must be recursively expanded so that
# per-target settings will be applied

View file

@ -0,0 +1,13 @@
--- ./agi/Makefile.orig 2010-07-23 15:26:41.000000000 +0200
+++ ./agi/Makefile 2010-11-06 14:54:36.000000000 +0100
@@ -16,7 +16,9 @@
.PHONY: clean all uninstall
-AGIS=$(MENUSELECT_AGIS)
+AGIS_BIN=eagi-test eagi-sphinx-test
+AGIS_SCR=agi-test.agi jukebox.agi
+AGIS=$(AGIS_SCR) $(AGIS_BIN)
ifeq ($(OSARCH),SunOS)
LIBS+=-lsocket -lnsl

View file

@ -0,0 +1,33 @@
--- channels/chan_dahdi.c.orig 2010-11-09 11:18:39.000000000 +0100
+++ channels/chan_dahdi.c 2010-11-09 11:22:15.000000000 +0100
@@ -4688,6 +4688,8 @@
return;
}
if (p->echocancel.head.tap_length) {
+ struct dahdi_echocanparams *pecp;
+
#if defined(HAVE_PRI) || defined(HAVE_SS7)
switch (p->sig) {
#if defined(HAVE_PRI)
@@ -4718,7 +4720,9 @@
break;
}
#endif /* defined(HAVE_PRI) || defined(HAVE_SS7) */
- res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_ECHOCANCEL_PARAMS, &p->echocancel);
+
+ pecp = &p->echocancel.head;
+ res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_ECHOCANCEL_PARAMS, &pecp);
if (res) {
ast_log(LOG_WARNING, "Unable to enable echo cancellation on channel %d (%s)\n", p->channel, strerror(errno));
} else {
@@ -4752,8 +4756,9 @@
if (p->echocanon) {
struct dahdi_echocanparams ecp = { .tap_length = 0 };
+ struct dahdi_echocanparams *pecp = &ecp;
- res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_ECHOCANCEL_PARAMS, &ecp);
+ res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_ECHOCANCEL_PARAMS, &pecp);
if (res)
ast_log(LOG_WARNING, "Unable to disable echo cancellation on channel %d: %s\n", p->channel, strerror(errno));

View file

@ -0,0 +1,29 @@
--- ./channels/Makefile.orig 2010-06-07 22:04:42.000000000 +0200
+++ ./channels/Makefile 2010-11-06 14:54:36.000000000 +0100
@@ -27,9 +27,10 @@
endif
ifeq ($(OSARCH),FreeBSD)
- PTLIB=-lpt_FreeBSD_x86_r
- H323LIB=-lh323_FreeBSD_x86_r
+ PTLIB=-lpt_r
+ H323LIB=-lh323_r
CHANH323LIB=-pthread
+ H323LDLIBS=$(PTLIB) $(H323LIB) $(CHANH323LIB)
endif
ifeq ($(OSARCH),NetBSD)
@@ -86,9 +87,13 @@
else
chan_h323.so: chan_h323.o h323/libchanh323.a
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
+ifeq ($(OSARCH),FreeBSD)
+ $(CMD_PREFIX) $(CXX) $(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) -L$(LOCALBASE)/lib $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) $(CHANH323LIB)
+else
$(CMD_PREFIX) $(CXX) $(PTHREAD_CFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
endif
endif
+endif
chan_misdn.o: _ASTCFLAGS+=-Imisdn

View file

@ -0,0 +1,11 @@
--- channels/chan_sip.c.orig 2008-06-10 00:46:46.000000000 -0700
+++ channels/chan_sip.c 2008-06-10 00:46:46.000000000 -0700
@@ -496,7 +496,7 @@
#define DEFAULT_MOHINTERPRET "default"
#define DEFAULT_MOHSUGGEST ""
#define DEFAULT_VMEXTEN "asterisk"
-#define DEFAULT_CALLERID "asterisk"
+#define DEFAULT_CALLERID "Unknown"
#define DEFAULT_NOTIFYMIME "application/simple-message-summary"
#define DEFAULT_MWITIME 10
#define DEFAULT_ALLOWGUEST TRUE

View file

@ -0,0 +1,11 @@
--- ./channels/sip/include/sip.h.orig 2010-11-08 04:46:46.000000000 +0100
+++ ./channels/sip/include/sip.h 2010-11-08 04:47:07.000000000 +0100
@@ -180,7 +180,7 @@
#define DEFAULT_MOHINTERPRET "default" /*!< The default music class */
#define DEFAULT_MOHSUGGEST ""
#define DEFAULT_VMEXTEN "asterisk" /*!< Default voicemail extension */
-#define DEFAULT_CALLERID "asterisk" /*!< Default caller ID */
+#define DEFAULT_CALLERID "Unknown" /*!< Default caller ID */
#define DEFAULT_MWI_FROM ""
#define DEFAULT_NOTIFYMIME "application/simple-message-summary"
#define DEFAULT_ALLOWGUEST TRUE

View file

@ -0,0 +1,11 @@
--- ./channels/h323/Makefile.in.orig 2010-06-03 16:48:09.000000000 +0200
+++ ./channels/h323/Makefile.in 2010-11-06 14:54:36.000000000 +0100
@@ -13,7 +13,7 @@
STDCCFLAGS += -I../../include -include ../../include/asterisk/autoconfig.h
STDCCFLAGS += -fPIC
#OPTCCFLAGS +=
-CFLAGS = -pipe
+CFLAGS = -pipe @CXXFLAGS@
TARGET = libchanh323.a
TARGET += Makefile.ast
SOURCES = ast_h323.cxx compat_h323.cxx cisco-h225.cxx caps_h323.cxx

View file

@ -0,0 +1,33 @@
--- configure.orig 2010-10-07 22:58:47.000000000 +0200
+++ configure 2010-11-06 15:54:49.000000000 +0100
@@ -4670,9 +4670,9 @@
astheaderdir='${includedir}/asterisk'
astlibdir='${libdir}/asterisk'
astmandir='${mandir}'
-astvarlibdir='${localstatedir}/lib/asterisk'
+astvarlibdir='${prefix}/share/asterisk'
astdatadir='${astvarlibdir}'
-astdbdir='${astvarlibdir}'
+astdbdir='${localstatedir}/db/asterisk'
astkeydir='${astvarlibdir}'
astspooldir='${localstatedir}/spool/asterisk'
astlogdir='${localstatedir}/log/asterisk'
@@ -4694,9 +4694,6 @@
case "${host_os}" in
freebsd*)
-
- CPPFLAGS=-I/usr/local/include
- LDFLAGS=-L/usr/local/lib
;;
openbsd*)
@@ -25058,7 +25055,7 @@
fi
- PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
+ PLATFORM_OPENH323="h323_${OPENH323_SUFFIX}"
if test "${HAS_OPENH323:-unset}" != "unset"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenH323 installation validity" >&5

View file

@ -0,0 +1,13 @@
$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

View file

@ -0,0 +1,30 @@
--- ./main/Makefile.orig 2010-08-02 16:41:46.000000000 +0200
+++ ./main/Makefile 2010-11-06 14:54:37.000000000 +0100
@@ -107,8 +107,8 @@
cd editline && test -f config.h || CFLAGS="$(PTHREAD_CFLAGS) $(subst $(ASTTOPDIR),../../,$(_ASTCFLAGS:-Werror=) $(ASTCFLAGS))" LDFLAGS="$(_ASTLDFLAGS) $(ASTLDFLAGS)" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --with-ncurses=$(NCURSES_DIR) --with-curses=$(CURSES_DIR) --with-termcap=$(TERMCAP_DIR) --with-tinfo=$(TINFO_DIR)
$(MAKE) -C editline libedit.a
-db1-ast/libdb1.a: CHECK_SUBDIR
- _ASTCFLAGS="$(_ASTCFLAGS) -Wno-strict-aliasing" ASTCFLAGS="$(ASTCFLAGS)" $(MAKE) -C db1-ast libdb1.a
+#db1-ast/libdb1.a: CHECK_SUBDIR
+# _ASTCFLAGS="$(_ASTCFLAGS) -Wno-strict-aliasing" ASTCFLAGS="$(ASTCFLAGS)" $(MAKE) -C db1-ast libdb1.a
ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),)
ast_expr2.c ast_expr2.h: ast_expr2.y
@@ -173,13 +173,13 @@
$(OBJS): _ASTCFLAGS+=-DAST_MODULE=\"core\"
-$(MAIN_TGT): $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS)
+$(MAIN_TGT): $(OBJS) editline/libedit.a $(AST_EMBED_LDSCRIPTS)
@$(CC) -c -o buildinfo.o $(_ASTCFLAGS) buildinfo.c $(ASTCFLAGS)
$(ECHO_PREFIX) echo " [LD] $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) -> $@"
ifneq ($(findstring chan_h323,$(MENUSELECT_CHANNELS)),)
- $(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(GMIMELDFLAGS)
+ $(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(LDFLAGS) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(OBJS) editline/libedit.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(GMIMELDFLAGS)
else
- $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS) $(GMIMELDFLAGS)
+ $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(LDFLAGS) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $(OBJS) editline/libedit.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS) $(GMIMELDFLAGS)
endif
ifeq ($(GNU_LD),1)

View file

@ -0,0 +1,18 @@
--- ./main/db.c.orig 2010-09-10 22:31:58.000000000 +0200
+++ ./main/db.c 2010-11-06 14:54:37.000000000 +0100
@@ -36,6 +36,7 @@
#include <sys/time.h>
#include <signal.h>
#include <dirent.h>
+#include <db.h>
#include "asterisk/channel.h"
#include "asterisk/file.h"
@@ -46,7 +47,6 @@
#include "asterisk/utils.h"
#include "asterisk/lock.h"
#include "asterisk/manager.h"
-#include "db1-ast/include/db.h"
/*** DOCUMENTATION
<manager name="DBGet" language="en_US">

View file

@ -0,0 +1,14 @@
$FreeBSD$
--- main/frame.c.orig Wed Jan 25 13:22:43 2006
+++ main/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;

View file

@ -0,0 +1,13 @@
--- ./main/utils.c.orig 2010-08-06 20:57:10.000000000 +0200
+++ ./main/utils.c 2010-11-06 14:54:37.000000000 +0100
@@ -990,8 +990,8 @@
pthread_attr_init(attr);
}
-#ifdef __linux__
- /* On Linux, pthread_attr_init() defaults to PTHREAD_EXPLICIT_SCHED,
+#ifdef __linux__ || defined(__FreeBSD__)
+ /* On Linux and FreeBSD, pthread_attr_init() defaults to PTHREAD_EXPLICIT_SCHED,
which is kind of useless. Change this here to
PTHREAD_INHERIT_SCHED; that way the -p option to set realtime
priority will propagate down to new threads by default.

View file

@ -0,0 +1,13 @@
--- ./main/lock.c.orig 2010-11-06 15:00:15.000000000 +0100
+++ ./main/lock.c 2010-11-06 15:00:23.000000000 +0100
@@ -679,10 +679,6 @@
pthread_rwlockattr_init(&attr);
-#ifdef HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP
- pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_WRITER_NP);
-#endif
-
res = pthread_rwlock_init(&t->lock, &attr);
pthread_rwlockattr_destroy(&attr);
return res;

View file

@ -0,0 +1,25 @@
--- channels/chan_sip.c.orig 2009-04-14 08:58:13.000000000 +0100
+++ channels/chan_sip.c 2009-04-14 09:00:58.000000000 +0100
@@ -16287,7 +16287,6 @@
restartsearch:
/* Check for interfaces needing to be killed */
ast_mutex_lock(&iflock);
- t = time(NULL);
/* don't scan the interface list if it hasn't been a reasonable period
of time since the last time we did it (when MWI is being sent, we can
get back to this point every millisecond or less)
@@ -16306,12 +16305,14 @@
(sip->owner->_state == AST_STATE_UP) &&
!sip->redirip.sin_addr.s_addr &&
sip->t38.state != T38_ENABLED) {
+ t = time(NULL);
if (sip->lastrtptx &&
ast_rtp_get_rtpkeepalive(sip->rtp) &&
(t > sip->lastrtptx + ast_rtp_get_rtpkeepalive(sip->rtp))) {
/* Need to send an empty RTP packet */
sip->lastrtptx = time(NULL);
ast_rtp_sendcng(sip->rtp, 0);
+ t = time(NULL);
}
if (sip->lastrtprx &&
(ast_rtp_get_rtptimeout(sip->rtp) || ast_rtp_get_rtpholdtimeout(sip->rtp)) &&

View file

@ -0,0 +1,270 @@
Index: main/logger.c
===================================================================
--- main/logger.c (revision 188505)
+++ main/logger.c (working copy)
@@ -140,6 +140,17 @@
AST_THREADSTORAGE(log_buf, log_buf_init);
#define LOG_BUF_INIT_SIZE 128
+/*
+ * Storage for previous log message to prevent log storms
+ */
+static int stored_log_level;
+static int stored_log_dup_count = 0;
+static char *stored_log_msg = NULL;
+static const char *stored_log_file;
+static int stored_log_line;
+static const char *stored_log_function;
+static ast_mutex_t stored_log_msg_lock;
+
static int make_components(char *s, int lineno)
{
char *w;
@@ -591,6 +602,8 @@
char tmp[256];
int res = 0;
+ ast_mutex_init(&stored_log_msg_lock);
+
/* auto rotate if sig SIGXFSZ comes a-knockin */
(void) signal(SIGXFSZ,(void *) handle_SIGXFSZ);
@@ -655,14 +668,14 @@
return;
}
-static void __attribute__((format(printf, 5, 0))) ast_log_vsyslog(int level, const char *file, int line, const char *function, const char *fmt, va_list args)
+static void ast_log_syslog(int level, const char *file, int line, const char *function, const char *msg)
{
char buf[BUFSIZ];
char *s;
if (level >= SYSLOG_NLEVELS) {
/* we are locked here, so cannot ast_log() */
- fprintf(stderr, "ast_log_vsyslog called with bogus level: %d\n", level);
+ fprintf(stderr, "ast_log_syslog called with bogus level: %d\n", level);
return;
}
if (level == __LOG_VERBOSE) {
@@ -676,27 +689,20 @@
levels[level], (long)GETTID(), file, line, function);
}
s = buf + strlen(buf);
- vsnprintf(s, sizeof(buf) - strlen(buf), fmt, args);
+ snprintf(s, sizeof(buf) - strlen(buf), "%s", msg);
term_strip(s, s, strlen(s) + 1);
syslog(syslog_level_map[level], "%s", buf);
}
-/*!
- * \brief send log messages to syslog and/or the console
- */
-void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
+static void __ast_log(int level, const char *file, int line, const char *function, char *msg, int msglen)
{
struct logchannel *chan;
- struct ast_dynamic_str *buf;
time_t t;
struct tm tm;
char date[256];
+ char buf[2048];
+ int res;
- va_list ap;
-
- if (!(buf = ast_dynamic_str_thread_get(&log_buf, LOG_BUF_INIT_SIZE)))
- return;
-
if (AST_LIST_EMPTY(&logchannels))
{
/*
@@ -704,35 +710,12 @@
* so just log to stdout
*/
if (level != __LOG_VERBOSE) {
- int res;
- va_start(ap, fmt);
- res = ast_dynamic_str_thread_set_va(&buf, BUFSIZ, &log_buf, fmt, ap);
- va_end(ap);
- if (res != AST_DYNSTR_BUILD_FAILED) {
- term_filter_escapes(buf->str);
- fputs(buf->str, stdout);
- }
+ term_filter_escapes(msg);
+ fputs(msg, stdout);
}
return;
}
- /* don't display LOG_DEBUG messages unless option_verbose _or_ option_debug
- are non-zero; LOG_DEBUG messages can still be displayed if option_debug
- is zero, if option_verbose is non-zero (this allows for 'level zero'
- LOG_DEBUG messages to be displayed, if the logmask on any channel
- allows it)
- */
- if (!option_verbose && !option_debug && (level == __LOG_DEBUG))
- return;
-
- /* Ignore anything that never gets logged anywhere */
- if (!(global_logmask & (1 << level)))
- return;
-
- /* Ignore anything other than the currently debugged file if there is one */
- if ((level == __LOG_DEBUG) && !ast_strlen_zero(debug_filename) && strcasecmp(debug_filename, file))
- return;
-
time(&t);
ast_localtime(&t, &tm, NULL);
strftime(date, sizeof(date), dateformat, &tm);
@@ -740,13 +723,8 @@
AST_LIST_LOCK(&logchannels);
if (logfiles.event_log && level == __LOG_EVENT) {
- va_start(ap, fmt);
-
- fprintf(eventlog, "%s asterisk[%ld]: ", date, (long)getpid());
- vfprintf(eventlog, fmt, ap);
+ fprintf(eventlog, "%s asterisk[%ld]: %s", date, (long)getpid(), msg);
fflush(eventlog);
-
- va_end(ap);
AST_LIST_UNLOCK(&logchannels);
return;
}
@@ -756,18 +734,15 @@
break;
/* Check syslog channels */
if (chan->type == LOGTYPE_SYSLOG && (chan->logmask & (1 << level))) {
- va_start(ap, fmt);
- ast_log_vsyslog(level, file, line, function, fmt, ap);
- va_end(ap);
+ ast_log_syslog(level, file, line, function, msg);
/* Console channels */
} else if ((chan->logmask & (1 << level)) && (chan->type == LOGTYPE_CONSOLE)) {
char linestr[128];
char tmp1[80], tmp2[80], tmp3[80], tmp4[80];
if (level != __LOG_VERBOSE) {
- int res;
sprintf(linestr, "%d", line);
- ast_dynamic_str_thread_set(&buf, BUFSIZ, &log_buf,
+ snprintf(buf, sizeof(buf),
"[%s] %s[%ld]: %s:%s %s: ",
date,
term_color(tmp1, levels[level], colors[level], 0, sizeof(tmp1)),
@@ -776,23 +751,17 @@
term_color(tmp3, linestr, COLOR_BRWHITE, 0, sizeof(tmp3)),
term_color(tmp4, function, COLOR_BRWHITE, 0, sizeof(tmp4)));
/*filter to the console!*/
- term_filter_escapes(buf->str);
- ast_console_puts_mutable(buf->str);
-
- va_start(ap, fmt);
- res = ast_dynamic_str_thread_set_va(&buf, BUFSIZ, &log_buf, fmt, ap);
- va_end(ap);
- if (res != AST_DYNSTR_BUILD_FAILED)
- ast_console_puts_mutable(buf->str);
+ term_filter_escapes(buf);
+ ast_console_puts_mutable(buf);
+ ast_console_puts_mutable(msg);
}
/* File channels */
} else if ((chan->logmask & (1 << level)) && (chan->fileptr)) {
- int res;
- ast_dynamic_str_thread_set(&buf, BUFSIZ, &log_buf,
+ snprintf(buf, sizeof(buf),
"[%s] %s[%ld] %s: ",
date, levels[level], (long)GETTID(), file);
- res = fprintf(chan->fileptr, "%s", buf->str);
- if (res <= 0 && !ast_strlen_zero(buf->str)) { /* Error, no characters printed */
+ res = fprintf(chan->fileptr, "%s", buf);
+ if (res <= 0 && !ast_strlen_zero(buf)) { /* Error, no characters printed */
fprintf(stderr,"**** Asterisk Logging Error: ***********\n");
if (errno == ENOMEM || errno == ENOSPC) {
fprintf(stderr, "Asterisk logging error: Out of disk space, can't log to log file %s\n", chan->filename);
@@ -801,16 +770,10 @@
manager_event(EVENT_FLAG_SYSTEM, "LogChannel", "Channel: %s\r\nEnabled: No\r\nReason: %d - %s\r\n", chan->filename, errno, strerror(errno));
chan->disabled = 1;
} else {
- int res;
/* No error message, continue printing */
- va_start(ap, fmt);
- res = ast_dynamic_str_thread_set_va(&buf, BUFSIZ, &log_buf, fmt, ap);
- va_end(ap);
- if (res != AST_DYNSTR_BUILD_FAILED) {
- term_strip(buf->str, buf->str, buf->len);
- fputs(buf->str, chan->fileptr);
- fflush(chan->fileptr);
- }
+ term_strip(msg, msg, msglen);
+ fputs(msg, chan->fileptr);
+ fflush(chan->fileptr);
}
}
}
@@ -825,6 +788,65 @@
}
}
+/*!
+ * \brief send log messages to syslog and/or the console
+ */
+void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
+{
+ struct ast_dynamic_str *buf;
+ int res;
+ va_list ap;
+
+ if (!(buf = ast_dynamic_str_thread_get(&log_buf, LOG_BUF_INIT_SIZE)))
+ return;
+
+ va_start(ap, fmt);
+ res = ast_dynamic_str_thread_set_va(&buf, BUFSIZ, &log_buf, fmt, ap);
+ va_end(ap);
+ if (res == AST_DYNSTR_BUILD_FAILED)
+ return;
+
+ /* don't display LOG_DEBUG messages unless option_verbose _or_ option_debug
+ are non-zero; LOG_DEBUG messages can still be displayed if option_debug
+ is zero, if option_verbose is non-zero (this allows for 'level zero'
+ LOG_DEBUG messages to be displayed, if the logmask on any channel
+ allows it)
+ */
+ if (!option_verbose && !option_debug && (level == __LOG_DEBUG))
+ return;
+
+ /* Ignore anything that never gets logged anywhere */
+ if (!(global_logmask & (1 << level)))
+ return;
+
+ /* Ignore anything other than the currently debugged file if there is one */
+ if ((level == __LOG_DEBUG) && !ast_strlen_zero(debug_filename) && strcasecmp(debug_filename, file))
+ return;
+
+ ast_mutex_lock(&stored_log_msg_lock);
+ if (stored_log_msg == NULL || stored_log_level != level || strcmp(buf->str, stored_log_msg) != 0) {
+ if (stored_log_dup_count > 0) {
+ char buf2[1024];
+
+ snprintf(buf2, sizeof(buf2), "Last message repeated %d times\n", stored_log_dup_count);
+ __ast_log(stored_log_level, stored_log_file, stored_log_line, stored_log_function, buf2, strlen(buf2));
+ }
+ if (stored_log_msg != NULL)
+ ast_free(stored_log_msg);
+ stored_log_msg = ast_strdup(buf->str);
+ stored_log_level = level;
+ stored_log_dup_count = 0;
+ stored_log_file = file;
+ stored_log_line = line;
+ stored_log_function = function;
+ __ast_log(level, file, line, function, buf->str, buf->len);
+ }
+ else
+ ++stored_log_dup_count;
+
+ ast_mutex_unlock(&stored_log_msg_lock);
+}
+
void ast_backtrace(void)
{
#ifdef linux

View file

@ -0,0 +1,86 @@
--- channels/chan_sip.c.orig 2009-11-20 17:56:30.000000000 +0200
+++ channels/chan_sip.c 2009-11-20 17:59:43.000000000 +0200
@@ -565,6 +565,9 @@
static unsigned int global_tos_sip; /*!< IP type of service for SIP packets */
static unsigned int global_tos_audio; /*!< IP type of service for audio RTP packets */
static unsigned int global_tos_video; /*!< IP type of service for video RTP packets */
+static int global_force_dtmf_relay = 0;
+static int global_force_dtmf_relay_pt = 101;
+
static int compactheaders; /*!< send compact sip headers */
static int recordhistory; /*!< Record SIP history. Off by default */
static int dumphistory; /*!< Dump history to verbose before destroying SIP dialog */
@@ -5329,6 +5332,7 @@
int x;
int codec_index = 0;
int codec_pt_order[256];
+ int dtmf_present = 0;
/* Host information */
struct ast_hostent audiohp;
@@ -5600,12 +5604,21 @@
for (x = 0; x < codec_index; ++x) {
struct rtpPayloadType pt;
pt = ast_rtp_lookup_pt(p->rtp, codec_pt_order[x]);
+ if (pt.code == AST_RTP_DTMF)
+ dtmf_present = 1;
if (!pt.isAstFormat && !pt.code && p->vrtp)
pt = ast_rtp_lookup_pt(p->vrtp, codec_pt_order[x]);
if (pt.isAstFormat)
ast_codec_pref_append(&p->formats, pt.code);
}
ast_codec_pref_remove2(&p->formats, ~p->usercapability);
+ if (!dtmf_present && global_force_dtmf_relay) {
+ newnoncodeccapability |= AST_RTP_DTMF;
+ ast_rtp_set_m_type(newaudiortp, global_force_dtmf_relay_pt);
+ codec_pt_order[codec_index++] = global_force_dtmf_relay_pt;
+ ast_rtp_set_rtpmap_type(newaudiortp, global_force_dtmf_relay_pt, "audio", "telephone-event", 0);
+ }
+
/* Now gather all of the codecs that we are asked for: */
ast_rtp_get_current_formats(newaudiortp, &peercapability, &peernoncodeccapability);
@@ -18369,6 +18382,9 @@
global_matchexterniplocally = FALSE;
+ global_force_dtmf_relay = 0;
+ global_force_dtmf_relay_pt = 101;
+
/* Copy the default jb config over global_jbconf */
memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
@@ -18431,6 +18447,18 @@
}
} else if (!strcasecmp(v->name, "vmexten")) {
ast_copy_string(default_vmexten, v->value, sizeof(default_vmexten));
+ } else if (!strcasecmp(v->name, "rtp_force_dtmf_relay")) {
+ if ((global_force_dtmf_relay = ast_true(v->value)))
+ ast_verbose("RTP DTMF relaying will be enforced\n");
+ else
+ ast_verbose("RTP DTMF relaying will not be enforced\n");
+ } else if (!strcasecmp(v->name, "rtp_force_dtmf_relay_pt")) {
+ sscanf(v->value, "%d", &global_force_dtmf_relay_pt);
+ if (global_force_dtmf_relay_pt < 96 || global_force_dtmf_relay_pt > 255) {
+ ast_verbose("RTP forced DTMF relay payload type is not valid: %d. Using default (101)\n", global_force_dtmf_relay_pt);
+ global_force_dtmf_relay_pt = 101;
+ } else
+ ast_log(LOG_WARNING, "RTP forced DTMF relay payload type is %d\n", global_force_dtmf_relay_pt);
} else if (!strcasecmp(v->name, "rtptimeout")) {
if ((sscanf(v->value, "%30d", &global_rtptimeout) != 1) || (global_rtptimeout < 0)) {
ast_log(LOG_WARNING, "'%s' is not a valid RTP hold time at line %d. Using default.\n", v->value, v->lineno);
--- configs/sip.conf.sample.orig 2008-04-25 08:53:52.000000000 -0700
+++ configs/sip.conf.sample 2008-06-10 00:45:37.000000000 -0700
@@ -53,6 +53,12 @@
; and multiline formatted headers for strict
; SIP compatibility (defaults to "no")
+;rtp_force_dtmf_relay=no ; Enable RFC2833 DTMFs to be sent even if peer
+ ; hasn't announced support for it. Default: no
+
+;rtp_force_dtmf_relay_pt=101 ; RTP payload type value for enforced RFC2833
+ ; DTMFs. Default: 101
+
; See doc/ip-tos.txt for a description of these parameters.
;tos_sip=cs3 ; Sets TOS for SIP packets.
;tos_audio=ef ; Sets TOS for RTP audio packets.

View file

@ -0,0 +1,69 @@
--- channels/chan_sip.c.orig 2009-11-23 17:28:47.000000000 +0200
+++ channels/chan_sip.c 2009-11-23 17:29:29.000000000 +0200
@@ -565,6 +565,9 @@
static unsigned int global_tos_sip; /*!< IP type of service for SIP packets */
static unsigned int global_tos_audio; /*!< IP type of service for audio RTP packets */
static unsigned int global_tos_video; /*!< IP type of service for video RTP packets */
+static int global_force_dtmf_relay = 0;
+static int global_force_dtmf_relay_pt = 101;
+
static int compactheaders; /*!< send compact sip headers */
static int recordhistory; /*!< Record SIP history. Off by default */
static int dumphistory; /*!< Dump history to verbose before destroying SIP dialog */
@@ -5593,6 +5596,12 @@
/* Now gather all of the codecs that we are asked for: */
ast_rtp_get_current_formats(newaudiortp, &peercapability, &peernoncodeccapability);
+ /* Add telephone-event */
+ if (global_force_dtmf_relay && !(peernoncodeccapability & AST_RTP_DTMF)) {
+ ast_rtp_set_m_type(newaudiortp, global_force_dtmf_relay_pt);
+ ast_rtp_set_rtpmap_type(newaudiortp, global_force_dtmf_relay_pt, "audio", "telephone-event", 0);
+ peernoncodeccapability |= AST_RTP_DTMF;
+ }
ast_rtp_get_current_formats(newvideortp, &vpeercapability, &vpeernoncodeccapability);
newjointcapability = p->capability & (peercapability | vpeercapability);
@@ -18366,6 +18375,9 @@
global_matchexterniplocally = FALSE;
+ global_force_dtmf_relay = 0;
+ global_force_dtmf_relay_pt = 101;
+
/* Copy the default jb config over global_jbconf */
memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
@@ -18428,6 +18440,18 @@
}
} else if (!strcasecmp(v->name, "vmexten")) {
ast_copy_string(default_vmexten, v->value, sizeof(default_vmexten));
+ } else if (!strcasecmp(v->name, "rtp_force_dtmf_relay")) {
+ if ((global_force_dtmf_relay = ast_true(v->value)))
+ ast_verbose("RTP DTMF relaying will be enforced\n");
+ else
+ ast_verbose("RTP DTMF relaying will not be enforced\n");
+ } else if (!strcasecmp(v->name, "rtp_force_dtmf_relay_pt")) {
+ sscanf(v->value, "%d", &global_force_dtmf_relay_pt);
+ if (global_force_dtmf_relay_pt < 96 || global_force_dtmf_relay_pt > 255) {
+ ast_verbose("RTP forced DTMF relay payload type is not valid: %d. Using default (101)\n", global_force_dtmf_relay_pt);
+ global_force_dtmf_relay_pt = 101;
+ } else
+ ast_log(LOG_WARNING, "RTP forced DTMF relay payload type is %d\n", global_force_dtmf_relay_pt);
} else if (!strcasecmp(v->name, "rtptimeout")) {
if ((sscanf(v->value, "%30d", &global_rtptimeout) != 1) || (global_rtptimeout < 0)) {
ast_log(LOG_WARNING, "'%s' is not a valid RTP hold time at line %d. Using default.\n", v->value, v->lineno);
--- configs/sip.conf.sample.orig 2008-08-16 01:33:42.000000000 +0300
+++ configs/sip.conf.sample 2008-12-12 17:03:11.000000000 +0200
@@ -49,6 +49,12 @@
; and multiline formatted headers for strict
; SIP compatibility (defaults to "no")
+;rtp_force_dtmf_relay=no ; Enable RFC2833 DTMFs to be sent even if peer
+ ; hasn't announced support for it. Default: no
+
+;rtp_force_dtmf_relay_pt=101 ; RTP payload type value for enforced RFC2833
+ ; DTMFs. Default: 101
+
; See doc/ip-tos.txt for a description of these parameters.
;tos_sip=cs3 ; Sets TOS for SIP packets.
;tos_audio=ef ; Sets TOS for RTP audio packets.

View file

@ -0,0 +1,11 @@
--- channels/chan_sip.c.orig 2009-05-12 21:18:44.000000000 +0300
+++ channels/chan_sip.c 2009-05-26 12:58:10.000000000 +0300
@@ -3061,6 +3061,8 @@
} else if (!strcasecmp(ast_var_name(current), "SIPTRANSFER_REPLACES")) {
/* We're replacing a call. */
p->options->replaces = ast_var_value(current);
+ } else if (!strcasecmp(ast_var_name(current), "SIP_FORCE_CALLID")) {
+ ast_string_field_set(p, callid, ast_var_value(current));
}
}

View file

@ -0,0 +1,45 @@
--- channels/chan_sip.c.orig 2008-04-29 08:21:05.000000000 -0400
+++ channels/chan_sip.c 2008-05-28 18:41:48.000000000 -0400
@@ -15962,6 +15978,9 @@
char *ext, *host;
char tmp[256];
char *dest = data;
+ char *secret = NULL;
+ char *md5secret = NULL;
+ char *authname = NULL;
if (!(p = sip_alloc(NULL, NULL, 0, SIP_INVITE))) {
ast_log(LOG_ERROR, "Unable to build sip pvt data for '%s' (Out of memory or socket error)\n", (char *)data);
@@ -15983,6 +16002,17 @@
if (host) {
*host++ = '\0';
ext = tmp;
+ secret = strchr(ext, ':');
+ if (secret) {
+ *secret++ = '\0';
+ md5secret = strchr(secret, ':');
+ if (md5secret) {
+ *md5secret++ = '\0';
+ authname = strchr(md5secret, ':');
+ if (authname)
+ *authname++ = '\0';
+ }
+ }
} else {
ext = strchr(tmp, '/');
if (ext)
@@ -16015,6 +16045,14 @@
ast_string_field_set(p, username, ext);
ast_string_field_free(p, fullcontact);
}
+ if (secret && !ast_strlen_zero(secret))
+ ast_string_field_set(p, peersecret, secret);
+
+ if (md5secret && !ast_strlen_zero(md5secret))
+ ast_string_field_set(p, peermd5secret, md5secret);
+
+ if (authname && !ast_strlen_zero(authname))
+ ast_string_field_set(p, authname, authname);
#if 0
printf("Setting up to call extension '%s' at '%s'\n", ext ? ext : "<none>", host);
#endif

5
net/asterisk/pkg-descr Normal file
View file

@ -0,0 +1,5 @@
Asterisk is an Open Source PBX and telephony toolkit. It is, in a
sense, middleware between Internet and telephony channels on the bottom,
and Internet and telephony applications at the top.
WWW: http://www.asteriskpbx.com

1616
net/asterisk/pkg-plist Normal file

File diff suppressed because it is too large Load diff

244
net/asterisk10/Makefile Normal file
View file

@ -0,0 +1,244 @@
# New ports collection makefile for: asterisk
# Date created: 17 October 2003
# Whom: Maxim Sobolev <sobomax@portaone.com>
#
# $FreeBSD$
#
PORTNAME= asterisk
PORTVERSION= 1.8.0
CATEGORIES= net
MASTER_SITES= http://downloads.asterisk.org/pub/telephony/asterisk/ \
http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/
PKGNAMESUFFIX= 18
MAINTAINER= flo@smeets.im
COMMENT= An Open Source PBX and telephony toolkit
LIB_DEPENDS= speex.1:${PORTSDIR}/audio/speex \
newt.52:${PORTSDIR}/devel/newt \
execinfo:${PORTSDIR}/devel/libexecinfo
RUN_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
ONLY_FOR_ARCHS= i386 amd64 sparc64
GNU_CONFIGURE= yes
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -I${LOCALBASE}/include/openh323" \
LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ARGS= --with-gsm=${LOCALBASE} --localstatedir=/var
CPPFLAGS= -I${LOCALBASE}/include -I${LOCALBASE}/include/openh323
USE_GMAKE= yes
USE_GNOME= libxml2
USE_BISON= build
USE_RC_SUBR= asterisk.sh
MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
PTHREAD_LIBS="${PTHREAD_LIBS}" \
MKDIR="${MKDIR}" \
PWLIBDIR=${LOCALBASE}/share/pwlib \
OPENH323DIR=${LOCALBASE}/share/openh323 \
OSVERSION=${OSVERSION} \
NOISY_BUILD=YES \
DOCSDIR=${DOCSDIR} \
ASTCFLAGS="${CFLAGS}"
MAN8= asterisk.8 astgenkey.8 autosupport.8 safe_asterisk.8
CONFLICTS= asterisk*-1.2* asterisk*-1.4* asterisk*-1.6*
OPTIONS= OGGVORBIS "Enable Ogg Vorbis support" on \
ODBC "Enable ODBC support" on \
POSTGRES "Enable PostgreSQL support" on \
RADIUS "Enable RADIUS accounting support" on \
SNMP "Enable SNMP support" on \
H323 "Enable H.323 support" on \
FREETDS "Enable FreeTDS support" on \
JABBER "Enable Jabber and Gtalk support" on \
SQLITE "Enable SQLITE support" on \
GSM "Enable GSM codec" on \
CURL "Enable CURL support" on \
ILBC "Enable iLBC codec" off \
SPANDSP "Enable Spandsp faxing support" off \
EXCHANGE "Enable Exchange calendar support" off
ASTERISK_USER?= asterisk
ASTERISK_GROUP?= asterisk
USERS= ${ASTERISK_USER}
GROUPS= ${ASTERISK_GROUP} dahdi
.include <bsd.port.pre.mk>
.if ${ARCH} == "i386" || ${ARCH} == "amd64"
OPTIONS+= DAHDI "Enable DAHDI support" on
# Include this since we have altered OPTIONS.
.include <bsd.port.options.mk>
.endif
SUB_LIST+= ASTERISK_USER=${ASTERISK_USER}
PLIST_SUB+= ASTERISK_USER=${ASTERISK_USER}
PLIST_SUB+= ASTERISK_GROUP=${ASTERISK_GROUP}
.if !defined(WITH_H323)
PLIST_SUB+= WITH_H323="@comment "
CONFIGURE_ARGS+= --without-h323
.else
PLIST_SUB+= WITH_H323=""
CONFIGURE_ARGS+= --with-h323=${LOCALBASE}
LIB_DEPENDS+= pt_r.1:${PORTSDIR}/devel/pwlib \
h323_r.1:${PORTSDIR}/net/openh323
.endif
.if !defined(WITH_DAHDI)
PLIST_SUB+= WITH_DAHDI="@comment "
CONFIGURE_ARGS+= --without-dahdi
.else
PLIST_SUB+= WITH_DAHDI=""
CONFIGURE_ARGS+= --with-dahdi
BUILD_DEPENDS+= libpri>=1.4.10:${PORTSDIR}/misc/libpri \
${LOCALBASE}/include/dahdi/user.h:${PORTSDIR}/misc/dahdi
LIB_DEPENDS+= pri.1:${PORTSDIR}/misc/libpri
RUN_DEPENDS+= ${LOCALBASE}/lib/dahdi/dahdi.ko:${PORTSDIR}/misc/dahdi
.endif
#
# WITH_FREETDS, WITH_PGSQL and WITH_SQLITE can also be added to MAKE_ENV
# similarly
.if !defined(WITH_ODBC)
PLIST_SUB+= WITH_ODBC="@comment "
CONFIGURE_ARGS+= --without-unixodbc
.else
PLIST_SUB+= WITH_ODBC=""
CONFIGURE_ARGS+= --with-unixodbc --with-ltdl
LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
USE_AUTOTOOLS= libltdl
.endif
.if !defined(WITH_FREETDS)
PLIST_SUB+= WITH_FREETDS="@comment "
CONFIGURE_ARGS+= --without-tds
.else
PLIST_SUB+= WITH_FREETDS=""
CONFIGURE_ARGS+= --with-tds=${LOCALBASE}
LIB_DEPENDS+= tds.5:${PORTSDIR}/databases/freetds
.endif
.if !defined(WITH_POSTGRES)
PLIST_SUB+= WITH_POSTGRES="@comment "
CONFIGURE_ARGS+= --without-postgres
.else
PLIST_SUB+= WITH_POSTGRES=""
USE_PGSQL= yes
CONFIGURE_ARGS+= --with-postgres
.endif
.if !defined(WITH_OGGVORBIS)
PLIST_SUB+= WITH_OGGVORBIS="@comment "
CONFIGURE_ARGS+= --without-ogg
.else
PLIST_SUB+= WITH_OGGVORBIS=""
CONFIGURE_ARGS+= --with-ogg
LIB_DEPENDS+= vorbis.4:${PORTSDIR}/audio/libvorbis
.endif
.if !defined(WITH_RADIUS)
PLIST_SUB+= WITH_RADIUS="@comment "
CONFIGURE_ARGS+= --without-radius
.else
PLIST_SUB+= WITH_RADIUS=""
CONFIGURE_ARGS+= --with-radius
LIB_DEPENDS+= radiusclient-ng.2:${PORTSDIR}/net/radiusclient
.endif
.if !defined(WITH_SNMP)
PLIST_SUB+= WITH_SNMP="@comment "
CONFIGURE_ARGS+= --without-netsnmp
.else
PLIST_SUB+= WITH_SNMP=""
CONFIGURE_ARGS+= --with-netsnmp
LIB_DEPENDS+= netsnmp:${PORTSDIR}/net-mgmt/net-snmp
.endif
.if !defined(WITH_JABBER)
PLIST_SUB+= WITH_JABBER="@comment "
CONFIGURE_ARGS+= --without-iksemel
.else
PLIST_SUB+= WITH_JABBER=""
CONFIGURE_ARGS+= --with-iksemel
LIB_DEPENDS+= iksemel.4:${PORTSDIR}/textproc/iksemel
.endif
.if !defined(WITH_SQLITE)
PLIST_SUB+= WITH_SQLITE="@comment "
CONFIGURE_ARGS+= --without-sqlite \
--with-sqlite3=no
.else
PLIST_SUB+= WITH_SQLITE=""
CONFIGURE_ARGS+= --with-sqlite
LIB_DEPENDS+= sqlite:${PORTSDIR}/databases/sqlite2 \
sqlite3:${PORTSDIR}/databases/sqlite3
.endif
.if !defined(WITH_ILBC)
PLIST_SUB+= WITH_ILBC="@comment "
.else
PLIST_SUB+= WITH_ILBC=""
EXTRA_PATCHES+= ${PATCHDIR}/ilbc_enable.diff
.endif
.if !defined(WITH_GSM)
PLIST_SUB+= WITH_GSM="@comment "
CONFIGURE_ARGS+= --without-gsm
.else
PLIST_SUB+= WITH_GSM=""
CONFIGURE_ARGS+= --with-gsm
LIB_DEPENDS+= gsm.1:${PORTSDIR}/audio/gsm
.endif
.if !defined(WITH_CURL)
PLIST_SUB+= WITH_CURL="@comment "
CONFIGURE_ARGS+= --with-libcurl=no
.else
PLIST_SUB+= WITH_CURL=""
CONFIGURE_ARGS+= --with-libcurl
LIB_DEPENDS+= curl.6:${PORTSDIR}/ftp/curl
.endif
.if !defined(WITH_SPANDSP)
PLIST_SUB+= WITH_SPANDSP="@comment "
CONFIGURE_ARGS+= --without-spandsp
.else
PLIST_SUB+= WITH_SPANDSP=""
CONFIGURE_ARGS+= --with-spandsp
LIB_DEPENDS+= spandsp.2:${PORTSDIR}/comms/spandsp-devel
.endif
.if !defined(WITH_EXCHANGE)
CONFIGURE_ARGS+= --without-neon --without-neon29
PLIST_SUB+= WITH_EXCHANGE="@comment "
.else
LIB_DEPENDS+= neon.27:${PORTSDIR}/www/neon29
PLIST_SUB+= WITH_EXCHANGE=""
.endif
.if defined(WITH_MISC_PATCHES)
EXTRA_PATCHES+= ${PATCHDIR}/dtmf_debug.diff
EXTRA_PATCHES+= ${PATCHDIR}/feature_disconnect.diff
EXTRA_PATCHES+= ${PATCHDIR}/sip_force_callid.diff
EXTRA_PATCHES+= ${PATCHDIR}/sip_set_auth.diff
.if defined(WITH_CODEC_PATCH)
EXTRA_PATCHES+= ${PATCHDIR}/rtp_force_dtmf-codecnego.diff
.else
EXTRA_PATCHES+= ${PATCHDIR}/rtp_force_dtmf-nocodecnego.diff
.endif
.endif
post-extract:
${MKDIR} ${WRKSRC}/codecs/ilbc
${FIND} ${WRKSRC} -name '*.d' -delete
post-patch:
${REINPLACE_CMD} -e 's|/var/lib|${PREFIX}/share|g' ${WRKSRC}/configs/musiconhold.conf.sample
post-install:
@${CHOWN} -R ${ASTERISK_USER}:${ASTERISK_GROUP} /var/db/asterisk /var/log/asterisk /var/spool/asterisk
.include <bsd.port.post.mk>

2
net/asterisk10/distinfo Normal file
View file

@ -0,0 +1,2 @@
SHA256 (asterisk-1.8.0.tar.gz) = 8f1edbc8fab23596a6f6ee2881d67c22b4a6cb20bfad84125fcdcb3ff2e1de1b
SIZE (asterisk-1.8.0.tar.gz) = 26035124

View file

@ -0,0 +1,34 @@
#!/bin/sh
# PROVIDE: asterisk
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable asterisk:
#
# asterisk_enable="YES"
#
. /etc/rc.subr
stop_cmd=asterisk_shutdown
asterisk_shutdown () {
echo 'Stopping asterisk'
%%PREFIX%%/sbin/asterisk -nqrx 'core stop now'
sleep 1
return 0
}
name=asterisk
rcvar=`set_rcvar`
command=%%PREFIX%%/sbin/asterisk
command_args="-n -U %%ASTERISK_USER%%"
load_rc_config $name
pidfile=${asterisk_pidfile:-"/var/run/asterisk.pid"}
asterisk_enable=${asterisk_enable:-"NO"}
run_rc_command "$1"

View file

@ -0,0 +1,219 @@
--- Makefile.orig 2009-11-20 17:48:05.000000000 +0200
+++ Makefile 2009-11-20 17:50:33.000000000 +0200
@@ -101,7 +101,7 @@
OVERWRITE=y
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
-DEBUG=-g3
+#DEBUG=-g3
# Staging directory
# Files are copied here temporarily during the install process
@@ -135,7 +135,7 @@
ASTMANDIR=$(mandir)
ifneq ($(findstring BSD,$(OSARCH)),)
ASTVARLIBDIR=$(prefix)/share/asterisk
- ASTVARRUNDIR=$(localstatedir)/run/asterisk
+ ASTVARRUNDIR=$(localstatedir)/run
else
ASTVARLIBDIR=$(localstatedir)/lib/asterisk
endif
@@ -225,9 +225,11 @@
_ASTLDFLAGS+=-L/usr/local/lib
endif
+ifneq ($(OSARCH),FreeBSD)
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)
endif
+endif
ifeq ($(PROC),ppc)
_ASTCFLAGS+=-fsigned-char
@@ -235,7 +237,7 @@
ifeq ($(OSARCH),FreeBSD)
# -V is understood by BSD Make, not by GNU make.
- BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
+ BSDVERSION=$(OSVERSION)
_ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
AST_LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
endif
@@ -416,15 +418,15 @@
# Should static HTTP be installed during make samples or even with its own target ala
# webvoicemail? There are portions here that *could* be customized but might also be
# improved a lot. I'll put it here for now.
- mkdir -p $(DESTDIR)$(ASTDATADIR)/static-http
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/static-http
for x in static-http/*; do \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
done
- mkdir -p $(DESTDIR)$(ASTDATADIR)/images
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/images
for x in images/*.jpg; do \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/images ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTDATADIR)/images ; \
done
- mkdir -p $(DESTDIR)$(AGI_DIR)
+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
$(MAKE) -C sounds install
update:
@@ -445,47 +447,47 @@
OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
installdirs:
- 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
+ $(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
bininstall: _all installdirs $(SUBDIRS_INSTALL)
- $(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
+ $(BSD_INSTALL_PROGRAM) main/asterisk $(DESTDIR)$(ASTSBINDIR)/
$(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)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
- chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
+ cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/scripts/safe_asterisk.out;\
+ ${BSD_INSTALL_SCRIPT} contrib/scripts/safe_asterisk.out $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
fi
- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
- $(INSTALL) -m 644 include/asterisk.h $(DESTDIR)$(includedir)
- $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR)
+ $(BSD_INSTALL_DATA) include/asterisk.h $(DESTDIR)$(includedir)
+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
if [ -n "$(OLDHEADERS)" ]; then \
rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
fi
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
- mkdir -p $(DESTDIR)$(ASTDATADIR)/keys
- mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware
- mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware/iax
- mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
- $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
- $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
- $(INSTALL) -m 644 doc/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)$(ASTLOGDIR)/cdr-csv
+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-custom
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/keys
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/firmware
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/firmware/iax
+ $(MKDIR) $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
+ $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
+ $(BSD_INSTALL_MAN) doc/asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_MAN) contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_MAN) contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_MAN) contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
if [ -f contrib/firmware/iax/iaxy.bin ] ; then \
- $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
+ $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
fi
$(SUBDIRS_INSTALL):
@@ -521,7 +523,7 @@
@exit 1
endif
-install: badshell datafiles bininstall
+install: badshell datafiles bininstall samples
@if [ -x /usr/sbin/asterisk-post-install ]; then \
/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
fi
@@ -559,31 +561,23 @@
upgrade: bininstall
adsi:
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.adsi; do \
if [ ! -f $(DESTDIR)$(ASTETCDIR)/$$x ]; then \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
fi ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`-dist ; \
done
samples: adsi
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.sample; do \
- if [ -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
- if [ "$(OVERWRITE)" = "y" ]; then \
- if cmp -s $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $$x ; then \
- echo "Config file $$x is unchanged"; \
- continue; \
- fi ; \
- mv -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`.old ; \
- else \
- echo "Skipping config file $$x"; \
- continue; \
- fi ;\
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`-dist ;\
+ if [ ! -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`;\
fi ; \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ;\
done
- if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ if true; then \
( \
echo "[directories]" ; \
echo "astetcdir => $(ASTETCDIR)" ; \
@@ -670,20 +664,23 @@
echo "; Default: strict"; \
echo ";"; \
echo ";translation_algorithm = strict"; \
- ) > $(DESTDIR)$(ASTCONFPATH) ; \
+ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \
+ if [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ cp $(DESTDIR)$(ASTCONFPATH)-dist $(DESTDIR)$(ASTCONFPATH); \
+ fi; \
else \
echo "Skipping asterisk.conf creation"; \
fi
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
webvmail:
@[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
@[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
$(INSTALL) -m 4755 -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 " + +"

View file

@ -0,0 +1,226 @@
--- channels/chan_sip.c.orig 2009-05-12 21:18:44.000000000 +0300
+++ channels/chan_sip.c 2009-05-26 12:50:22.000000000 +0300
@@ -3891,6 +3891,7 @@
ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, p->owner);
else {
p->owner = newchan;
+ ast_rtp_set_chan_name(p->rtp, newchan->name);
/* Re-invite RTP back to Asterisk. Needed if channel is masqueraded out of a native
RTP bridge (i.e., RTP not going through Asterisk): RTP bridge code might not be
able to do this if the masquerade happens before the bridge breaks (e.g., AMI
@@ -4168,6 +4169,7 @@
if (i->rtp) {
tmp->fds[0] = ast_rtp_fd(i->rtp);
tmp->fds[1] = ast_rtcp_fd(i->rtp);
+ ast_rtp_set_chan_id(i->rtp, i->callid);
}
if (needvideo && i->vrtp) {
tmp->fds[2] = ast_rtp_fd(i->vrtp);
@@ -4195,6 +4197,8 @@
if (!ast_strlen_zero(i->language))
ast_string_field_set(tmp, language, i->language);
i->owner = tmp;
+ ast_rtp_set_chan_name(i->rtp, tmp->name);
+
ast_module_ref(ast_module_info->self);
ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
/*Since it is valid to have extensions in the dialplan that have unescaped characters in them
@@ -4621,8 +4625,10 @@
build_via(p);
if (!callid)
build_callid_pvt(p);
- else
+ else {
ast_string_field_set(p, callid, callid);
+ ast_rtp_set_chan_id(p->rtp, p->callid);
+ }
/* Assign default music on hold class */
ast_string_field_set(p, mohinterpret, default_mohinterpret);
ast_string_field_set(p, mohsuggest, default_mohsuggest);
--- include/asterisk/rtp.h.orig 2008-03-04 20:05:28.000000000 +0200
+++ include/asterisk/rtp.h 2009-05-26 12:50:22.000000000 +0300
@@ -243,6 +243,9 @@
int ast_rtp_codec_getformat(int pt);
+void ast_rtp_set_chan_name(struct ast_rtp *, const char *);
+void ast_rtp_set_chan_id(struct ast_rtp *, const char *);
+
/*! \brief Set rtp timeout */
void ast_rtp_set_rtptimeout(struct ast_rtp *rtp, int timeout);
/*! \brief Set rtp hold timeout */
--- main/rtp.c.orig 2009-11-20 17:51:49.000000000 +0200
+++ main/rtp.c 2009-11-20 17:53:11.000000000 +0200
@@ -81,6 +81,7 @@
static int rtpstart; /*!< First port for RTP sessions (set in rtp.conf) */
static int rtpend; /*!< Last port for RTP sessions (set in rtp.conf) */
static int rtpdebug; /*!< Are we debugging? */
+static int rtpdebugdtmf; /*!< Are we debugging DTMFs? */
static int rtcpdebug; /*!< Are we debugging RTCP? */
static int rtcpstats; /*!< Are we debugging RTCP? */
static int rtcpinterval = RTCP_DEFAULT_INTERVALMS; /*!< Time between rtcp reports in millisecs */
@@ -170,6 +171,8 @@
struct ast_rtp *bridged; /*!< Who we are Packet bridged to */
int set_marker_bit:1; /*!< Whether to set the marker bit or not */
unsigned int constantssrc:1;
+ char chan_name[100];
+ char chan_id[100];
};
/* Forward declarations */
@@ -676,8 +679,8 @@
struct ast_frame *f = NULL;
event = ntohl(*((unsigned int *)(data)));
event &= 0x001F;
- if (option_debug > 2 || rtpdebug)
- ast_log(LOG_DEBUG, "Cisco DTMF Digit: %08x (len = %d)\n", event, len);
+ if (option_debug > 2 || rtpdebug || rtpdebugdtmf)
+ ast_log(LOG_DEBUG, "Channel: %s %s Cisco DTMF packet: %08x (len = %d)\n", rtp->chan_name, rtp->chan_id, event, len);
if (event < 10) {
resp = '0' + event;
} else if (event < 11) {
@@ -691,12 +694,25 @@
}
if (rtp->resp && (rtp->resp != resp)) {
f = send_dtmf(rtp, AST_FRAME_DTMF_END);
+ ast_log(LOG_DEBUG, "Channel: %s %s Cisco DTMF event: %c\n", rtp->chan_name, rtp->chan_id, rtp->resp);
}
rtp->resp = resp;
rtp->dtmf_timeout = 0;
return f;
}
+void ast_rtp_set_chan_id(struct ast_rtp *rtp, const char *chan_id) {
+ if (rtp == NULL || chan_id == NULL)
+ return;
+ snprintf(rtp->chan_id, sizeof(rtp->chan_id), "%s", chan_id);
+}
+
+void ast_rtp_set_chan_name(struct ast_rtp *rtp, const char *chan_name) {
+ if (rtp == NULL || chan_name == NULL)
+ return;
+ snprintf(rtp->chan_name, sizeof(rtp->chan_name), "%s", chan_name);
+}
+
/*!
* \brief Process RTP DTMF and events according to RFC 2833.
*
@@ -1101,6 +1117,10 @@
struct rtpPayloadType rtpPT;
int reconstruct = ntohl(rtpheader[0]);
+ /* If we are listening for DTMF - then feed all packets into the core to keep the RTP stream consistent when relaying DTMFs */
+ if (ast_test_flag(rtp, FLAG_P2P_NEED_DTMF))
+ return -1;
+
/* Get fields from packet */
payload = (reconstruct & 0x7f0000) >> 16;
mark = (((reconstruct & 0x800000) >> 23) != 0);
@@ -1108,10 +1128,6 @@
/* Check what the payload value should be */
rtpPT = ast_rtp_lookup_pt(rtp, payload);
- /* If the payload is DTMF, and we are listening for DTMF - then feed it into the core */
- if (ast_test_flag(rtp, FLAG_P2P_NEED_DTMF) && !rtpPT.isAstFormat && rtpPT.code == AST_RTP_DTMF)
- return -1;
-
/* Otherwise adjust bridged payload to match */
bridged_payload = ast_rtp_lookup_code(bridged, rtpPT.isAstFormat, rtpPT.code);
@@ -1306,11 +1322,12 @@
/* This is special in-band data that's not one of our codecs */
if (rtpPT.code == AST_RTP_DTMF) {
/* It's special -- rfc2833 process it */
- if (rtp_debug_test_addr(&sin)) {
+ if (rtp_debug_test_addr(&sin) || rtpdebugdtmf) {
unsigned char *data;
unsigned int event;
unsigned int event_end;
unsigned int duration;
+
data = rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen;
event = ntohl(*((unsigned int *)(data)));
event >>= 24;
@@ -1319,9 +1336,12 @@
event_end >>= 24;
duration = ntohl(*((unsigned int *)(data)));
duration &= 0xFFFF;
- ast_verbose("Got RTP RFC2833 from %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u, mark %d, event %08x, end %d, duration %-5.5d) \n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), payloadtype, seqno, timestamp, res - hdrlen, (mark?1:0), event, ((event_end & 0x80)?1:0), duration);
+
+ ast_verbose("Channel: %s %s Got RTP RFC2833 from %s:%u to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u, mark %d, event %08x, end %d, duration %-5.5d)\n", rtp->chan_name, rtp->chan_id, ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), ast_inet_ntoa(rtp->us.sin_addr), ntohs(rtp->us.sin_port), payloadtype, seqno, timestamp, res - hdrlen, (mark?1:0), event, ((event_end & 0x80)?1:0), duration);
}
f = process_rfc2833(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen, seqno, timestamp);
+ if (rtpdebugdtmf && f)
+ ast_verbose("Channel: %s %s Got RFC2833 DTMF event %c of type %s\n", rtp->chan_name, rtp->chan_id, f->subclass, (f->frametype == AST_FRAME_DTMF_BEGIN ? "DTMF BEGIN" : (f->frametype == AST_FRAME_DTMF_END ? "DTMF_END" : "UNKNOWN")));
} else if (rtpPT.code == AST_RTP_CISCO_DTMF) {
/* It's really special -- process it the Cisco way */
if (rtp->lastevent <= seqno || (rtp->lastevent >= 65530 && seqno <= 6)) {
@@ -2287,8 +2307,9 @@
ast_log(LOG_ERROR, "RTP Transmission error to %s:%u: %s\n",
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), strerror(errno));
- if (rtp_debug_test_addr(&rtp->them))
- ast_verbose("Sent RTP DTMF packet to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
+ if (rtp_debug_test_addr(&rtp->them) || rtpdebugdtmf)
+ ast_verbose("Channel: %s %s Sent RTP DTMF packet to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
+ rtp->chan_name, rtp->chan_id,
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
/* Increment sequence number */
@@ -2331,8 +2352,9 @@
ast_log(LOG_ERROR, "RTP Transmission error to %s:%d: %s\n",
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), strerror(errno));
- if (rtp_debug_test_addr(&rtp->them))
- ast_verbose("Sent RTP DTMF packet to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
+ if (rtp_debug_test_addr(&rtp->them) || rtpdebugdtmf)
+ ast_verbose("Channel: %s %s Sent RTP DTMF packet to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
+ rtp->chan_name, rtp->chan_id,
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), rtp->send_payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
@@ -3621,6 +3643,16 @@
return RESULT_SUCCESS;
}
+static int rtp_do_debug_dtmf(int fd, int argc, char *argv[])
+{
+ if (argc != 3)
+ return RESULT_SHOWUSAGE;
+
+ rtpdebugdtmf = 1;
+ ast_cli(fd, "RTP DTMF debugging enabled\n");
+ return RESULT_SUCCESS;
+}
+
static int rtp_do_debug(int fd, int argc, char *argv[])
{
if (argc != 2) {
@@ -3681,6 +3713,7 @@
if (argc != 3)
return RESULT_SHOWUSAGE;
rtpdebug = 0;
+ rtpdebugdtmf = 0;
ast_cli(fd,"RTP Debugging Disabled\n");
return RESULT_SUCCESS;
}
@@ -3741,7 +3774,7 @@
}
static char debug_usage[] =
- "Usage: rtp debug [ip host[:port]]\n"
+ "Usage: rtp debug [ip host[:port] | dtmf]\n"
" Enable dumping of all RTP packets to and from host.\n";
static char no_debug_usage[] =
@@ -3816,6 +3849,10 @@
rtp_do_debug, "Enable RTP debugging",
debug_usage },
+ { { "rtp", "debug", "dtmf", NULL },
+ rtp_do_debug_dtmf, "Enable RTP debugging on DTMFs",
+ debug_usage },
+
{ { "rtp", "debug", "off", NULL },
rtp_no_debug, "Disable RTP debugging",
no_debug_usage, NULL, &cli_rtp_no_debug_deprecated },

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,228 @@
--- Makefile.orig 2009-10-23 17:00:01.000000000 +0300
+++ Makefile 2009-11-23 16:44:36.000000000 +0200
@@ -101,7 +101,7 @@
OVERWRITE=y
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
-DEBUG=-g3
+#DEBUG=-g3
# Staging directory
# Files are copied here temporarily during the install process
@@ -135,7 +135,7 @@
ASTMANDIR=$(mandir)
ifneq ($(findstring BSD,$(OSARCH)),)
ASTVARLIBDIR=$(prefix)/share/asterisk
- ASTVARRUNDIR=$(localstatedir)/run/asterisk
+ ASTVARRUNDIR=$(localstatedir)/run
else
ASTVARLIBDIR=$(localstatedir)/lib/asterisk
endif
@@ -225,9 +225,11 @@
_ASTLDFLAGS+=-L/usr/local/lib
endif
+ifneq ($(OSARCH),FreeBSD)
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)
endif
+endif
ifeq ($(PROC),ppc)
_ASTCFLAGS+=-fsigned-char
@@ -235,7 +237,7 @@
ifeq ($(OSARCH),FreeBSD)
# -V is understood by BSD Make, not by GNU make.
- BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
+ BSDVERSION=$(OSVERSION)
_ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
AST_LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
endif
@@ -410,21 +412,21 @@
rm -f build_tools/menuselect-deps
datafiles: _all
- if [ `$(ID) -u` = 0 ]; then \
- CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; \
- fi
+ #if [ `$(ID) -u` = 0 ]; then \
+ # CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; \
+ #fi
# Should static HTTP be installed during make samples or even with its own target ala
# webvoicemail? There are portions here that *could* be customized but might also be
# improved a lot. I'll put it here for now.
- mkdir -p $(DESTDIR)$(ASTDATADIR)/static-http
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/static-http
for x in static-http/*; do \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
done
- mkdir -p $(DESTDIR)$(ASTDATADIR)/images
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/images
for x in images/*.jpg; do \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/images ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTDATADIR)/images ; \
done
- mkdir -p $(DESTDIR)$(AGI_DIR)
+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
$(MAKE) -C sounds install
update:
@@ -445,47 +447,47 @@
OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
installdirs:
- 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
+ $(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
bininstall: _all installdirs $(SUBDIRS_INSTALL)
- $(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
+ $(BSD_INSTALL_PROGRAM) main/asterisk $(DESTDIR)$(ASTSBINDIR)/
$(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)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
- chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
+ cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/scripts/safe_asterisk.out;\
+ ${BSD_INSTALL_SCRIPT} contrib/scripts/safe_asterisk.out $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
fi
- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
- $(INSTALL) -m 644 include/asterisk.h $(DESTDIR)$(includedir)
- $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR)
+ $(BSD_INSTALL_DATA) include/asterisk.h $(DESTDIR)$(includedir)
+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
if [ -n "$(OLDHEADERS)" ]; then \
rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
fi
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
- mkdir -p $(DESTDIR)$(ASTDATADIR)/keys
- mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware
- mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware/iax
- mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
- $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
- $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
- $(INSTALL) -m 644 doc/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)$(ASTLOGDIR)/cdr-csv
+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-custom
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/keys
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/firmware
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/firmware/iax
+ $(MKDIR) $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
+ $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
+ $(BSD_INSTALL_MAN) doc/asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_MAN) contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_MAN) contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(BSD_INSTALL_MAN) contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
if [ -f contrib/firmware/iax/iaxy.bin ] ; then \
- $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
+ $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
fi
$(SUBDIRS_INSTALL):
@@ -521,7 +523,7 @@
@exit 1
endif
-install: badshell datafiles bininstall
+install: badshell datafiles bininstall samples
@if [ -x /usr/sbin/asterisk-post-install ]; then \
/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
fi
@@ -559,31 +561,23 @@
upgrade: bininstall
adsi:
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.adsi; do \
if [ ! -f $(DESTDIR)$(ASTETCDIR)/$$x ]; then \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
fi ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`-dist ; \
done
samples: adsi
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.sample; do \
- if [ -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
- if [ "$(OVERWRITE)" = "y" ]; then \
- if cmp -s $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $$x ; then \
- echo "Config file $$x is unchanged"; \
- continue; \
- fi ; \
- mv -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`.old ; \
- else \
- echo "Skipping config file $$x"; \
- continue; \
- fi ;\
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`-dist ;\
+ if [ ! -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`;\
fi ; \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ;\
done
- if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ if true; then \
( \
echo "[directories]" ; \
echo "astetcdir => $(ASTETCDIR)" ; \
@@ -629,20 +623,23 @@
echo ";astctlowner = root" ; \
echo ";astctlgroup = apache" ; \
echo ";astctl = asterisk.ctl" ; \
- ) > $(DESTDIR)$(ASTCONFPATH) ; \
+ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \
+ if [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ cp $(DESTDIR)$(ASTCONFPATH)-dist $(DESTDIR)$(ASTCONFPATH); \
+ fi; \
else \
echo "Skipping asterisk.conf creation"; \
fi
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
webvmail:
@[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
@[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
$(INSTALL) -m 4755 -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 " + +"

View file

@ -0,0 +1,112 @@
--- Makefile.orig 2010-10-14 00:24:44.000000000 +0200
+++ Makefile 2010-11-17 12:24:32.000000000 +0100
@@ -122,7 +122,7 @@
OVERWRITE=y
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
-DEBUG=-g3
+#DEBUG=-g3
# Asterisk.conf is located in ASTETCDIR or by using the -C flag
# when starting Asterisk
@@ -220,11 +220,13 @@
_ASTCFLAGS+=-isystem /usr/local/include
endif
+ifneq ($(OSARCH),FreeBSD)
ifeq ($(findstring -march,$(_ASTCFLAGS) $(ASTCFLAGS)),)
ifneq ($(PROC),ultrasparc)
_ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
endif
endif
+endif
ifeq ($(PROC),ppc)
_ASTCFLAGS+=-fsigned-char
@@ -232,7 +234,7 @@
ifeq ($(OSARCH),FreeBSD)
# -V is understood by BSD Make, not by GNU make.
- BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
+ BSDVERSION=$(OSVERSION)
_ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
endif
@@ -460,13 +462,14 @@
done
$(INSTALL) -m 644 doc/core-en_US.xml $(DESTDIR)$(ASTDATADIR)/static-http;
if [ -d doc/tex/asterisk ] ; then \
- $(INSTALL) -d $(DESTDIR)$(ASTDATADIR)/static-http/docs ; \
+ $(INSTALL) -d $(DESTDIR)$(DOCSDIR) ; \
+ $(INSTALL) -d $(DESTDIR)$(DOCSDIR)/images ; \
for n in doc/tex/asterisk/* ; do \
- $(INSTALL) -m 644 $$n $(DESTDIR)$(ASTDATADIR)/static-http/docs ; \
+ $(INSTALL) -m 644 $$n $(DESTDIR)$(DOCSDIR) ; \
done \
fi
for x in images/*.jpg; do \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/images ; \
+ $(INSTALL) -m 644 $$x $(DESTDIR)$(DOCSDIR)/images ; \
done
$(MAKE) -C sounds install
@@ -526,6 +529,7 @@
$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/dictate"
$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/meetme"
$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/monitor"
+ $(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/outgoing"
$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/system"
$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/tmp"
$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/voicemail"
@@ -547,6 +551,7 @@
$(INSTALL) -d "$(DESTDIR)$(ASTDATADIR)/static-http"
$(INSTALL) -d "$(DESTDIR)$(ASTMANDIR)/man8"
$(INSTALL) -d "$(DESTDIR)$(AGI_DIR)"
+ $(INSTALL) -d "$(DESTDIR)$(ASTDBDIR)"
bininstall: _all installdirs $(SUBDIRS_INSTALL)
$(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
@@ -606,7 +611,7 @@
@exit 1
endif
-install: badshell bininstall datafiles
+install: badshell bininstall datafiles samples
@if [ -x /usr/sbin/asterisk-post-install ]; then \
/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
fi
@@ -648,29 +653,18 @@
else \
echo "Installing $$x" ; \
fi ; \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
+ $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`-dist ; \
done
samples: adsi
@echo Installing other config files...
@for x in configs/*.sample; do \
- dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`" ; \
- if [ -f $${dst} ]; then \
- if [ "$(OVERWRITE)" = "y" ]; then \
- if cmp -s $${dst} $$x ; then \
- echo "Config file $$x is unchanged"; \
- continue; \
- fi ; \
- mv -f $${dst} $${dst}.old ; \
- else \
- echo "Skipping config file $$x"; \
- continue; \
- fi ;\
+ $(INSTALL) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`-dist ; \
+ if [ ! -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
+ $(INSTALL) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`; \
fi ; \
- echo "Installing file $$x"; \
- $(INSTALL) -m 644 $$x $${dst} ;\
done
- if [ "$(OVERWRITE)" = "y" ]; then \
+ @if true; then \
echo "Updating asterisk.conf" ; \
sed -e 's|^astetcdir.*$$|astetcdir => $(ASTETCDIR)|' \
-e 's|^astmoddir.*$$|astmoddir => $(MODULES_DIR)|' \

View file

@ -0,0 +1,16 @@
--- Makefile.rules.orig 2009-09-28 22:09:25.000000000 +0300
+++ Makefile.rules 2009-11-23 16:15:23.000000000 +0200
@@ -37,11 +37,13 @@
OPTIMIZE?=-O6
+ifneq ($(OSARCH),FreeBSD)
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),)
_ASTCFLAGS+=$(OPTIMIZE)
else
_ASTCFLAGS+=-O0
endif
+endif
# shortcuts for common combinations of flags; these must be recursively expanded so that
# per-target settings will be applied

View file

@ -0,0 +1,13 @@
--- ./agi/Makefile.orig 2010-07-23 15:26:41.000000000 +0200
+++ ./agi/Makefile 2010-11-06 14:54:36.000000000 +0100
@@ -16,7 +16,9 @@
.PHONY: clean all uninstall
-AGIS=$(MENUSELECT_AGIS)
+AGIS_BIN=eagi-test eagi-sphinx-test
+AGIS_SCR=agi-test.agi jukebox.agi
+AGIS=$(AGIS_SCR) $(AGIS_BIN)
ifeq ($(OSARCH),SunOS)
LIBS+=-lsocket -lnsl

View file

@ -0,0 +1,33 @@
--- channels/chan_dahdi.c.orig 2010-11-09 11:18:39.000000000 +0100
+++ channels/chan_dahdi.c 2010-11-09 11:22:15.000000000 +0100
@@ -4688,6 +4688,8 @@
return;
}
if (p->echocancel.head.tap_length) {
+ struct dahdi_echocanparams *pecp;
+
#if defined(HAVE_PRI) || defined(HAVE_SS7)
switch (p->sig) {
#if defined(HAVE_PRI)
@@ -4718,7 +4720,9 @@
break;
}
#endif /* defined(HAVE_PRI) || defined(HAVE_SS7) */
- res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_ECHOCANCEL_PARAMS, &p->echocancel);
+
+ pecp = &p->echocancel.head;
+ res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_ECHOCANCEL_PARAMS, &pecp);
if (res) {
ast_log(LOG_WARNING, "Unable to enable echo cancellation on channel %d (%s)\n", p->channel, strerror(errno));
} else {
@@ -4752,8 +4756,9 @@
if (p->echocanon) {
struct dahdi_echocanparams ecp = { .tap_length = 0 };
+ struct dahdi_echocanparams *pecp = &ecp;
- res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_ECHOCANCEL_PARAMS, &ecp);
+ res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_ECHOCANCEL_PARAMS, &pecp);
if (res)
ast_log(LOG_WARNING, "Unable to disable echo cancellation on channel %d: %s\n", p->channel, strerror(errno));

View file

@ -0,0 +1,29 @@
--- ./channels/Makefile.orig 2010-06-07 22:04:42.000000000 +0200
+++ ./channels/Makefile 2010-11-06 14:54:36.000000000 +0100
@@ -27,9 +27,10 @@
endif
ifeq ($(OSARCH),FreeBSD)
- PTLIB=-lpt_FreeBSD_x86_r
- H323LIB=-lh323_FreeBSD_x86_r
+ PTLIB=-lpt_r
+ H323LIB=-lh323_r
CHANH323LIB=-pthread
+ H323LDLIBS=$(PTLIB) $(H323LIB) $(CHANH323LIB)
endif
ifeq ($(OSARCH),NetBSD)
@@ -86,9 +87,13 @@
else
chan_h323.so: chan_h323.o h323/libchanh323.a
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
+ifeq ($(OSARCH),FreeBSD)
+ $(CMD_PREFIX) $(CXX) $(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) -L$(LOCALBASE)/lib $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) $(CHANH323LIB)
+else
$(CMD_PREFIX) $(CXX) $(PTHREAD_CFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
endif
endif
+endif
chan_misdn.o: _ASTCFLAGS+=-Imisdn

View file

@ -0,0 +1,11 @@
--- channels/chan_sip.c.orig 2008-06-10 00:46:46.000000000 -0700
+++ channels/chan_sip.c 2008-06-10 00:46:46.000000000 -0700
@@ -496,7 +496,7 @@
#define DEFAULT_MOHINTERPRET "default"
#define DEFAULT_MOHSUGGEST ""
#define DEFAULT_VMEXTEN "asterisk"
-#define DEFAULT_CALLERID "asterisk"
+#define DEFAULT_CALLERID "Unknown"
#define DEFAULT_NOTIFYMIME "application/simple-message-summary"
#define DEFAULT_MWITIME 10
#define DEFAULT_ALLOWGUEST TRUE

View file

@ -0,0 +1,11 @@
--- ./channels/sip/include/sip.h.orig 2010-11-08 04:46:46.000000000 +0100
+++ ./channels/sip/include/sip.h 2010-11-08 04:47:07.000000000 +0100
@@ -180,7 +180,7 @@
#define DEFAULT_MOHINTERPRET "default" /*!< The default music class */
#define DEFAULT_MOHSUGGEST ""
#define DEFAULT_VMEXTEN "asterisk" /*!< Default voicemail extension */
-#define DEFAULT_CALLERID "asterisk" /*!< Default caller ID */
+#define DEFAULT_CALLERID "Unknown" /*!< Default caller ID */
#define DEFAULT_MWI_FROM ""
#define DEFAULT_NOTIFYMIME "application/simple-message-summary"
#define DEFAULT_ALLOWGUEST TRUE

View file

@ -0,0 +1,11 @@
--- ./channels/h323/Makefile.in.orig 2010-06-03 16:48:09.000000000 +0200
+++ ./channels/h323/Makefile.in 2010-11-06 14:54:36.000000000 +0100
@@ -13,7 +13,7 @@
STDCCFLAGS += -I../../include -include ../../include/asterisk/autoconfig.h
STDCCFLAGS += -fPIC
#OPTCCFLAGS +=
-CFLAGS = -pipe
+CFLAGS = -pipe @CXXFLAGS@
TARGET = libchanh323.a
TARGET += Makefile.ast
SOURCES = ast_h323.cxx compat_h323.cxx cisco-h225.cxx caps_h323.cxx

View file

@ -0,0 +1,33 @@
--- configure.orig 2010-10-07 22:58:47.000000000 +0200
+++ configure 2010-11-06 15:54:49.000000000 +0100
@@ -4670,9 +4670,9 @@
astheaderdir='${includedir}/asterisk'
astlibdir='${libdir}/asterisk'
astmandir='${mandir}'
-astvarlibdir='${localstatedir}/lib/asterisk'
+astvarlibdir='${prefix}/share/asterisk'
astdatadir='${astvarlibdir}'
-astdbdir='${astvarlibdir}'
+astdbdir='${localstatedir}/db/asterisk'
astkeydir='${astvarlibdir}'
astspooldir='${localstatedir}/spool/asterisk'
astlogdir='${localstatedir}/log/asterisk'
@@ -4694,9 +4694,6 @@
case "${host_os}" in
freebsd*)
-
- CPPFLAGS=-I/usr/local/include
- LDFLAGS=-L/usr/local/lib
;;
openbsd*)
@@ -25058,7 +25055,7 @@
fi
- PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
+ PLATFORM_OPENH323="h323_${OPENH323_SUFFIX}"
if test "${HAS_OPENH323:-unset}" != "unset"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenH323 installation validity" >&5

View file

@ -0,0 +1,13 @@
$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

View file

@ -0,0 +1,30 @@
--- ./main/Makefile.orig 2010-08-02 16:41:46.000000000 +0200
+++ ./main/Makefile 2010-11-06 14:54:37.000000000 +0100
@@ -107,8 +107,8 @@
cd editline && test -f config.h || CFLAGS="$(PTHREAD_CFLAGS) $(subst $(ASTTOPDIR),../../,$(_ASTCFLAGS:-Werror=) $(ASTCFLAGS))" LDFLAGS="$(_ASTLDFLAGS) $(ASTLDFLAGS)" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --with-ncurses=$(NCURSES_DIR) --with-curses=$(CURSES_DIR) --with-termcap=$(TERMCAP_DIR) --with-tinfo=$(TINFO_DIR)
$(MAKE) -C editline libedit.a
-db1-ast/libdb1.a: CHECK_SUBDIR
- _ASTCFLAGS="$(_ASTCFLAGS) -Wno-strict-aliasing" ASTCFLAGS="$(ASTCFLAGS)" $(MAKE) -C db1-ast libdb1.a
+#db1-ast/libdb1.a: CHECK_SUBDIR
+# _ASTCFLAGS="$(_ASTCFLAGS) -Wno-strict-aliasing" ASTCFLAGS="$(ASTCFLAGS)" $(MAKE) -C db1-ast libdb1.a
ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),)
ast_expr2.c ast_expr2.h: ast_expr2.y
@@ -173,13 +173,13 @@
$(OBJS): _ASTCFLAGS+=-DAST_MODULE=\"core\"
-$(MAIN_TGT): $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS)
+$(MAIN_TGT): $(OBJS) editline/libedit.a $(AST_EMBED_LDSCRIPTS)
@$(CC) -c -o buildinfo.o $(_ASTCFLAGS) buildinfo.c $(ASTCFLAGS)
$(ECHO_PREFIX) echo " [LD] $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) -> $@"
ifneq ($(findstring chan_h323,$(MENUSELECT_CHANNELS)),)
- $(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(GMIMELDFLAGS)
+ $(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(LDFLAGS) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(OBJS) editline/libedit.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(GMIMELDFLAGS)
else
- $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS) $(GMIMELDFLAGS)
+ $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(LDFLAGS) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $(OBJS) editline/libedit.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS) $(GMIMELDFLAGS)
endif
ifeq ($(GNU_LD),1)

View file

@ -0,0 +1,18 @@
--- ./main/db.c.orig 2010-09-10 22:31:58.000000000 +0200
+++ ./main/db.c 2010-11-06 14:54:37.000000000 +0100
@@ -36,6 +36,7 @@
#include <sys/time.h>
#include <signal.h>
#include <dirent.h>
+#include <db.h>
#include "asterisk/channel.h"
#include "asterisk/file.h"
@@ -46,7 +47,6 @@
#include "asterisk/utils.h"
#include "asterisk/lock.h"
#include "asterisk/manager.h"
-#include "db1-ast/include/db.h"
/*** DOCUMENTATION
<manager name="DBGet" language="en_US">

View file

@ -0,0 +1,14 @@
$FreeBSD$
--- main/frame.c.orig Wed Jan 25 13:22:43 2006
+++ main/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;

View file

@ -0,0 +1,13 @@
--- ./main/utils.c.orig 2010-08-06 20:57:10.000000000 +0200
+++ ./main/utils.c 2010-11-06 14:54:37.000000000 +0100
@@ -990,8 +990,8 @@
pthread_attr_init(attr);
}
-#ifdef __linux__
- /* On Linux, pthread_attr_init() defaults to PTHREAD_EXPLICIT_SCHED,
+#ifdef __linux__ || defined(__FreeBSD__)
+ /* On Linux and FreeBSD, pthread_attr_init() defaults to PTHREAD_EXPLICIT_SCHED,
which is kind of useless. Change this here to
PTHREAD_INHERIT_SCHED; that way the -p option to set realtime
priority will propagate down to new threads by default.

View file

@ -0,0 +1,13 @@
--- ./main/lock.c.orig 2010-11-06 15:00:15.000000000 +0100
+++ ./main/lock.c 2010-11-06 15:00:23.000000000 +0100
@@ -679,10 +679,6 @@
pthread_rwlockattr_init(&attr);
-#ifdef HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP
- pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_WRITER_NP);
-#endif
-
res = pthread_rwlock_init(&t->lock, &attr);
pthread_rwlockattr_destroy(&attr);
return res;

View file

@ -0,0 +1,25 @@
--- channels/chan_sip.c.orig 2009-04-14 08:58:13.000000000 +0100
+++ channels/chan_sip.c 2009-04-14 09:00:58.000000000 +0100
@@ -16287,7 +16287,6 @@
restartsearch:
/* Check for interfaces needing to be killed */
ast_mutex_lock(&iflock);
- t = time(NULL);
/* don't scan the interface list if it hasn't been a reasonable period
of time since the last time we did it (when MWI is being sent, we can
get back to this point every millisecond or less)
@@ -16306,12 +16305,14 @@
(sip->owner->_state == AST_STATE_UP) &&
!sip->redirip.sin_addr.s_addr &&
sip->t38.state != T38_ENABLED) {
+ t = time(NULL);
if (sip->lastrtptx &&
ast_rtp_get_rtpkeepalive(sip->rtp) &&
(t > sip->lastrtptx + ast_rtp_get_rtpkeepalive(sip->rtp))) {
/* Need to send an empty RTP packet */
sip->lastrtptx = time(NULL);
ast_rtp_sendcng(sip->rtp, 0);
+ t = time(NULL);
}
if (sip->lastrtprx &&
(ast_rtp_get_rtptimeout(sip->rtp) || ast_rtp_get_rtpholdtimeout(sip->rtp)) &&

View file

@ -0,0 +1,270 @@
Index: main/logger.c
===================================================================
--- main/logger.c (revision 188505)
+++ main/logger.c (working copy)
@@ -140,6 +140,17 @@
AST_THREADSTORAGE(log_buf, log_buf_init);
#define LOG_BUF_INIT_SIZE 128
+/*
+ * Storage for previous log message to prevent log storms
+ */
+static int stored_log_level;
+static int stored_log_dup_count = 0;
+static char *stored_log_msg = NULL;
+static const char *stored_log_file;
+static int stored_log_line;
+static const char *stored_log_function;
+static ast_mutex_t stored_log_msg_lock;
+
static int make_components(char *s, int lineno)
{
char *w;
@@ -591,6 +602,8 @@
char tmp[256];
int res = 0;
+ ast_mutex_init(&stored_log_msg_lock);
+
/* auto rotate if sig SIGXFSZ comes a-knockin */
(void) signal(SIGXFSZ,(void *) handle_SIGXFSZ);
@@ -655,14 +668,14 @@
return;
}
-static void __attribute__((format(printf, 5, 0))) ast_log_vsyslog(int level, const char *file, int line, const char *function, const char *fmt, va_list args)
+static void ast_log_syslog(int level, const char *file, int line, const char *function, const char *msg)
{
char buf[BUFSIZ];
char *s;
if (level >= SYSLOG_NLEVELS) {
/* we are locked here, so cannot ast_log() */
- fprintf(stderr, "ast_log_vsyslog called with bogus level: %d\n", level);
+ fprintf(stderr, "ast_log_syslog called with bogus level: %d\n", level);
return;
}
if (level == __LOG_VERBOSE) {
@@ -676,27 +689,20 @@
levels[level], (long)GETTID(), file, line, function);
}
s = buf + strlen(buf);
- vsnprintf(s, sizeof(buf) - strlen(buf), fmt, args);
+ snprintf(s, sizeof(buf) - strlen(buf), "%s", msg);
term_strip(s, s, strlen(s) + 1);
syslog(syslog_level_map[level], "%s", buf);
}
-/*!
- * \brief send log messages to syslog and/or the console
- */
-void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
+static void __ast_log(int level, const char *file, int line, const char *function, char *msg, int msglen)
{
struct logchannel *chan;
- struct ast_dynamic_str *buf;
time_t t;
struct tm tm;
char date[256];
+ char buf[2048];
+ int res;
- va_list ap;
-
- if (!(buf = ast_dynamic_str_thread_get(&log_buf, LOG_BUF_INIT_SIZE)))
- return;
-
if (AST_LIST_EMPTY(&logchannels))
{
/*
@@ -704,35 +710,12 @@
* so just log to stdout
*/
if (level != __LOG_VERBOSE) {
- int res;
- va_start(ap, fmt);
- res = ast_dynamic_str_thread_set_va(&buf, BUFSIZ, &log_buf, fmt, ap);
- va_end(ap);
- if (res != AST_DYNSTR_BUILD_FAILED) {
- term_filter_escapes(buf->str);
- fputs(buf->str, stdout);
- }
+ term_filter_escapes(msg);
+ fputs(msg, stdout);
}
return;
}
- /* don't display LOG_DEBUG messages unless option_verbose _or_ option_debug
- are non-zero; LOG_DEBUG messages can still be displayed if option_debug
- is zero, if option_verbose is non-zero (this allows for 'level zero'
- LOG_DEBUG messages to be displayed, if the logmask on any channel
- allows it)
- */
- if (!option_verbose && !option_debug && (level == __LOG_DEBUG))
- return;
-
- /* Ignore anything that never gets logged anywhere */
- if (!(global_logmask & (1 << level)))
- return;
-
- /* Ignore anything other than the currently debugged file if there is one */
- if ((level == __LOG_DEBUG) && !ast_strlen_zero(debug_filename) && strcasecmp(debug_filename, file))
- return;
-
time(&t);
ast_localtime(&t, &tm, NULL);
strftime(date, sizeof(date), dateformat, &tm);
@@ -740,13 +723,8 @@
AST_LIST_LOCK(&logchannels);
if (logfiles.event_log && level == __LOG_EVENT) {
- va_start(ap, fmt);
-
- fprintf(eventlog, "%s asterisk[%ld]: ", date, (long)getpid());
- vfprintf(eventlog, fmt, ap);
+ fprintf(eventlog, "%s asterisk[%ld]: %s", date, (long)getpid(), msg);
fflush(eventlog);
-
- va_end(ap);
AST_LIST_UNLOCK(&logchannels);
return;
}
@@ -756,18 +734,15 @@
break;
/* Check syslog channels */
if (chan->type == LOGTYPE_SYSLOG && (chan->logmask & (1 << level))) {
- va_start(ap, fmt);
- ast_log_vsyslog(level, file, line, function, fmt, ap);
- va_end(ap);
+ ast_log_syslog(level, file, line, function, msg);
/* Console channels */
} else if ((chan->logmask & (1 << level)) && (chan->type == LOGTYPE_CONSOLE)) {
char linestr[128];
char tmp1[80], tmp2[80], tmp3[80], tmp4[80];
if (level != __LOG_VERBOSE) {
- int res;
sprintf(linestr, "%d", line);
- ast_dynamic_str_thread_set(&buf, BUFSIZ, &log_buf,
+ snprintf(buf, sizeof(buf),
"[%s] %s[%ld]: %s:%s %s: ",
date,
term_color(tmp1, levels[level], colors[level], 0, sizeof(tmp1)),
@@ -776,23 +751,17 @@
term_color(tmp3, linestr, COLOR_BRWHITE, 0, sizeof(tmp3)),
term_color(tmp4, function, COLOR_BRWHITE, 0, sizeof(tmp4)));
/*filter to the console!*/
- term_filter_escapes(buf->str);
- ast_console_puts_mutable(buf->str);
-
- va_start(ap, fmt);
- res = ast_dynamic_str_thread_set_va(&buf, BUFSIZ, &log_buf, fmt, ap);
- va_end(ap);
- if (res != AST_DYNSTR_BUILD_FAILED)
- ast_console_puts_mutable(buf->str);
+ term_filter_escapes(buf);
+ ast_console_puts_mutable(buf);
+ ast_console_puts_mutable(msg);
}
/* File channels */
} else if ((chan->logmask & (1 << level)) && (chan->fileptr)) {
- int res;
- ast_dynamic_str_thread_set(&buf, BUFSIZ, &log_buf,
+ snprintf(buf, sizeof(buf),
"[%s] %s[%ld] %s: ",
date, levels[level], (long)GETTID(), file);
- res = fprintf(chan->fileptr, "%s", buf->str);
- if (res <= 0 && !ast_strlen_zero(buf->str)) { /* Error, no characters printed */
+ res = fprintf(chan->fileptr, "%s", buf);
+ if (res <= 0 && !ast_strlen_zero(buf)) { /* Error, no characters printed */
fprintf(stderr,"**** Asterisk Logging Error: ***********\n");
if (errno == ENOMEM || errno == ENOSPC) {
fprintf(stderr, "Asterisk logging error: Out of disk space, can't log to log file %s\n", chan->filename);
@@ -801,16 +770,10 @@
manager_event(EVENT_FLAG_SYSTEM, "LogChannel", "Channel: %s\r\nEnabled: No\r\nReason: %d - %s\r\n", chan->filename, errno, strerror(errno));
chan->disabled = 1;
} else {
- int res;
/* No error message, continue printing */
- va_start(ap, fmt);
- res = ast_dynamic_str_thread_set_va(&buf, BUFSIZ, &log_buf, fmt, ap);
- va_end(ap);
- if (res != AST_DYNSTR_BUILD_FAILED) {
- term_strip(buf->str, buf->str, buf->len);
- fputs(buf->str, chan->fileptr);
- fflush(chan->fileptr);
- }
+ term_strip(msg, msg, msglen);
+ fputs(msg, chan->fileptr);
+ fflush(chan->fileptr);
}
}
}
@@ -825,6 +788,65 @@
}
}
+/*!
+ * \brief send log messages to syslog and/or the console
+ */
+void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
+{
+ struct ast_dynamic_str *buf;
+ int res;
+ va_list ap;
+
+ if (!(buf = ast_dynamic_str_thread_get(&log_buf, LOG_BUF_INIT_SIZE)))
+ return;
+
+ va_start(ap, fmt);
+ res = ast_dynamic_str_thread_set_va(&buf, BUFSIZ, &log_buf, fmt, ap);
+ va_end(ap);
+ if (res == AST_DYNSTR_BUILD_FAILED)
+ return;
+
+ /* don't display LOG_DEBUG messages unless option_verbose _or_ option_debug
+ are non-zero; LOG_DEBUG messages can still be displayed if option_debug
+ is zero, if option_verbose is non-zero (this allows for 'level zero'
+ LOG_DEBUG messages to be displayed, if the logmask on any channel
+ allows it)
+ */
+ if (!option_verbose && !option_debug && (level == __LOG_DEBUG))
+ return;
+
+ /* Ignore anything that never gets logged anywhere */
+ if (!(global_logmask & (1 << level)))
+ return;
+
+ /* Ignore anything other than the currently debugged file if there is one */
+ if ((level == __LOG_DEBUG) && !ast_strlen_zero(debug_filename) && strcasecmp(debug_filename, file))
+ return;
+
+ ast_mutex_lock(&stored_log_msg_lock);
+ if (stored_log_msg == NULL || stored_log_level != level || strcmp(buf->str, stored_log_msg) != 0) {
+ if (stored_log_dup_count > 0) {
+ char buf2[1024];
+
+ snprintf(buf2, sizeof(buf2), "Last message repeated %d times\n", stored_log_dup_count);
+ __ast_log(stored_log_level, stored_log_file, stored_log_line, stored_log_function, buf2, strlen(buf2));
+ }
+ if (stored_log_msg != NULL)
+ ast_free(stored_log_msg);
+ stored_log_msg = ast_strdup(buf->str);
+ stored_log_level = level;
+ stored_log_dup_count = 0;
+ stored_log_file = file;
+ stored_log_line = line;
+ stored_log_function = function;
+ __ast_log(level, file, line, function, buf->str, buf->len);
+ }
+ else
+ ++stored_log_dup_count;
+
+ ast_mutex_unlock(&stored_log_msg_lock);
+}
+
void ast_backtrace(void)
{
#ifdef linux

View file

@ -0,0 +1,86 @@
--- channels/chan_sip.c.orig 2009-11-20 17:56:30.000000000 +0200
+++ channels/chan_sip.c 2009-11-20 17:59:43.000000000 +0200
@@ -565,6 +565,9 @@
static unsigned int global_tos_sip; /*!< IP type of service for SIP packets */
static unsigned int global_tos_audio; /*!< IP type of service for audio RTP packets */
static unsigned int global_tos_video; /*!< IP type of service for video RTP packets */
+static int global_force_dtmf_relay = 0;
+static int global_force_dtmf_relay_pt = 101;
+
static int compactheaders; /*!< send compact sip headers */
static int recordhistory; /*!< Record SIP history. Off by default */
static int dumphistory; /*!< Dump history to verbose before destroying SIP dialog */
@@ -5329,6 +5332,7 @@
int x;
int codec_index = 0;
int codec_pt_order[256];
+ int dtmf_present = 0;
/* Host information */
struct ast_hostent audiohp;
@@ -5600,12 +5604,21 @@
for (x = 0; x < codec_index; ++x) {
struct rtpPayloadType pt;
pt = ast_rtp_lookup_pt(p->rtp, codec_pt_order[x]);
+ if (pt.code == AST_RTP_DTMF)
+ dtmf_present = 1;
if (!pt.isAstFormat && !pt.code && p->vrtp)
pt = ast_rtp_lookup_pt(p->vrtp, codec_pt_order[x]);
if (pt.isAstFormat)
ast_codec_pref_append(&p->formats, pt.code);
}
ast_codec_pref_remove2(&p->formats, ~p->usercapability);
+ if (!dtmf_present && global_force_dtmf_relay) {
+ newnoncodeccapability |= AST_RTP_DTMF;
+ ast_rtp_set_m_type(newaudiortp, global_force_dtmf_relay_pt);
+ codec_pt_order[codec_index++] = global_force_dtmf_relay_pt;
+ ast_rtp_set_rtpmap_type(newaudiortp, global_force_dtmf_relay_pt, "audio", "telephone-event", 0);
+ }
+
/* Now gather all of the codecs that we are asked for: */
ast_rtp_get_current_formats(newaudiortp, &peercapability, &peernoncodeccapability);
@@ -18369,6 +18382,9 @@
global_matchexterniplocally = FALSE;
+ global_force_dtmf_relay = 0;
+ global_force_dtmf_relay_pt = 101;
+
/* Copy the default jb config over global_jbconf */
memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
@@ -18431,6 +18447,18 @@
}
} else if (!strcasecmp(v->name, "vmexten")) {
ast_copy_string(default_vmexten, v->value, sizeof(default_vmexten));
+ } else if (!strcasecmp(v->name, "rtp_force_dtmf_relay")) {
+ if ((global_force_dtmf_relay = ast_true(v->value)))
+ ast_verbose("RTP DTMF relaying will be enforced\n");
+ else
+ ast_verbose("RTP DTMF relaying will not be enforced\n");
+ } else if (!strcasecmp(v->name, "rtp_force_dtmf_relay_pt")) {
+ sscanf(v->value, "%d", &global_force_dtmf_relay_pt);
+ if (global_force_dtmf_relay_pt < 96 || global_force_dtmf_relay_pt > 255) {
+ ast_verbose("RTP forced DTMF relay payload type is not valid: %d. Using default (101)\n", global_force_dtmf_relay_pt);
+ global_force_dtmf_relay_pt = 101;
+ } else
+ ast_log(LOG_WARNING, "RTP forced DTMF relay payload type is %d\n", global_force_dtmf_relay_pt);
} else if (!strcasecmp(v->name, "rtptimeout")) {
if ((sscanf(v->value, "%30d", &global_rtptimeout) != 1) || (global_rtptimeout < 0)) {
ast_log(LOG_WARNING, "'%s' is not a valid RTP hold time at line %d. Using default.\n", v->value, v->lineno);
--- configs/sip.conf.sample.orig 2008-04-25 08:53:52.000000000 -0700
+++ configs/sip.conf.sample 2008-06-10 00:45:37.000000000 -0700
@@ -53,6 +53,12 @@
; and multiline formatted headers for strict
; SIP compatibility (defaults to "no")
+;rtp_force_dtmf_relay=no ; Enable RFC2833 DTMFs to be sent even if peer
+ ; hasn't announced support for it. Default: no
+
+;rtp_force_dtmf_relay_pt=101 ; RTP payload type value for enforced RFC2833
+ ; DTMFs. Default: 101
+
; See doc/ip-tos.txt for a description of these parameters.
;tos_sip=cs3 ; Sets TOS for SIP packets.
;tos_audio=ef ; Sets TOS for RTP audio packets.

View file

@ -0,0 +1,69 @@
--- channels/chan_sip.c.orig 2009-11-23 17:28:47.000000000 +0200
+++ channels/chan_sip.c 2009-11-23 17:29:29.000000000 +0200
@@ -565,6 +565,9 @@
static unsigned int global_tos_sip; /*!< IP type of service for SIP packets */
static unsigned int global_tos_audio; /*!< IP type of service for audio RTP packets */
static unsigned int global_tos_video; /*!< IP type of service for video RTP packets */
+static int global_force_dtmf_relay = 0;
+static int global_force_dtmf_relay_pt = 101;
+
static int compactheaders; /*!< send compact sip headers */
static int recordhistory; /*!< Record SIP history. Off by default */
static int dumphistory; /*!< Dump history to verbose before destroying SIP dialog */
@@ -5593,6 +5596,12 @@
/* Now gather all of the codecs that we are asked for: */
ast_rtp_get_current_formats(newaudiortp, &peercapability, &peernoncodeccapability);
+ /* Add telephone-event */
+ if (global_force_dtmf_relay && !(peernoncodeccapability & AST_RTP_DTMF)) {
+ ast_rtp_set_m_type(newaudiortp, global_force_dtmf_relay_pt);
+ ast_rtp_set_rtpmap_type(newaudiortp, global_force_dtmf_relay_pt, "audio", "telephone-event", 0);
+ peernoncodeccapability |= AST_RTP_DTMF;
+ }
ast_rtp_get_current_formats(newvideortp, &vpeercapability, &vpeernoncodeccapability);
newjointcapability = p->capability & (peercapability | vpeercapability);
@@ -18366,6 +18375,9 @@
global_matchexterniplocally = FALSE;
+ global_force_dtmf_relay = 0;
+ global_force_dtmf_relay_pt = 101;
+
/* Copy the default jb config over global_jbconf */
memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
@@ -18428,6 +18440,18 @@
}
} else if (!strcasecmp(v->name, "vmexten")) {
ast_copy_string(default_vmexten, v->value, sizeof(default_vmexten));
+ } else if (!strcasecmp(v->name, "rtp_force_dtmf_relay")) {
+ if ((global_force_dtmf_relay = ast_true(v->value)))
+ ast_verbose("RTP DTMF relaying will be enforced\n");
+ else
+ ast_verbose("RTP DTMF relaying will not be enforced\n");
+ } else if (!strcasecmp(v->name, "rtp_force_dtmf_relay_pt")) {
+ sscanf(v->value, "%d", &global_force_dtmf_relay_pt);
+ if (global_force_dtmf_relay_pt < 96 || global_force_dtmf_relay_pt > 255) {
+ ast_verbose("RTP forced DTMF relay payload type is not valid: %d. Using default (101)\n", global_force_dtmf_relay_pt);
+ global_force_dtmf_relay_pt = 101;
+ } else
+ ast_log(LOG_WARNING, "RTP forced DTMF relay payload type is %d\n", global_force_dtmf_relay_pt);
} else if (!strcasecmp(v->name, "rtptimeout")) {
if ((sscanf(v->value, "%30d", &global_rtptimeout) != 1) || (global_rtptimeout < 0)) {
ast_log(LOG_WARNING, "'%s' is not a valid RTP hold time at line %d. Using default.\n", v->value, v->lineno);
--- configs/sip.conf.sample.orig 2008-08-16 01:33:42.000000000 +0300
+++ configs/sip.conf.sample 2008-12-12 17:03:11.000000000 +0200
@@ -49,6 +49,12 @@
; and multiline formatted headers for strict
; SIP compatibility (defaults to "no")
+;rtp_force_dtmf_relay=no ; Enable RFC2833 DTMFs to be sent even if peer
+ ; hasn't announced support for it. Default: no
+
+;rtp_force_dtmf_relay_pt=101 ; RTP payload type value for enforced RFC2833
+ ; DTMFs. Default: 101
+
; See doc/ip-tos.txt for a description of these parameters.
;tos_sip=cs3 ; Sets TOS for SIP packets.
;tos_audio=ef ; Sets TOS for RTP audio packets.

View file

@ -0,0 +1,11 @@
--- channels/chan_sip.c.orig 2009-05-12 21:18:44.000000000 +0300
+++ channels/chan_sip.c 2009-05-26 12:58:10.000000000 +0300
@@ -3061,6 +3061,8 @@
} else if (!strcasecmp(ast_var_name(current), "SIPTRANSFER_REPLACES")) {
/* We're replacing a call. */
p->options->replaces = ast_var_value(current);
+ } else if (!strcasecmp(ast_var_name(current), "SIP_FORCE_CALLID")) {
+ ast_string_field_set(p, callid, ast_var_value(current));
}
}

View file

@ -0,0 +1,45 @@
--- channels/chan_sip.c.orig 2008-04-29 08:21:05.000000000 -0400
+++ channels/chan_sip.c 2008-05-28 18:41:48.000000000 -0400
@@ -15962,6 +15978,9 @@
char *ext, *host;
char tmp[256];
char *dest = data;
+ char *secret = NULL;
+ char *md5secret = NULL;
+ char *authname = NULL;
if (!(p = sip_alloc(NULL, NULL, 0, SIP_INVITE))) {
ast_log(LOG_ERROR, "Unable to build sip pvt data for '%s' (Out of memory or socket error)\n", (char *)data);
@@ -15983,6 +16002,17 @@
if (host) {
*host++ = '\0';
ext = tmp;
+ secret = strchr(ext, ':');
+ if (secret) {
+ *secret++ = '\0';
+ md5secret = strchr(secret, ':');
+ if (md5secret) {
+ *md5secret++ = '\0';
+ authname = strchr(md5secret, ':');
+ if (authname)
+ *authname++ = '\0';
+ }
+ }
} else {
ext = strchr(tmp, '/');
if (ext)
@@ -16015,6 +16045,14 @@
ast_string_field_set(p, username, ext);
ast_string_field_free(p, fullcontact);
}
+ if (secret && !ast_strlen_zero(secret))
+ ast_string_field_set(p, peersecret, secret);
+
+ if (md5secret && !ast_strlen_zero(md5secret))
+ ast_string_field_set(p, peermd5secret, md5secret);
+
+ if (authname && !ast_strlen_zero(authname))
+ ast_string_field_set(p, authname, authname);
#if 0
printf("Setting up to call extension '%s' at '%s'\n", ext ? ext : "<none>", host);
#endif

5
net/asterisk10/pkg-descr Normal file
View file

@ -0,0 +1,5 @@
Asterisk is an Open Source PBX and telephony toolkit. It is, in a
sense, middleware between Internet and telephony channels on the bottom,
and Internet and telephony applications at the top.
WWW: http://www.asteriskpbx.com

1616
net/asterisk10/pkg-plist Normal file

File diff suppressed because it is too large Load diff