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

@ -31,24 +31,45 @@ rtpengine=/usr/sbin/rtpengine
prog=rtpengine
pidfile=${PIDFILE-/var/run/rtpengine.pid}
lockfile=${LOCKFILE-/var/lock/subsys/rtpengine}
configfile=${CONFIG_FILE-/etc/rtpengine/rtpengine.conf}
cachefile=/var/lib/ngcp-rtpengine/rtpengine.cfg
PIDFILE=${pidfile}
RETVAL=0
OPTS=""
build_opts() {
# kernel table
shopt -s nocasematch
RPMS=$(rpm -qa | grep rtpengine-kernel)
if [[ "$KERNEL" == "yes" && -n "$TABLE" && -n "$RPMS" ]];then
MODULE=1
OPTS=" --table=$TABLE"
MODULE=0
# variable from sysconfig is prefer then config
if [[ -n "$TABLE" ]];then
OPTS+=" --table=$TABLE"
if [[ $TABLE -ge 0 ]];then
MODULE=1
fi
else
MODULE=0
OPTS=" --table=-1"
fi
# configfile exists?
if [ ! -f $configfile ];then
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"
shopt -u nocasematch
# error if directive is not presented in config
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
if [[ -n "$RTP_IP" ]];then
@ -60,6 +81,7 @@ build_opts() {
# options
[[ "$FORK" == "no" ]] && OPTS+=" --foreground"
[[ "$LOG_STDERR" == "yes" ]] && OPTS+=" --log-stderr"
[[ "$FALLBACK" != "yes" ]] && OPTS+=" --no-fallback"
[ -z "$CONFIG_FILE" ] || OPTS+=" --config-file=$CONFIG_FILE"
[ -z "$CONFIG_SECTION" ] || OPTS+=" --config-section=$CONFIG_SECTION"
[ -z "$ADDRESS" ] || OPTS+=" --interface=$ADDRESS"

@ -2,15 +2,14 @@
# http://github.com/sipwise/rtpengine
CONFIG_FILE=/etc/rtpengine/rtpengine.conf # main config file
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"
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].
#PIDFILE=/var/run/ngcp-rtpengine-daemon.pid # pid
#TABLE=0 # iptables table for in-kernel forwarding rules. Ignored if "KERNEL=no"
#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].
# 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_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_CLI=127.0.0.1:9900

Loading…
Cancel
Save