Asterisk and 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 `env - PATH=$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
Enviar a:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • BarraPunto
  • Meneame
  • Slashdot
  • Technorati
  • YahooMyWeb

Artículos relacionados (o no):

0 Responses to “ Asterisk and daemontools”


  1. No Comments
  1. 1 Jompeich d’er Bisente »Clusters de Asterisk con el foneBRIDGE2

Leave a Reply




Creative Commons Attribution-NonCommercial 2.5 Spain
Creative Commons Attribution-NonCommercial 2.5 Spain