Please unblock asterisk 1.4.21.2~dfsg-2
Faidon Liambotis
paravoid at debian.org
Tue Oct 7 05:26:18 UTC 2008
Hi,
Please unblock asterisk 1.4.21.2~dfsg-2.
It contains the following changes:
asterisk (1:1.4.21.2~dfsg-2) unstable; urgency=low
[ Victor Seva ]
* support DEB_BUILD_OPTION noopt used to produce non-optimized builds.
(Closes: #492941).
* Depend on libcap2-dev instead of libcap-dev because libcap1 is no longer
maintained upstream. Thanks to Torsten Werner <twerner at debian.org>.
(Closes: #492620).
* Backport script fixes:
- Depend on debhelper >=5 on backport etch script.
- replace libcap2-dev by libcap-dev.
- remove lib-client2007b-dev. (Closes: #494405)
[ Tzafrir Cohen ]
* Patch chan_zap so that asterisk starts even without a Zaptel timing
source. (Closes: #491310)
[ Lionel Elie Mamane ]
* /etc/default/asterisk: Bring comments on AST_DUMPCORE_DIR in sync with
reality of implementation in /etc/init.d/asterisk. Change suggested
CORE_PATTERN to more secure ones.
* /etc/init.d/asterisk: Use the value of AST_DUMPCORE_DIR if it is a
directory, not if the value if DUMPCORE_DIR is a directory.
[ Faidon Liambotis ]
* Backport a patch from Xorcom's tree fixing a deadlock situation caused
by the bristuff patch. (Closes: #493055)
* Backport a patch from Xorcom's tree fixing an occasional "Cause 34" error
on BRIs.
* Don't write /root/.asterisk_history when stopping asterisk with the init
script. (Closes: #500294)
* Eliminate warnings when calling some actions of the init script by
replacing obsolete asterisk commands with their newer counterpart.
-- Faidon Liambotis <paravoid at debian.org> Sat, 04 Oct 2008 01:21:40 +0300
While this may seem huge, it's actually not that bad. I'll try to guide
you through the changes one by one, please bear with me...
--- tags/1.4.21.2~dfsg-1/debian/changelog
+++ tags/1.4.21.2~dfsg-2/debian/changelog
<snip, already mentioned>
--- tags/1.4.21.2~dfsg-1/debian/asterisk.default
+++ tags/1.4.21.2~dfsg-2/debian/asterisk.default
@@ -50,11 +50,16 @@
# CORE_PATTERN below.
#AST_DUMPCORE=yes
#
-# DUMPCORE_DIR: By default asterisk runs in the directory '/' like any
+# AST_DUMPCORE_DIR: By default asterisk runs in the directory '/' like any
# daemon. Setting this allows you to tell it to tell the
# Asterisk daemon to run in a different directory if
-# AST_DUMPCORE is enabled. The default is /tmp and is
-# probably a sane one.
+# AST_DUMPCORE is enabled. The default is
+# /var/spool/asterisk. That is a good choice because it
+# is writable (thus enabling the actual writing of the
+# core file) but relatively immune to symlink attacks
+# (because not world-writable like /tmp/).
+# Note, however, that if CORE_PATTERN is an absolute
+# path, it will override AST_DUMPCORE_DIR.
#
# CORE_PATTERN: If you use AST_DUMPCORE above, this is optionally set to a
# pattern of the core file. The default is not to touch the
@@ -68,6 +73,6 @@
# See http://lxr.linux.no/source/Documentation/sysctl/kernel.txt
# Here is what Asterisk's ast_grab_core
# script would expect:
-#CORE_PATTERN='/tmp/core.%p'
+#CORE_PATTERN='core.%p'
# But you might prefer something like:
-#CORE_PATTERN='/tmp/core.%e.%t'
+#CORE_PATTERN='core.%e.%t'
Just come comments so that users can help us debug stuff more easily.
--- tags/1.4.21.2~dfsg-1/debian/asterisk.init
+++ tags/1.4.21.2~dfsg-2/debian/asterisk.init
@@ -52,8 +52,7 @@ CHDIR_PARM=""
AST_REALTIME="yes"
RUNASTERISK="yes"
AST_DUMPCORE="no"
-AST_DUMPCORE_DIR="/tmp" # only used if AST_DUMPCORE != yes
-AST_DUMPCORE_DIR="/var/spool/asterisk"
+AST_DUMPCORE_DIR="/var/spool/asterisk" # only used if AST_DUMPCORE != no
# core_pattern. See: http://lxr.linux.no/source/Documentation/sysctl/kernel.txt
#CORE_PATTERN=
if [ -r /etc/default/$NAME ]; then . /etc/default/$NAME; fi
@@ -75,7 +74,7 @@ then
then
echo "$CORE_PATTERN" >/proc/sys/kernel/core_pattern
fi
- if [ -d "$DUMPCORE_DIR" ]
+ if [ -d "$AST_DUMPCORE_DIR" ]
then
CHDIR_PARM="--chdir $AST_DUMPCORE_DIR"
fi
@@ -138,7 +137,13 @@ status() {
Obvious mistake that renders the whole debugging stuff moot.
asterisk_rx() {
if ! status >/dev/null; then return 0; fi
- $DAEMON -rx "$1"
+
+ # if $HOME is set, asterisk -rx writes a .asterisk_history there
+ (
+ unset HOME
+
+ $DAEMON -rx "$1"
+ )
}
case "$1" in
@@ -184,7 +189,7 @@ case "$1" in
# this may hang in some cases. Specifically, when the asterisk
# processes is stopped. No bother to worry about cleanup:
# it will either fail or die when asterisk dies.
- ( $DAEMON -rx 'stop now' > /dev/null 2>&1 & ) &
+ ( asterisk_rx 'stop now' > /dev/null 2>&1 & ) &
if [ "$RUNASTSAFE" = "yes" ];then
start-stop-daemon --stop --quiet --oknodo \
--pidfile $ASTSAFE_PIDFILE
Avoids the creation of /root/.asterisk_history when stopping/reloading
(Closes: #500294) -- annoying the fix seems safe.
@@ -197,14 +202,14 @@ case "$1" in
;;
reload)
echo "Reloading $DESC configuration files."
- asterisk_rx 'reload'
+ asterisk_rx 'module reload'
;;
logger-reload)
asterisk_rx 'logger reload'
;;
- extensions-reload)
+ extensions-reload|dialplan-reload)
echo "Reloading $DESC configuration files."
- asterisk_rx 'extensions reload'
+ asterisk_rx 'dialplan reload'
;;
restart-convenient)
asterisk_rx 'restart when convenient'
Eliminates some "obsolete command" warnings.
--- tags/1.4.21.2~dfsg-1/debian/rules
+++ tags/1.4.21.2~dfsg-2/debian/rules
@@ -16,7 +16,11 @@ endif
export PROC := $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
-BUILDFLAGS += OPTIMIZE=-O2
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+ BUILDFLAGS += OPTIMIZE=-O0
+else
+ BUILDFLAGS += OPTIMIZE=-O2
+endif
BUILDFLAGS += MAKECMDGOALS=dont-optimize
# show full gcc arguments instead of [CC] and [LD]
Self-explanatory; we're proposing this for lenny because a) it doesn't
affect the binary packages b) can help us with users when debugging problems.
--- tags/1.4.21.2~dfsg-1/debian/control
+++ tags/1.4.21.2~dfsg-2/debian/control
@@ -3,7 +3,7 @@ Priority: optional
Section: comm
Maintainer: Debian VoIP Team <pkg-voip-maintainers at lists.alioth.debian.org>
Uploaders: Mark Purcell <msp at debian.org>, Kilian Krause <kilian at debian.org>, Tzafrir Cohen <tzafrir.cohen at xorcom.com>, Faidon Liambotis <paravoid at debian.org>
-Build-Depends: debhelper (>= 6.0.7), quilt, zlib1g-dev, libreadline5-dev, libgsm1-dev, libssl-dev, libtonezone-dev (>= 1:1.4.1~0), libasound2-dev, libpq-dev, unixodbc-dev, libpri-dev (>= 1.4.1), libvpb-dev, zaptel-source (>= 1:1.4.1~0), autotools-dev, libnewt-dev, libsqlite-dev, libspeex-dev, libspeexdsp-dev, graphviz, libcurl4-openssl-dev | libcurl-dev, doxygen, gsfonts, libpopt-dev, libopenh323-dev (>= 1.17.4), libiksemel-dev, libradiusclient-ng-dev, freetds-dev, libvorbis-dev, libsnmp-dev, libc-client2007b-dev, libcap-dev
+Build-Depends: debhelper (>= 6.0.7), quilt, zlib1g-dev, libreadline5-dev, libgsm1-dev, libssl-dev, libtonezone-dev (>= 1:1.4.1~0), libasound2-dev, libpq-dev, unixodbc-dev, libpri-dev (>= 1.4.1), libvpb-dev, zaptel-source (>= 1:1.4.1~0), autotools-dev, libnewt-dev, libsqlite-dev, libspeex-dev, libspeexdsp-dev, graphviz, libcurl4-openssl-dev | libcurl-dev, doxygen, gsfonts, libpopt-dev, libopenh323-dev (>= 1.17.4), libiksemel-dev, libradiusclient-ng-dev, freetds-dev, libvorbis-dev, libsnmp-dev, libc-client2007b-dev, libcap2-dev
Standards-Version: 3.7.3
Homepage: http://www.asterisk.org/
Vcs-Svn: svn://svn.debian.org/pkg-voip/asterisk/trunk/
This is the most debatable change IMHO; it's a switch from
libcap-dev to libcap2-dev and eliminates a kernel warning.
Maintainer says that it's 100% safe.
I asked around #debian-release and I didn't hear any disagreements (nor
explicit agreements though).
--- tags/1.4.21.2~dfsg-1/debian/backports/etch
+++ tags/1.4.21.2~dfsg-2/debian/backports/etch
<snip>
--- tags/1.4.21.2~dfsg-1/debian/backports/etch.xorcom
+++ tags/1.4.21.2~dfsg-2/debian/backports/etch.xorcom
<snip>
Ignore these, they don't affect the package in any way.
--- tags/1.4.21.2~dfsg-1/debian/patches/series
+++ tags/1.4.21.2~dfsg-2/debian/patches/series
@@ -81,3 +81,8 @@ bristuff/zapata-gsm
# bridging app backported from 1.6
# it needs the above feature patches applied first.
feature-bridge
+
+# bugfixes on top of everything
+zap-fix-timing-source
+zap-fix-deadlock
+zap-fix-cause34
These are actual code changes. They're fixing some important/serious
problems (deadlocks and/or lockups of the whole program) and they are
heavily tested for quite some time. This upload is being made mostly for
these.
--- tags/1.4.21.2~dfsg-1/debian/patches/zap-fix-cause34
+++ tags/1.4.21.2~dfsg-2/debian/patches/zap-fix-cause34
@@ -0,0 +1,23 @@
+fix "cause34" with BRI: reset 'call' when no call
+Reset the 'call' of a zaptel channel if failing to make a call.
+
+(commit 232eb51c7572d8f4d73649103d51d70643bd4ad9 on Xorcom's tree)
+
+ -- Faidon Liambotis <paravoid at debian.org>
+
+--- a/channels/chan_zap.c
++++ b/channels/chan_zap.c
+@@ -2735,11 +2735,12 @@ static int zt_hangup(struct ast_channel
+ /* if we send a rel9999ease complete we wont ge no hangup event, so clear the call here */
+ if (icause == 34 || icause == 44 || icause == 82 || icause == 1 || icause == 81 || icause == 17) {
+ if ((ast->_state == AST_STATE_RING) || (ast->_state == AST_STATE_RINGING) || (ast->_state == AST_STATE_DIALING) || (ast->_state == AST_STATE_RESERVED)) {
+- p->call = NULL;
++ /* no-op */
+ } else {
+ ast_log(LOG_ERROR, "What is wrong with you? You cannot use cause %d number when in state %d!\n", icause, ast->_state);
+ icause = 16; /* Note, in pri_hangup() libpri will already override the cause */
+ }
++ p->call = NULL;
+ }
+
+ if (p->pri->nodetype == BRI_NETWORK_PTMP) {
--- tags/1.4.21.2~dfsg-1/debian/patches/zap-fix-deadlock
+++ tags/1.4.21.2~dfsg-2/debian/patches/zap-fix-deadlock
@@ -0,0 +1,33 @@
+Backport a bristuff deadlock fix from changes made to chan_dahdi by Tzafrir.
+(commit ccd11da0599c190f5b678aed3f164579ca873c71 on Xorcom's tree)
+
+ -- Faidon Liambotis <paravoid at debian.org>
+
+--- a/channels/chan_zap.c
++++ b/channels/chan_zap.c
+@@ -8851,7 +8851,7 @@ static void *pri_dchannel(void *vpri)
+ int haveidles;
+ int activeidles;
+ int nextidle = -1;
+- struct ast_channel *c;
++ struct ast_channel *c = NULL;
+ struct timeval tv, lowest, *next;
+ struct timeval lastidle = { 0, 0 };
+ int doidling=0;
+@@ -9590,6 +9590,7 @@ static void *pri_dchannel(void *vpri)
+ snprintf(calledtonstr, sizeof(calledtonstr)-1, "%d", e->ring.calledplan);
+ pbx_builtin_setvar_helper(c, "CALLEDTON", calledtonstr);
+
++ ast_mutex_lock(&c->lock);
+ ast_mutex_lock(&pri->pvts[chanpos]->lock);
+ ast_mutex_lock(&pri->lock);
+
+@@ -9637,6 +9638,8 @@ static void *pri_dchannel(void *vpri)
+ if (crv)
+ ast_mutex_unlock(&crv->lock);
+ ast_mutex_unlock(&pri->pvts[chanpos]->lock);
++ if (c)
++ ast_mutex_unlock(&c->lock);
+ } else {
+ if (e->ring.flexible)
+ pri_hangup(pri->pri, e->ring.call, PRI_CAUSE_NORMAL_CIRCUIT_CONGESTION, -1);
--- tags/1.4.21.2~dfsg-1/debian/patches/zap-fix-timing-source
+++ tags/1.4.21.2~dfsg-2/debian/patches/zap-fix-timing-source
@@ -0,0 +1,18 @@
+Don't quit just because we don't have a good Zaptel timing source.
+See http://bugs.debian.org/491310
+
+ -- Tzafrir Cohen <tzafrir.cohen at xorcom.com>
+
+--- a/main/asterisk.c
++++ b/main/asterisk.c
+@@ -2985,8 +2985,8 @@ int main(int argc, char *argv[])
+ "\n\t2. You only have to load Zaptel drivers if you want to take advantage of Zaptel services. One option is to unload zaptel modules if you don't need them."
+ "\n\t3. If you need Zaptel services, you must correctly configure Zaptel."
+ };
+- ast_log(LOG_ERROR, "%s\n", zaptel_timer_error);
+- exit(1);
++ ast_log(LOG_WARNING, "%s\n", zaptel_timer_error);
++ ast_log(LOG_WARNING, "However, on Debian we don't quit that easily. See http://bugs.debian.org/491310\n");
+ }
+ close(fd);
+ }
Thanks,
Faidon
More information about the Pkg-voip-maintainers
mailing list