summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-misc/asterisk/ChangeLog9
-rw-r--r--net-misc/asterisk/asterisk-1.2.0.ebuild (renamed from net-misc/asterisk/asterisk-1.2.0_beta1-r1.ebuild)108
-rw-r--r--net-misc/asterisk/files/1.2.0/asterisk-1.2.0_beta-ukcid.patch168
-rw-r--r--net-misc/asterisk/files/digest-asterisk-1.2.02
-rw-r--r--net-misc/asterisk/files/digest-asterisk-1.2.0_beta1-r12
5 files changed, 252 insertions, 37 deletions
diff --git a/net-misc/asterisk/ChangeLog b/net-misc/asterisk/ChangeLog
index 25ec9d1f9cbe..0b5423ff3541 100644
--- a/net-misc/asterisk/ChangeLog
+++ b/net-misc/asterisk/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-misc/asterisk
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.88 2005/11/08 15:35:21 stkn Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.89 2005/11/18 16:42:20 stkn Exp $
+
+*asterisk-1.2.0 (18 Nov 2005)
+
+ 18 Nov 2005; Stefan Knoblich <stkn@gentoo.org>
+ +files/1.2.0/asterisk-1.2.0_beta-ukcid.patch,
+ -asterisk-1.2.0_beta1-r1.ebuild, +asterisk-1.2.0.ebuild:
+ Version bumped and removed old beta ebuild
*asterisk-1.2.0_beta1-r1 (08 Nov 2005)
*asterisk-1.0.9-r2 (08 Nov 2005)
diff --git a/net-misc/asterisk/asterisk-1.2.0_beta1-r1.ebuild b/net-misc/asterisk/asterisk-1.2.0.ebuild
index 7227800d9e66..2c5722d1dc18 100644
--- a/net-misc/asterisk/asterisk-1.2.0_beta1-r1.ebuild
+++ b/net-misc/asterisk/asterisk-1.2.0.ebuild
@@ -1,14 +1,14 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.2.0_beta1-r1.ebuild,v 1.1 2005/11/08 15:35:21 stkn Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.2.0.ebuild,v 1.1 2005/11/18 16:42:20 stkn Exp $
inherit eutils
-IUSE="alsa doc gtk mmx mysql pri zaptel debug postgres odbc \
- hardened speex h323 sqlite nosamples osp lowmem curl"
+IUSE="alsa curl debug doc gtk h323 hardened lowmem mmx mysql \
+ nosamples odbc postgres pri speex sqlite ssl ukcid zaptel"
#BRI_VERSION="0.2.0-RC8f-CVS"
-AST_PATCHES="1.2.0_beta-patches-1.0"
+AST_PATCHES="1.2.0-patches-1.0"
## TODO:
#
@@ -16,7 +16,7 @@ AST_PATCHES="1.2.0_beta-patches-1.0"
# - bristuff (waiting...)
# - test nosamples
# - add some more use flags...
-# recent additions: osp, lowmem, curl
+# recent additions: osp, lowmem, curl, ukcid
# - cleanup
#
@@ -37,9 +37,9 @@ KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
RDEPEND="dev-libs/newt
media-sound/sox
media-sound/mpg123
+ ssl? ( dev-libs/openssl )
gtk? ( =x11-libs/gtk+-1.2* )
pri? ( >=net-libs/libpri-1.1.0 )
- osp? ( >=net-libs/osptoolkit-3.3.1 )
h323? ( >=dev-libs/pwlib-1.8.3
>=net-libs/openh323-1.15.0 )
alsa? ( media-libs/alsa-lib )
@@ -51,6 +51,8 @@ RDEPEND="dev-libs/newt
zaptel? ( >=net-misc/zaptel-1.1.0 )
postgres? ( dev-db/postgresql )"
+# osp? ( >=net-libs/osptoolkit-3.3.4 )
+
# bri? ( >=net-libs/libpri-1.1.0
# >=net-misc/zaptel-1.1.0 )
@@ -60,6 +62,23 @@ DEPEND="${RDEPEND}
doc? ( app-doc/doxygen )"
pkg_setup() {
+ ewarn " Asterisk UPGRADE Warning"
+ ewarn ""
+ ewarn "!!! Read ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.gz after installation !!!"
+ ewarn ""
+ ewarn " Asterisk UPGRADE Warning"
+ echo
+ einfo "Press Ctrl+C to abort"
+ echo
+ ebeep
+
+ n=10
+ while [[ $n -gt 0 ]]; do
+ echo -en " Waiting $n seconds...\r"
+ sleep 1
+ (( n-- ))
+ done
+
#
# Regular checks
#
@@ -77,6 +96,7 @@ pkg_setup() {
# die "Libpri without bri support detected"
# fi
# fi
+
}
src_unpack() {
@@ -101,11 +121,17 @@ src_unpack() {
fi
if ! use debug; then
- einfo "Disabling debugging"
+ einfo "Disabling debug support"
sed -i -e "s:^\(DEBUG=\):#\1:" \
Makefile
fi
+ if ! use ssl; then
+ einfo "Disabling crypto support"
+ sed -i -e "s:^#\(NOCRYPTO=yes\):\1:" \
+ Makefile
+ fi
+
#
# uclibc patch
#
@@ -115,6 +141,14 @@ src_unpack() {
fi
#
+ # ukcid patch from http://www.lusyn.com/asterisk/
+ #
+ if use ukcid; then
+ einfo "Patching asterisk for UK Callerid..."
+ epatch ${FILESDIR}/1.2.0/${PN}-1.2.0_beta-ukcid.patch
+ fi
+
+ #
# BRI patches
#
# if use bri; then
@@ -122,9 +156,6 @@ src_unpack() {
# einfo "Patching asterisk w/ BRI stuff"
# epatch ${WORKDIR}/bristuff-${BRI_VERSION}/patches/asterisk.patch
# fi
-
- # security fix, bug #11836
- epatch ${FILESDIR}/1.0.0/${PN}-1.0.9-vmail.cgi.patch
}
src_compile() {
@@ -213,7 +244,7 @@ src_install() {
# install standard docs...
dodoc BUGS CREDITS LICENSE ChangeLog HARDWARE README README.fpm
- dodoc SECURITY doc/CODING-GUIDELINES doc/linkedlists.README
+ dodoc SECURITY doc/CODING-GUIDELINES doc/linkedlists.README UPGRADE.txt
dodoc doc/README.*
dodoc doc/*.txt
@@ -268,31 +299,40 @@ pkg_postinst() {
echo
einfo "Gentoo VoIP IRC Channel:"
einfo "#gentoo-voip @ irc.freenode.net"
+ echo
+ echo
#
# Warning about security changes...
#
- ewarn "*********************** Important changes **************************"
- ewarn
- ewarn "- Asterisk runs as user asterisk, group asterisk by default"
- ewarn " Use usermod -G to make the asterisk user a member of additional"
- ewarn " groups if necessary."
- ewarn
- ewarn "- Permissions of /etc/asterisk have been changed to root:asterisk"
- ewarn " 750 (rwxr-x--- directories) / 640 (rw-r----- files)"
- ewarn
- ewarn "- Permissions of /var/{log,lib,run,spool}/asterisk have been changed"
- ewarn " to asterisk:asterisk 750 / 640"
- ewarn
- ewarn "- Asterisk's unix socket and pidfile are now in /var/run/astrisk"
- ewarn
- ewarn "- Asterisk cannot set the IP ToS bits when run as user,"
- ewarn " use something like this to make iptables set them for you:"
- ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --dport 5060 -j DSCP --set-dscp 0x28\""
- ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --sport 10000:20000 -j DSCP --set-dscp 0x28\""
- ewarn " (taken from voip-info.org comments (see below), thanks andrewid)"
- ewarn
- ewarn "For more details:"
- ewarn " http://bugs.gentoo.org/show_bug.cgi?id=88732"
- ewarn " http://www.voip-info.org/wiki-Asterisk+non-root"
+ ewarn " Asterisk UPGRADE Warning"
+ ewarn ""
+ ewarn "!!! Read ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.gz before continuing !!!"
+ ewarn ""
+ ewarn " Asterisk UPGRADE Warning"
+}
+
+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=rX,o= ${ROOT}var/${x}/asterisk
+ done
+
+ chown -R root:asterisk ${ROOT}etc/asterisk
+ chmod -R u=rwX,g=rX,o= ${ROOT}etc/asterisk
+
+ einfo "done"
+ else
+ einfo "skipping"
+ fi
}
diff --git a/net-misc/asterisk/files/1.2.0/asterisk-1.2.0_beta-ukcid.patch b/net-misc/asterisk/files/1.2.0/asterisk-1.2.0_beta-ukcid.patch
new file mode 100644
index 000000000000..f456c3a831e8
--- /dev/null
+++ b/net-misc/asterisk/files/1.2.0/asterisk-1.2.0_beta-ukcid.patch
@@ -0,0 +1,168 @@
+? asterisk_ukcid.diff
+Index: channels/chan_zap.c
+===================================================================
+RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
+retrieving revision 1.344.2.7
+diff -u -r1.344.2.7 chan_zap.c
+--- channels/chan_zap.c 27 Oct 2004 14:41:55 -0000 1.344.2.7
++++ channels/chan_zap.c 4 Nov 2004 21:05:03 -0000
+@@ -790,6 +790,14 @@
+ return 0;
+ }
+
++static int zt_get_history(int fd, void *buf, int buf_size)
++{
++ struct zt_history hist;
++ hist.buf=buf;
++ hist.len=buf_size;
++ return ioctl(fd, ZT_GET_HISTORY, &hist);
++}
++
+ static int alloc_sub(struct zt_pvt *p, int x)
+ {
+ ZT_BUFFERINFO bi;
+@@ -5114,6 +5122,120 @@
+ }
+ }
+ #endif
++ /* If we're using an X100P in the UK, caller ID needs to be extracted from
++ * the history buffer */
++ if (p->use_callerid && p->cid_start == CID_START_USEHIST) {
++ ast_log(LOG_DEBUG,"Using history buffer to extract UK caller ID\n");
++ cs = callerid_new(cid_signalling);
++ if (cs) {
++ unsigned char cidbuf[16384];
++ res=0;
++
++ res = zt_get_history(p->subs[index].zfd,cidbuf,sizeof(cidbuf));
++ if(res<0) {
++ ast_log(LOG_ERROR,"zt_get_history failed: %s\n", strerror(errno));
++ } else {
++ res=callerid_feed(cs,cidbuf,sizeof(cidbuf),AST_LAW(p));
++ if (res < 0) {
++ ast_log(LOG_WARNING, "CallerID feed failed: %s\n", strerror(errno));
++ }
++ }
++
++ if(res==1) {
++ callerid_get(cs, &name, &number, &flags);
++ if (option_debug)
++ ast_log(LOG_DEBUG, "CallerID number: %s, name: %s, flags=%d\n", number, name, flags);
++ }
++ }
++ if (p->usedistinctiveringdetection == 1) {
++#if 1
++ bump_gains(p);
++#endif
++ len = 0;
++ distMatches = 0;
++ /* Clear the current ring data array so we dont have old data in it. */
++ for (receivedRingT=0; receivedRingT < 3; receivedRingT++) {
++ curRingData[receivedRingT] = 0;
++ }
++ receivedRingT = 0;
++ counter = 0;
++ counter1 = 0;
++ /* Check to see if context is what it should be, if not set to be. */
++ if (strcmp(p->context,p->defcontext) != 0) {
++ strncpy(p->context, p->defcontext, sizeof(p->context)-1);
++ strncpy(chan->context,p->defcontext,sizeof(chan->context)-1);
++ }
++
++ for(;;) {
++ i = ZT_IOMUX_READ | ZT_IOMUX_SIGEVENT;
++ if ((res = ioctl(p->subs[index].zfd, ZT_IOMUX, &i))) {
++ ast_log(LOG_WARNING, "I/O MUX failed: %s\n", strerror(errno));
++ callerid_free(cs);
++ ast_hangup(chan);
++ return NULL;
++ }
++ if (i & ZT_IOMUX_SIGEVENT) {
++ res = zt_get_event(p->subs[index].zfd);
++ ast_log(LOG_NOTICE, "Got event %d (%s)...\n", res, event2str(res));
++ res = 0;
++ /* Let us detect distinctive ring */
++
++ curRingData[receivedRingT] = p->ringt;
++
++ if (p->ringt < ringt_base/2)
++ break;
++ ++receivedRingT; /* Increment the ringT counter so we can match it against
++ values in zapata.conf for distinctive ring */
++ } else if (i & ZT_IOMUX_READ) {
++ res = read(p->subs[index].zfd, buf, sizeof(buf));
++ if (res < 0) {
++ if (errno != ELAST) {
++ ast_log(LOG_WARNING, "read returned error: %s\n", strerror(errno));
++ callerid_free(cs);
++ ast_hangup(chan);
++ return NULL;
++ }
++ break;
++ }
++ if (p->ringt)
++ p->ringt--;
++ if (p->ringt == 1) {
++ res = -1;
++ break;
++ }
++ }
++ }
++ if(option_verbose > 2)
++ /* this only shows up if you have n of the dring patterns filled in */
++ ast_verbose( VERBOSE_PREFIX_3 "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
++
++ for (counter=0; counter < 3; counter++) {
++ /* Check to see if the rings we received match any of the ones in zapata.conf for this
++ channel */
++ distMatches = 0;
++ for (counter1=0; counter1 < 3; counter1++) {
++ if (curRingData[counter1] <= (p->drings.ringnum[counter].ring[counter1]+10) && curRingData[counter1] >=
++ (p->drings.ringnum[counter].ring[counter1]-10)) {
++ distMatches++;
++ }
++ }
++ if (distMatches == 3) {
++ /* The ring matches, set the context to whatever is for distinctive ring.. */
++ strncpy(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context)-1);
++ strncpy(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context)-1);
++ if(option_verbose > 2)
++ ast_verbose( VERBOSE_PREFIX_3 "Distinctive Ring matched context %s\n",p->context);
++ break;
++ }
++ }
++ }
++ /* Restore linear mode (if appropriate) for Caller*ID processing */
++ zt_setlinear(p->subs[index].zfd, p->subs[index].linear);
++#if 1
++ restore_gains(p);
++#endif
++ }
++
+ /* If we want caller id, we're in a prering state due to a polarity reversal
+ * and we're set to use a polarity reversal to trigger the start of caller id,
+ * grab the caller id and wait for ringing to start... */
+@@ -9178,6 +9300,8 @@
+ cid_start = CID_START_RING;
+ else if (!strcasecmp(v->value, "polarity"))
+ cid_start = CID_START_POLARITY;
++ else if (!strcasecmp(v->value, "usehist"))
++ cid_start = CID_START_USEHIST;
+ else if (ast_true(v->value))
+ cid_start = CID_START_RING;
+ } else if (!strcasecmp(v->name, "threewaycalling")) {
+Index: include/asterisk/callerid.h
+===================================================================
+RCS file: /usr/cvsroot/asterisk/include/asterisk/callerid.h,v
+retrieving revision 1.7
+diff -u -r1.7 callerid.h
+--- include/asterisk/callerid.h 19 Sep 2004 16:17:18 -0000 1.7
++++ include/asterisk/callerid.h 4 Nov 2004 21:05:04 -0000
+@@ -30,6 +30,7 @@
+
+ #define CID_START_RING 1
+ #define CID_START_POLARITY 2
++#define CID_START_USEHIST 3
+
+
+ #define AST_LIN2X(a) ((codec == AST_FORMAT_ALAW) ? (AST_LIN2A(a)) : (AST_LIN2MU(a)))
diff --git a/net-misc/asterisk/files/digest-asterisk-1.2.0 b/net-misc/asterisk/files/digest-asterisk-1.2.0
new file mode 100644
index 000000000000..8990081faf68
--- /dev/null
+++ b/net-misc/asterisk/files/digest-asterisk-1.2.0
@@ -0,0 +1,2 @@
+MD5 61d7f29b586ba9b9b5fbb67f952fd3ca asterisk-1.2.0.tar.gz 10464039
+MD5 0eeb5317bde267141c33ee5051e3b494 asterisk-1.2.0-patches-1.0.tar.bz2 7197
diff --git a/net-misc/asterisk/files/digest-asterisk-1.2.0_beta1-r1 b/net-misc/asterisk/files/digest-asterisk-1.2.0_beta1-r1
deleted file mode 100644
index 27af8bbc1b44..000000000000
--- a/net-misc/asterisk/files/digest-asterisk-1.2.0_beta1-r1
+++ /dev/null
@@ -1,2 +0,0 @@
-MD5 b87447c18dac12815c6869f755377056 asterisk-1.2.0-beta1.tar.gz 10278681
-MD5 2ab925ff8b092f3bff533972bdac8f42 asterisk-1.2.0_beta-patches-1.0.tar.bz2 9213