mirror of
https://github.com/openwrt/telephony.git
synced 2025-05-21 11:19:46 +08:00

rtpengine is a proxy for RTP traffic. It has lots of capabilities, including transcoding, in-kernel forwarding and SRTP transport, to name a few. Packaging: 1. regular rtpengine 2. rtpengine variant without transcoding support (smaller dependency tree) 3. recording daemon 4. kernel module 5. iptables module Simple init scripts (procd) are included, plus a hotplug script for rtpengine. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
52 lines
945 B
Bash
52 lines
945 B
Bash
#!/bin/sh /etc/rc.common
|
|
|
|
START=91
|
|
|
|
NAME=rtpengine-recording
|
|
COMMAND="/usr/bin/$NAME"
|
|
|
|
USE_PROCD=1
|
|
|
|
#PROCD_DEBUG=1
|
|
|
|
LOGGER="/usr/bin/logger -t $NAME"
|
|
LOG_ERR="$LOGGER -p user.err -s"
|
|
|
|
run_instance() {
|
|
procd_open_instance
|
|
procd_set_param command $COMMAND
|
|
procd_append_param command \
|
|
--config-file=/etc/rtpengine/$NAME.conf \
|
|
--config-section="$2" \
|
|
$3 \
|
|
-f
|
|
# forward all output to logd
|
|
procd_set_param stderr 1
|
|
procd_set_param stdout 1
|
|
procd_set_param pidfile "/var/run/$NAME-$1.pid"
|
|
procd_set_param user rtpengine
|
|
procd_close_instance
|
|
|
|
$LOGGER instance "$1" has started
|
|
}
|
|
|
|
handle_instance() {
|
|
config_get opts "$1" opts
|
|
config_get section "$1" section
|
|
|
|
run_instance "$1" "$section" "$opts"
|
|
}
|
|
|
|
start_service() {
|
|
config_load $NAME
|
|
|
|
config_get_bool enabled global enabled 0
|
|
|
|
if [ "$enabled" -eq 1 ]; then
|
|
config_foreach handle_instance instance
|
|
else
|
|
$LOG_ERR service not enabled
|
|
$LOG_ERR edit /etc/config/$NAME
|
|
fi
|
|
}
|