-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
32 lines (28 loc) · 813 Bytes
/
entrypoint.sh
File metadata and controls
32 lines (28 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# entrypoint.sh
# Dynamic Variables
INTERFACE=${INTERFACE:-eth0}
PUBLIC_IP=${PUBLIC_IP:-$(hostname -I | cut -d' ' -f1)}
LISTEN_PORT=${LISTEN_PORT:-22222}
MIN_PORT=${MIN_PORT:-30000}
MAX_PORT=${MAX_PORT:-50000}
RECORDING_DIR=${RECORDING_DIR:-/var/spool/rtpengine}
echo "Starting RTPengine on Ubuntu 24.04..."
echo "Binding to: $INTERFACE / $PUBLIC_IP"
# If we are using kernel mode (optional), we pass --table=0
# Otherwise, default to userspace
ARGS=""
if [ "$KERNEL_MODE" = "yes" ]; then
ARGS="--table=0"
echo "Kernel forwarding ENABLED"
fi
exec rtpengine \
--interface=$INTERFACE/$PUBLIC_IP \
--listen-ng=$LISTEN_PORT \
--port-min=$MIN_PORT \
--port-max=$MAX_PORT \
--recording-dir=$RECORDING_DIR \
--log-level=6 \
--log-stderr \
--foreground \
$ARGS