@ -3,9 +3,10 @@
# Provides: ngcp-rtpengine-daemon
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: sshd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Ngcp Mediaproxy-ng
# Short-Description: Ngcp Rtpengine
# Description: Proxy for RTP and other media streams
### END INIT INFO
@ -68,12 +69,27 @@ fi
case "$1" in
start)
set +e
if [ -x "/usr/sbin/ngcp-check_active" ]; then
/usr/sbin/ngcp-check_active -q
status=$?
case "${status}" in
0|3)
echo "Active node or transition."
;;
*)
echo "Ignored start action in inactive node ($status)"
exit 0
;;
esac
fi
echo -n "Starting $DESC: $NAME"
if [ $TABLE -ge 0 ]; then \
if [ $TABLE -ge 0 ] && ! /usr/sbin/ngcp-virt-identify --type container ; then
set +e
modprobe xt_MEDIAPROXY
if [ -e /proc/mediaproxy/control ]; then
echo "del $TABLE" > /proc/mediaproxy/control 2>/dev/null
fi
iptables -N mediaproxy 2> /dev/null
iptables -D INPUT -j mediaproxy 2> /dev/null
iptables -I INPUT -j mediaproxy
@ -97,9 +113,11 @@ case "$1" in
if [ "$?" -ne 0 ]; then
return $?
fi
if [ $TABLE -ge 0 ]; then \
if [ $TABLE -ge 0 ] && ! /usr/sbin/ngcp-virt-identify --type container ; then
set +e
if [ -e /proc/mediaproxy/control ]; then
echo "del $TABLE" > /proc/mediaproxy/control 2>/dev/null
fi
iptables -D INPUT -j mediaproxy 2> /dev/null
iptables -D mediaproxy -p udp -j MEDIAPROXY --id $TABLE 2>/dev/null
ip6tables -D INPUT -j mediaproxy 2> /dev/null
@ -119,7 +137,20 @@ case "$1" in
return $?
fi
rm -f $PIDFILE
if [ $TABLE -ge 0 ]; then \
if [ -x "/usr/sbin/ngcp-check_active" ]; then
/usr/sbin/ngcp-check_active -q
status=$?
case "${status}" in
0|3)
echo "Active node or transition."
;;
*)
echo "Ignored start action in inactive node ($status)"
exit 0
;;
esac
fi
if [ $TABLE -ge 0 ] && ! /usr/sbin/ngcp-virt-identify --type container; then
sleep 1
set +e
if [ -e /proc/mediaproxy/control ]; then