Change-Id: I7e6b8cdd4fce880c118791ead30b48f573e09b31
pull/578/head
Richard Fuchs 7 years ago
commit eac981c424

@ -31,24 +31,45 @@ rtpengine=/usr/sbin/rtpengine
prog=rtpengine prog=rtpengine
pidfile=${PIDFILE-/var/run/rtpengine.pid} pidfile=${PIDFILE-/var/run/rtpengine.pid}
lockfile=${LOCKFILE-/var/lock/subsys/rtpengine} lockfile=${LOCKFILE-/var/lock/subsys/rtpengine}
configfile=${CONFIG_FILE-/etc/rtpengine/rtpengine.conf}
cachefile=/var/lib/ngcp-rtpengine/rtpengine.cfg cachefile=/var/lib/ngcp-rtpengine/rtpengine.cfg
PIDFILE=${pidfile} PIDFILE=${pidfile}
RETVAL=0 RETVAL=0
OPTS=""
build_opts() { build_opts() {
# kernel table # kernel table
shopt -s nocasematch MODULE=0
RPMS=$(rpm -qa | grep rtpengine-kernel) # variable from sysconfig is prefer then config
if [[ "$KERNEL" == "yes" && -n "$TABLE" && -n "$RPMS" ]];then if [[ -n "$TABLE" ]];then
MODULE=1 OPTS+=" --table=$TABLE"
OPTS=" --table=$TABLE" if [[ $TABLE -ge 0 ]];then
MODULE=1
fi
else else
MODULE=0 # configfile exists?
OPTS=" --table=-1" if [ ! -f $configfile ];then
fi echo "Error: $configfile not present"
exit -1
fi
# get table variable from config
table="$(grep -Ei '^table' $configfile|cut -d\ -f3)"
if [ -z $table ];then
table="$(grep -Ei '^table' $configfile|cut -d= -f3)"
fi
[[ "$FALLBACK" != "yes" ]] && OPTS+=" --no-fallback" # error if directive is not presented in config
shopt -u nocasematch if [ -z $table ];then
echo "Error: directive table= is not present in $configfile"
exit -1
fi
# enable iptables module if derective set and positive
if [[ $table -ge 0 ]];then
MODULE=1
fi
fi
# interfaces # interfaces
if [[ -n "$RTP_IP" ]];then if [[ -n "$RTP_IP" ]];then
@ -60,6 +81,7 @@ build_opts() {
# options # options
[[ "$FORK" == "no" ]] && OPTS+=" --foreground" [[ "$FORK" == "no" ]] && OPTS+=" --foreground"
[[ "$LOG_STDERR" == "yes" ]] && OPTS+=" --log-stderr" [[ "$LOG_STDERR" == "yes" ]] && OPTS+=" --log-stderr"
[[ "$FALLBACK" != "yes" ]] && OPTS+=" --no-fallback"
[ -z "$CONFIG_FILE" ] || OPTS+=" --config-file=$CONFIG_FILE" [ -z "$CONFIG_FILE" ] || OPTS+=" --config-file=$CONFIG_FILE"
[ -z "$CONFIG_SECTION" ] || OPTS+=" --config-section=$CONFIG_SECTION" [ -z "$CONFIG_SECTION" ] || OPTS+=" --config-section=$CONFIG_SECTION"
[ -z "$ADDRESS" ] || OPTS+=" --interface=$ADDRESS" [ -z "$ADDRESS" ] || OPTS+=" --interface=$ADDRESS"

@ -2,15 +2,14 @@
# http://github.com/sipwise/rtpengine # http://github.com/sipwise/rtpengine
CONFIG_FILE=/etc/rtpengine/rtpengine.conf # main config file CONFIG_FILE=/etc/rtpengine/rtpengine.conf # main config file
PIDFILE=/var/run/ngcp-rtpengine-daemon.pid # pid #PIDFILE=/var/run/ngcp-rtpengine-daemon.pid # pid
KERNEL=yes # "yes" enable in-kernel forwarding, "no" disables #TABLE=0 # iptables table for in-kernel forwarding rules. Ignored if "KERNEL=no"
TABLE=0 # iptables table for in-kernel forwarding rules. Ignored if "KERNEL=no" #FALLBACK=yes # "yes" enables fallback to userspace forwarding only.
FALLBACK=yes # "yes" enables fallback to userspace forwarding only. #RTP_IP[0]=127.0.0.1 # Local IPv4/6 address for RTP. The format of the value is [NAME/]IP[!IP].
RTP_IP[0]=127.0.0.1 # Local IPv4/6 address for RTP. The format of the value is [NAME/]IP[!IP].
# At least one of LISTEN_(TCP|UDP|NG) is required # At least one of LISTEN_(TCP|UDP|NG) is required
#LISTEN_TCP=127.0.0.1:2222 # IP address and port combination for TCP control #LISTEN_TCP=127.0.0.1:2222 # IP address and port combination for TCP control
LISTEN_UDP=127.0.0.1:2222 # IP address and port combination for UDP control #LISTEN_UDP=127.0.0.1:2222 # IP address and port combination for UDP control
#LISTEN_NG=127.0.0.1:2223 # IP address and port combination for NG (UDP) control #LISTEN_NG=127.0.0.1:2223 # IP address and port combination for NG (UDP) control
#LISTEN_CLI=127.0.0.1:9900 #LISTEN_CLI=127.0.0.1:9900

Loading…
Cancel
Save