Asterisk y daemontools









  • english
  • spanish

I’ve just released my daemontools “run” scripts for Asterisk. They are here: asterisk-daemontools [README]

The scripts let you configure via variables on the “env” dir the PATH to the Asterisk exec, the user and group to launch it with, and the startup options you want to pass it. About running Asterisk with a given user, I’ve found problems with Asterisk 1.2 and the -U and -G options, so the scripts only use those options if you’re running Asterisk 1.4 and revert to “su” otherwise.

There’s also a script forFlash Operator Panel‘s “fopserver”.

I’m using these scripts on several Asterisk 1.2 and 1.4 servers with FreePBX.

Read the full article to see the “run” scripts.

/service/asterisk/run:

#!/bin/sh
#
# Asterisk daemontools startup and monitoring scripts
# by Vicente Aguilar
# http://www.bisente.com
#
exec 2>&1

# source the environemt in ./env
[ -d "env" ] &&
eval `envPATH=$PATH envdir ./env awk
BEGIN { for (i in ENVIRON)
if (i != "PATH") {
printf "export %s=\"%s\"\n", i, ENVIRON[i]
}
}’
`

# defaults
ASTERISK=${ASTERISK:=/usr/sbin/asterisk}
USER=${USER:=asterisk}
GROUP=${GROUP:=asterisk}
OPTIONS=${OPTIONS:=-vvvg}
VERSION=`$ASTERISK -V | cut -d  -f2 | cut -d. -f1-2`

# run
if [ "$VERSION" == "1.4" ]
then
exec $ASTERISK -U $USER -G $GROUP $OPTIONS -f
else
exec su -c "$ASTERISK $OPTIONS -f" $USER
f

/service/fopserver/run:

#!/bin/sh
#
# Asterisk daemontools startup and monitoring scripts
# by Vicente Aguilar
# http://www.bisente.com
#
source /etc/amportal.conf
exec 2>&1
$FOPWEBROOT/op_server.pl

2 thoughts on “Asterisk y daemontools

  1. Pingback: Jompeich d’er Bisente »Clusters de Asterisk con el foneBRIDGE2

  2. ¿Sabías que con Osmius puedes monitorizar fácilmente Asterisk? Al ser un producto Open Source podrías incluso programarte tú cosas especificas de monitorización de Asterisk.

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos necesarios están marcados *

*

Puedes usar las siguientes etiquetas y atributos HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Acceder con Facebook
Acceder