Updating asterisk init script in tutorial

This commit is contained in:
DanB
2016-09-04 15:57:50 +02:00
parent 44b9598082
commit 4a1eec5058
16 changed files with 31 additions and 16 deletions

View File

View File

View File

@@ -1,13 +1,11 @@
[directories]
astetcdir => /usr/share/cgrates/tutorials/asterisk_events/asterisk/etc/asterisk
astspooldir => /tmp/cgr_astevents/asterisk/spool
astlogdir => /tmp/cgr_astevents/asterisk/log
astrundir => /tmp/cgr_astevents/asterisk/run
[options]
; If we want to start Asterisk with a default verbosity for the verbose
; or debug logger channel types, then we use these settings (by default
; they are disabled).
;verbose = 5
;debug = 2
runuser = asterisk ; The user to run as. The default is root.
rungroup = asterisk ; The group to run as. The default is root
; User and group to run asterisk as. NOTE: This will require changes to
; directory and device permissions.
;runuser = asterisk ; The user to run as. The default is root.
;rungroup = asterisk ; The group to run as. The default is root
;defaultlanguage = es

View File

View File

View File

View File

View File

View File

View File

@@ -19,7 +19,7 @@
; default is 60 seconds.
;
[general]
enabled = no
enabled = yes
;webenabled = yes
port = 5038

View File

View File

View File

View File

View File

View File

@@ -20,11 +20,18 @@
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=asterisk
DESC="Asterisk PBX"
TUTDIR=/usr/share/cgrates/tutorials/asterisk_events/asterisk
TMP_DIR=/tmp/cgr_astevents/asterisk
# Full path to asterisk binary
DAEMON=__ASTERISK_SBIN_DIR__/asterisk
ASTVARRUNDIR=__ASTERISK_VARRUN_DIR__
ASTETCDIR=__ASTERISK_ETC_DIR__
DAEMON=/usr/sbin/asterisk
ASTVARRUNDIR=$TMP_DIR/run
LOGDIR=$TMP_DIR/log
SPOOLDIR=$TMP_DIR/spool
ALTCONF=$TUTDIR/etc/asterisk/asterisk.conf
TRUE=/bin/true
AST_USER="asterisk"
AST_GROUP="asterisk"
### BEGIN INIT INFO
# Provides: asterisk
@@ -50,6 +57,16 @@ if ! [ -d $ASTETCDIR ] ; then
exit 0
fi
if [ ! -d $LOGDIR ]; then
mkdir -p $LOGDIR
chown -R $AST_USER:$AST_GROUP $LOGDIR
fi
if [ ! -d $SPOOLDIR ]; then
mkdir -p $SPOOLDIR
chown -R $AST_USER:$AST_GROUP $SPOOLDIR
fi
# Use the LSB standard functions for services management
. /lib/lsb/init-functions
@@ -77,7 +94,7 @@ case "$1" in
mkdir -p $ASTVARRUNDIR
fi
if [ $AST_USER ] ; then
ASTARGS="-U $AST_USER"
ASTARGS="$ASTARGS -U $AST_USER"
chown $AST_USER $ASTVARRUNDIR
fi
if [ $AST_GROUP ] ; then
@@ -85,7 +102,7 @@ case "$1" in
chgrp $AST_GROUP $ASTVARRUNDIR
fi
if [ $ALTCONF ]; then
ASTARGS="$ASTARGS -C \"$ALTCONF\""
ASTARGS="$ASTARGS -C $ALTCONF"
fi
if [ "x$COREDUMP" = "xyes" ]; then
ASTARGS="$ASTARGS -g"