summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Vroon <chainsaw@gentoo.org>2010-09-16 17:31:54 +0000
committerTony Vroon <chainsaw@gentoo.org>2010-09-16 17:31:54 +0000
commit54ae63094e315888760d7831f4265b9fe91bf557 (patch)
treeb952a1e1c16d84b77dcdb233291e7d9f335e2aa7 /net-misc/asterisk
parentvirtual/glut -> media-libs/glut (diff)
downloadgentoo-2-54ae63094e315888760d7831f4265b9fe91bf557.tar.gz
gentoo-2-54ae63094e315888760d7831f4265b9fe91bf557.tar.bz2
gentoo-2-54ae63094e315888760d7831f4265b9fe91bf557.zip
Add peerstatus to IAX2, closes bug #330135. Correct rotate keyword in logrotate file, closes bug #336066. Add USE="doc", closes bug #331613. Invoke DAHDIRAS differently so non-root works, closes bug #337297. Backported bri_net_ptmp from 1.8 branch, closes bug #337591. Many thanks to Jaco Kroon for all these bugfixes & improvements.
(Portage version: 2.1.9.6/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/asterisk')
-rw-r--r--net-misc/asterisk/ChangeLog15
-rw-r--r--net-misc/asterisk/asterisk-1.6.2.13-r1.ebuild267
-rw-r--r--net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-backport-bri-net-ptmp.patch35
-rw-r--r--net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-dahdiras-without-root.patch12
-rw-r--r--net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-iax2-peerstate.patch12
-rw-r--r--net-misc/asterisk/files/1.6.2/asterisk.logrotate229
6 files changed, 369 insertions, 1 deletions
diff --git a/net-misc/asterisk/ChangeLog b/net-misc/asterisk/ChangeLog
index d04474f099c6..b4f911dd757d 100644
--- a/net-misc/asterisk/ChangeLog
+++ b/net-misc/asterisk/ChangeLog
@@ -1,6 +1,19 @@
\# ChangeLog for net-misc/asterisk
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.268 2010/09/15 19:33:23 chainsaw Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.269 2010/09/16 17:31:54 chainsaw Exp $
+
+*asterisk-1.6.2.13-r1 (16 Sep 2010)
+
+ 16 Sep 2010; <chainsaw@gentoo.org> +asterisk-1.6.2.13-r1.ebuild,
+ +files/1.6.2/asterisk-1.6.2.13-backport-bri-net-ptmp.patch,
+ +files/1.6.2/asterisk-1.6.2.13-dahdiras-without-root.patch,
+ +files/1.6.2/asterisk-1.6.2.13-iax2-peerstate.patch,
+ +files/1.6.2/asterisk.logrotate2:
+ Add peerstatus to IAX2, closes bug #330135. Correct rotate keyword in
+ logrotate file, closes bug #336066. Add USE="doc", closes bug #331613.
+ Invoke DAHDIRAS differently so non-root works, closes bug #337297.
+ Backported bri_net_ptmp from 1.8 branch, closes bug #337591. Many thanks
+ to Jaco Kroon for all these bugfixes & improvements.
*asterisk-1.6.2.13 (15 Sep 2010)
diff --git a/net-misc/asterisk/asterisk-1.6.2.13-r1.ebuild b/net-misc/asterisk/asterisk-1.6.2.13-r1.ebuild
new file mode 100644
index 000000000000..06d4bff1e09b
--- /dev/null
+++ b/net-misc/asterisk/asterisk-1.6.2.13-r1.ebuild
@@ -0,0 +1,267 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.6.2.13-r1.ebuild,v 1.1 2010/09/16 17:31:54 chainsaw Exp $
+
+EAPI=3
+inherit autotools base eutils linux-info multilib
+
+MY_P="${PN}-${PV/_/-}"
+
+DESCRIPTION="Asterisk: A Modular Open Source PBX System"
+HOMEPAGE="http://www.asterisk.org/"
+SRC_URI="http://downloads.asterisk.org/pub/telephony/asterisk/releases/${MY_P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="alsa +caps dahdi debug doc freetds iconv jabber ldap lua keepsrc logrotate misdn newt +samples oss postgres radius snmp span speex ssl sqlite static vorbis"
+
+RDEPEND="sys-libs/ncurses
+ dev-libs/popt
+ sys-libs/zlib
+ alsa? ( media-libs/alsa-lib )
+ caps? ( sys-libs/libcap )
+ dahdi? ( >=net-libs/libpri-1.4.7
+ net-misc/dahdi-tools )
+ freetds? ( dev-db/freetds )
+ iconv? ( virtual/libiconv )
+ jabber? ( dev-libs/iksemel )
+ ldap? ( net-nds/openldap )
+ lua? ( dev-lang/lua )
+ misdn? ( net-dialup/misdnuser )
+ newt? ( dev-libs/newt )
+ postgres? ( dev-db/postgresql-base )
+ radius? ( net-dialup/radiusclient-ng )
+ snmp? ( net-analyzer/net-snmp )
+ span? ( media-libs/spandsp )
+ speex? ( media-libs/speex )
+ sqlite? ( dev-db/sqlite )
+ ssl? ( dev-libs/openssl )
+ vorbis? ( media-libs/libvorbis )"
+
+DEPEND="${RDEPEND}
+ !<net-misc/asterisk-addons-1.6
+ !net-misc/asterisk-chan_unistim
+ !net-misc/zaptel"
+
+PDEPEND="net-misc/asterisk-core-sounds
+ net-misc/asterisk-extra-sounds
+ net-misc/asterisk-moh-opsound"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}/1.6.2/${PN}-1.6.2.9-gsm-pic.patch"
+ "${FILESDIR}/1.6.2/${PN}-1.6.2.8-pri-missing-keyword.patch"
+ "${FILESDIR}/1.6.2/${PN}-1.6.2.8-inband-indications.patch"
+ "${FILESDIR}/1.6.1/${PN}-1.6.1-uclibc.patch"
+ "${FILESDIR}/1.6.2/${PN}-1.6.2.2-nv-faxdetect.patch"
+ "${FILESDIR}/1.6.2/${PN}-1.6.2.11-strip-noapi.patch"
+ "${FILESDIR}/1.6.2/${P}-iax2-peerstate.patch"
+ "${FILESDIR}/1.6.2/${P}-dahdiras-without-root.patch"
+ "${FILESDIR}/1.6.2/${P}-backport-bri-net-ptmp.patch"
+)
+
+pkg_setup() {
+ CONFIG_CHECK="~!NF_CONNTRACK_SIP"
+ local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
+ have reported that this module dropped critical SIP packets in their deployments. You
+ may want to disable it if you see such problems."
+ check_extra_config
+}
+
+src_prepare() {
+ base_src_prepare
+ AT_M4DIR=autoconf eautoreconf
+}
+
+src_configure() {
+ econf \
+ --libdir="/usr/$(get_libdir)" \
+ --localstatedir="/var" \
+ --with-gsm=internal \
+ --with-popt \
+ --with-z \
+ $(use_with alsa asound) \
+ $(use_with caps cap) \
+ $(use_with dahdi pri) \
+ $(use_with dahdi tonezone) \
+ $(use_with dahdi) \
+ $(use_with freetds tds) \
+ $(use_with iconv) \
+ $(use_with jabber iksemel) \
+ $(use_with lua) \
+ $(use_with misdn isdnnet) \
+ $(use_with misdn suppserv) \
+ $(use_with misdn) \
+ $(use_with newt) \
+ $(use_with oss) \
+ $(use_with postgres) \
+ $(use_with radius) \
+ $(use_with snmp netsnmp) \
+ $(use_with span spandsp) \
+ $(use_with speex) \
+ $(use_with speex speexdsp) \
+ $(use_with sqlite sqlite3) \
+ $(use_with ssl crypto) \
+ $(use_with ssl) \
+ $(use_with vorbis ogg) \
+ $(use_with vorbis) || die "econf failed"
+
+ #
+ # blank out sounds/sounds.xml file to prevent
+ # asterisk from installing sounds files (we pull them in via
+ # asterisk-{core,extra}-sounds and asterisk-moh-opsound.
+ #
+ >"${S}"/sounds/sounds.xml
+}
+
+src_compile() {
+ ASTLDFLAGS="${LDFLAGS}" emake || die "emake failed"
+}
+
+src_install() {
+ # setup directory structure
+ #
+ mkdir -p "${D}"usr/$(get_libdir)/pkgconfig
+
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ if use samples; then
+ emake DESTDIR="${D}" samples || die "emake samples failed"
+ for conffile in "${D}"etc/asterisk/*.*
+ do
+ chown asterisk:asterisk $conffile
+ chmod 0660 $conffile
+ done
+ einfo "Sample files have been installed"
+ else
+ einfo "Skipping installation of sample files..."
+ rm -f "${D}"var/lib/asterisk/mohmp3/*
+ rm -f "${D}"var/lib/asterisk/sounds/demo-*
+ rm -f "${D}"var/lib/asterisk/agi-bin/*
+ rm -f "${D}"etc/asterisk/*
+ fi
+ rm -rf "${D}"var/spool/asterisk/voicemail/default
+
+ # keep directories
+ diropts -m 0770 -o asterisk -g asterisk
+ keepdir /etc/asterisk
+ keepdir /var/lib/asterisk
+ keepdir /var/run/asterisk
+ keepdir /var/spool/asterisk
+ keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
+ diropts -m 0750 -o asterisk -g asterisk
+ keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
+
+ newinitd "${FILESDIR}"/1.6.2/asterisk.initd2 asterisk
+ newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk
+
+ # some people like to keep the sources around for custom patching
+ # copy the whole source tree to /usr/src/asterisk-${PVF} and run make clean there
+ if use keepsrc
+ then
+ dodir /usr/src
+
+ ebegin "Copying sources into /usr/src"
+ cp -dPR "${S}" "${D}"/usr/src/${PF} || die "Unable to copy sources"
+ eend $?
+
+ ebegin "Cleaning source tree"
+ emake -C "${D}"/usr/src/${PF} clean &>/dev/null || die "Unable to clean sources"
+ eend $?
+
+ einfo "Clean sources are available in "${ROOT}"usr/src/${PF}"
+ fi
+
+ # install the upgrade documentation
+ #
+ dodoc README UPGRADE* BUGS CREDITS
+
+ # install extra documentation
+ #
+ if use doc
+ then
+ dodoc doc/*.txt
+ dodoc doc/*.pdf
+ dodoc doc/PEERING
+ dodoc doc/CODING-GUIDELINES
+ dodoc doc/tex/*.pdf
+ fi
+
+ # install snmp mib files
+ #
+ if use snmp
+ then
+ insinto /usr/share/snmp/mibs/
+ doins doc/digium-mib.txt doc/asterisk-mib.txt
+ fi
+
+ # install SIP scripts; bug #300832
+ #
+ dodoc "${FILESDIR}/1.6.2/sip_calc_auth"
+ dodoc "${FILESDIR}/1.6.2/find_call_sip_trace.sh"
+ dodoc "${FILESDIR}/1.6.2/find_call_ids.sh"
+ dodoc "${FILESDIR}/1.6.2/call_data.txt"
+
+ # install logrotate snippet; bug #329281
+ #
+ if use logrotate
+ then
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/1.6.2/asterisk.logrotate2" asterisk
+ fi
+}
+
+pkg_preinst() {
+ enewgroup asterisk
+ enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
+}
+
+pkg_postinst() {
+ #
+ # Announcements, warnings, reminders...
+ #
+ einfo "Asterisk has been installed"
+ echo
+ elog "If you want to know more about asterisk, visit these sites:"
+ elog "http://www.asteriskdocs.org/"
+ elog "http://www.voip-info.org/wiki-Asterisk"
+ echo
+ elog "http://www.automated.it/guidetoasterisk.htm"
+ echo
+ elog "Gentoo VoIP IRC Channel:"
+ elog "#gentoo-voip @ irc.freenode.net"
+ echo
+ echo
+ elog "1.6.1 -> 1.6.2 changes that you may care about:"
+ elog "canreinvite -> directmedia (sip.conf)"
+ elog "extensive T.38 (fax) changes"
+ elog "http://svn.asterisk.org/svn/${PN}/tags/${PV}/UPGRADE.txt"
+ elog "or: bzless ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.bz2"
+}
+
+pkg_config() {
+ einfo "Do you want to reset file permissions and ownerships (y/N)?"
+
+ read tmp
+ tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
+
+ if [[ "$tmp" = "y" ]] ||\
+ [[ "$tmp" = "yes" ]]
+ then
+ einfo "Resetting permissions to defaults..."
+
+ for x in spool run lib log; do
+ chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
+ chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
+ done
+
+ chown -R root:asterisk "${ROOT}"etc/asterisk
+ chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
+
+ einfo "done"
+ else
+ einfo "skipping"
+ fi
+}
diff --git a/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-backport-bri-net-ptmp.patch b/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-backport-bri-net-ptmp.patch
new file mode 100644
index 000000000000..18f8dcce8090
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-backport-bri-net-ptmp.patch
@@ -0,0 +1,35 @@
+diff -uNr asterisk-1.6.2.13.ORIG//channels/chan_dahdi.c asterisk-1.6.2.13/channels/chan_dahdi.c
+--- asterisk-1.6.2.13.ORIG//channels/chan_dahdi.c 2010-09-16 18:25:04.000000000 +0100
++++ asterisk-1.6.2.13/channels/chan_dahdi.c 2010-09-16 18:25:21.000000000 +0100
+@@ -16630,7 +16630,12 @@
+ confp->chan.sig = SIG_BRI_PTMP;
+ confp->pri.nodetype = PRI_CPE;
+ } else if (!strcasecmp(v->value, "bri_net_ptmp")) {
++#if defined(HAVE_PRI_CALL_HOLD)
++ confp->chan.sig = SIG_BRI_PTMP;
++ confp->pri.nodetype = PRI_NETWORK;
++#else
+ ast_log(LOG_WARNING, "How cool would it be if someone implemented this mode! For now, sucks for you. (line %d)\n", v->lineno);
++#endif
+ } else if (!strcasecmp(v->value, "gr303fxoks_net")) {
+ confp->chan.sig = SIG_GR303FXOKS;
+ confp->pri.nodetype = PRI_NETWORK;
+diff -uNr asterisk-1.6.2.13.ORIG//configure.ac asterisk-1.6.2.13/configure.ac
+--- asterisk-1.6.2.13.ORIG//configure.ac 2010-09-16 18:25:04.000000000 +0100
++++ asterisk-1.6.2.13/configure.ac 2010-09-16 18:25:21.000000000 +0100
+@@ -334,6 +334,7 @@
+ AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio])
+ AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
+ AST_EXT_LIB_SETUP_DEPENDENT([PRI_INBANDDISCONNECT], [ISDN PRI set_inbanddisconnect], [PRI], [pri])
++AST_EXT_LIB_SETUP_DEPENDENT([PRI_CALL_HOLD], [ISDN PRI call hold], [PRI], [pri])
+ AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
+ AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
+ AST_EXT_LIB_SETUP([RESAMPLE], [LIBRESAMPLE], [resample])
+@@ -1490,6 +1491,7 @@
+ AST_EXT_LIB_CHECK([PORTAUDIO], [portaudio], [Pa_GetDeviceCount], [portaudio.h])
+
+ AST_EXT_LIB_CHECK([PRI], [pri], [pri_new_bri], [libpri.h])
++AST_EXT_LIB_CHECK([PRI_CALL_HOLD], [pri], [pri_hold_enable], [libpri.h])
+
+ AST_EXT_LIB_CHECK([PRI_PROG_W_CAUSE], [pri], [pri_progress_with_cause], [libpri.h])
+
diff --git a/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-dahdiras-without-root.patch b/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-dahdiras-without-root.patch
new file mode 100644
index 000000000000..94f3d3681288
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-dahdiras-without-root.patch
@@ -0,0 +1,12 @@
+diff -uNr asterisk-1.6.2.13.ORIG/apps/app_dahdiras.c asterisk-1.6.2.13/apps/app_dahdiras.c
+--- asterisk-1.6.2.13.ORIG/apps/app_dahdiras.c 2010-09-16 17:40:39.000000000 +0100
++++ asterisk-1.6.2.13/apps/app_dahdiras.c 2010-09-16 17:41:05.000000000 +0100
+@@ -119,8 +119,6 @@
+ c = strsep(&stringp, ",");
+ }
+
+- argv[argc++] = "plugin";
+- argv[argc++] = "dahdi.so";
+ argv[argc++] = "stdin";
+
+ /* Finally launch PPP */
diff --git a/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-iax2-peerstate.patch b/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-iax2-peerstate.patch
new file mode 100644
index 000000000000..c9eb8d579205
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-iax2-peerstate.patch
@@ -0,0 +1,12 @@
+diff -uNr asterisk-1.6.2.13.ORIG/channels/chan_iax2.c asterisk-1.6.2.13/channels/chan_iax2.c
+--- asterisk-1.6.2.13.ORIG/channels/chan_iax2.c 2010-09-16 13:18:19.000000000 +0100
++++ asterisk-1.6.2.13/channels/chan_iax2.c 2010-09-16 13:18:41.000000000 +0100
+@@ -8403,7 +8403,7 @@
+ ast_db_put("IAX/Registry", p->name, data);
+ ast_verb(3, "Registered IAX2 '%s' (%s) at %s:%d\n", p->name,
+ ast_test_flag(&iaxs[callno]->state, IAX_STATE_AUTHENTICATED) ? "AUTHENTICATED" : "UNAUTHENTICATED", ast_inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
+- manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: IAX2\r\nPeer: IAX2/%s\r\nPeerStatus: Registered\r\n", p->name);
++ manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: IAX2\r\nPeer: IAX2/%s\r\nPeerStatus: Registered\r\nAddress: %s\r\nPost: %d\r\n", p->name, ast_inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
+ register_peer_exten(p, 1);
+ ast_devstate_changed(AST_DEVICE_UNKNOWN, "IAX2/%s", p->name); /* Activate notification */
+ } else if (!ast_test_flag(p, IAX_TEMPONLY)) {
diff --git a/net-misc/asterisk/files/1.6.2/asterisk.logrotate2 b/net-misc/asterisk/files/1.6.2/asterisk.logrotate2
new file mode 100644
index 000000000000..4233d231665e
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.2/asterisk.logrotate2
@@ -0,0 +1,29 @@
+/var/log/asterisk/messages /var/log/asterisk/queue_log {
+ missingok
+ notifempty
+
+ postrotate
+ /usr/sbin/asterisk -rx "logger reload"
+ endscript
+}
+
+/var/log/asterisk/debug /var/log/asterisk/full {
+ missingok
+ notifempty
+ daily
+
+ postrotate
+ /usr/sbin/asterisk -rx "logger reload"
+ endscript
+}
+
+/var/log/asterisk/cdr-csv/*.csv /var/log/asterisk/cdr-custom/*.csv {
+ missingok
+ notifempty
+ weekly
+ rotate 52
+
+ postrotate
+ /usr/sbin/asterisk -rx "logger reload"
+ endscript
+}