kamailio/rc.kamailio

Sat, 24 Mar 2012 21:40:49 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 24 Mar 2012 21:40:49 +0100
changeset 414
fd611cde817f
parent 389
3cce61ce5fdd
permissions
-rw-r--r--

Introduce many changes to the buildconf and source code including:
(01) clean up, update, and partially update default config files,
(02) seems that Melware is unable to perform release engineering so
update chan_capi to new daily snapshot to solve echo problems,
(03) correct Asterisk inadequate hard coded gmime version check,
(04) force postgresql pthreads linkage to solve build problem,
(05) remove buggy hard coded LibXML configure definitions,
(06) remove local architecture specification to allow GCC
internal logic to determine proper CPU type instead,
(07) remove vendor sound install target causing uncontrolled
downloads and non RPM managed file installation,
(08) solve long outstanding bug in tcptls causing Asterisk
to ignore any intermediate CA certificate signatures,
(09) back out Digium engineering team's bright idea of replacing the
very portable and pervasive POSIX rand(1) with ast_random(), and
then not even implementing it causing all references to fail in
platforms not providing the very new POSIX.1-2008 mkdtemp(3)
function only distributed by BSD and some Linux,
(10) withdraw advanced linker symbol manipulations from SVR5 builds
until either Binutils supports hybrid versioned and anonymous
linker scripts or GCC stops hard coding versioned linker scripts,
(11) correct missing library linkage, some tailored to a specific OS,
(12) remove outdated logic for the no longer distributed gmime-config(1),
(13) remove local gmime buildconf hacks now that Asterisk has corrected
their own build configuration to almost portably support gmime,
(14) solve build problems relating to undetected LibXML paths,
(15) correct erroneous out of tree include definitions,
(16) improve some variable and comment naming,
(17) simplify sound language path hierarchy creation,
and correct australian english installation logic.

michael@389 1 #!@l_prefix@/bin/openpkg rc
michael@389 2 ##
michael@389 3 ## rc.kamailio -- Run-Commands
michael@389 4 ##
michael@389 5
michael@389 6 %config
michael@389 7 kamailio_enable="$openpkg_rc_def"
michael@389 8 kamailio_log_prolog="true"
michael@389 9 kamailio_log_epilog="true"
michael@389 10 kamailio_log_numfiles="10"
michael@389 11 kamailio_log_minsize="1M"
michael@389 12 kamailio_log_complevel="9"
michael@389 13
michael@389 14 %common
michael@389 15 kamailio_cfgfile="@l_prefix@/etc/kamailio/kamailio.cfg"
michael@389 16 kamailio_pidfile="@l_prefix@/var/kamailio/kamailio.pid"
michael@389 17 kamailio_signal () {
michael@389 18 [ -f $kamailio_pidfile ] && kill -$1 `cat $kamailio_pidfile`
michael@389 19 }
michael@389 20
michael@389 21 %status -u @l_susr@ -o
michael@389 22 kamailio_usable="no"
michael@389 23 kamailio_active="no"
michael@389 24 if @l_prefix@/sbin/kamailio -c >/dev/null 2>&1; then
michael@389 25 kamailio_usable="yes"
michael@389 26 fi
michael@389 27 if rcService kamailio enable yes && kamailio_signal 0; then
michael@389 28 kamailio_active="yes"
michael@389 29 fi
michael@389 30 echo "kamailio_enable=\"$kamailio_enable\""
michael@389 31 echo "kamailio_usable=\"$kamailio_usable\""
michael@389 32 echo "kamailio_active=\"$kamailio_active\""
michael@389 33
michael@389 34 %start -u @l_susr@
michael@389 35 rcService kamailio enable yes || exit 0
michael@389 36 rcService kamailio active yes && exit 0
michael@408 37 @l_prefix@/sbin/kamctl start
michael@389 38
michael@389 39 %stop -u @l_susr@
michael@389 40 rcService kamailio enable yes || exit 0
michael@389 41 rcService kamailio active no && exit 0
michael@408 42 @l_prefix@/sbin/kamctl stop
michael@389 43 rm -f $kamailio_pidfile 2>/dev/null || true
michael@389 44 sleep 2
michael@389 45
michael@389 46 %restart -u @l_susr@
michael@389 47 rcService kamailio enable yes || exit 0
michael@389 48 rcService kamailio active no && exit 0
michael@389 49 rc kamailio stop start
michael@389 50
michael@389 51 %daily -u @l_susr@
michael@389 52 rcService kamailio enable yes || exit 0
michael@389 53 shtool rotate -f \
michael@389 54 -n ${kamailio_log_numfiles} -s ${kamailio_log_minsize} -d \
michael@389 55 -z ${kamailio_log_complevel} -m 644 -o @l_rusr@ -g @l_rgrp@ \
michael@389 56 -P "${kamailio_log_prolog}" \
michael@389 57 -E "${kamailio_log_epilog}; rc kamailio reload" \
michael@389 58 @l_prefix@/var/kamailio/kamailio.log
michael@389 59

mercurial