rtpengine build mr12.5.1 镜像

debian 版本

cat Dockerfile:

复制代码
FROM debian:bookworm-20230725 

RUN apt-get update && \
	apt-get dist-upgrade gnupg2 apt-utils lsb-release cmake curl iproute2 ca-certificates gcc g++ make build-essential libavfilter-dev \
    libevent-dev libpcap-dev libxmlrpc-core-c3-dev \
    libjson-glib-dev default-libmysqlclient-dev libhiredis-dev libssl-dev libopus-dev libmnl-dev libip6tc-dev libip4tc-dev libxtables-dev libiptc-dev libnftnl-dev\
    libcurl4-openssl-dev libavcodec-extra gperf libspandsp-dev libwebsockets-dev \
	git markdown pandoc \
	libbencode-perl libconfig-tiny-perl libcrypt-rijndael-perl libdigest-hmac-perl libio-socket-inet6-perl -yq

RUN cd /usr/src && git clone https://github.com/BelledonneCommunications/bcg729.git && cd /usr/src/bcg729 && cmake . &&  make && make install
RUN cd /usr/src && git clone https://github.com/sipwise/rtpengine.git -b mr12.5.1 && cd /usr/src/rtpengine/daemon && make && make install && cp /usr/src/rtpengine/utils/rtpengine-ctl /usr/bin

RUN cd / && rm -rf /usr/src/rtpengine /usr/src/bcg729

现在 rtpengine-ctl 可以用了

不过, build 出来有点大

回头研究下 alpine


顺便分享下 rtpengine.conf 样本:

rtpengine

table = 0

no-fallback = false

for userspace forwarding only:

table = -1

a single interface:

interface = lo

separate multiple interfaces with semicolons:

interface = internal/12.23.34.45;external/23.34.45.54

for different advertised address:

interface = 12.23.34.45!23.34.45.56

interface = any

listen-ng = localhost:2223

listen-tcp = 25060

listen-udp = 12222

interface for HTTP, WS and Prometheus

listen-http = 9101

listen-http = localhost:2225

listen-https = localhost:2226

https-cert =

https-key =

listen-cli = localhost:2224

timeout = 60

silent-timeout = 3600

tos = 184

control-tos = 184

control-pmtu = dont

delete-delay = 30

final-timeout = 10800

endpoint-learning = heuristic

reject-invalid-sdp = false

foreground = false

pidfile = /run/ngcp-rtpengine-daemon.pid

num-threads = 16

media-num-threads = 8

http-threads = 4

port-min = 30000

port-max = 40000

max-sessions = 5000

software-id = rtpengine

max-load = 5

max-cpu = 90

max-bandwidth = 10000000

scheduling = default

priority = -3

idle-scheduling = idle

idle-priority = 10

recording-dir = /var/spool/rtpengine

recording-method = proc

recording-format = raw

redis = 127.0.0.1:6379/5

redis-write = [email protected]:6379/42

redis-num-threads = 8

no-redis-required = false

redis-expires = 86400

redis-allowed-errors = -1

redis-disable-time = 10

redis-cmd-timeout = 0

redis-connect-timeout = 1000

b2b-url = http://127.0.0.1:8090/

xmlrpc-format = 0

janus-secret = ABC123

log-level = 6

log-stderr = false

log-facility = daemon

log-facility-cdr = local0

log-facility-rtcp = local1

debug-srtp = false

log-srtp-keys = false

dtls-cert-cipher = prime256v1

dtls-rsa-key-size = 2048

dtls-mtu = 1200

dtls-signature = sha-256

dtls-ciphers = DEFAULT:!NULL:!aNULL:!SHA256:!SHA384:!aECDH:!AESGCM+AES256:!aPSK

dtmf-no-log-injects = 0

graphite = 127.0.0.1:9006

graphite-interval = 60

graphite-prefix = foobar.

homer = 123.234.345.456:65432

homer-protocol = udp

homer-id = 2001

mysql-host = localhost

mysql-port = 3306

mysql-user = mysql

myser-pass = mysql

mysql-query = select data from voip.files where id = %llu

dtx-delay = 50

max-dtx = 600

dtx-buffer = 5

dtx-lag = 100

dtx-shift = 0

amr-dtx = native

dtx-cn-params = 60

silence-detect = 0.05

cn-payload = 60

sip-source = false

dtls-passive = false

mqtt-host = localhost

mqtt-port = 1883

mqtt-tls-alpn = mqtt

mqtt-id =

mqtt-user = foo

mqtt-pass = bar

mqtt-capath =

mqtt-cafile =

mqtt-certfile =

mqtt-keyfile =

mqtt-publish-qos = 0

mqtt-publish-topic = rtpengine

mqtt-publish-interval = 5000

mqtt-publish-scope = media

mos = CQ

poller-per-thread = false

socket-cpu-affinity = -1

rtcp-interval = 5000

rtpengine-testing

table = -1

interface = 10.15.20.121

listen-ng = 2223

foreground = true

log-stderr = true

log-level = 7


试试 alpine

cat Dockerfile:

复制代码
FROM alpine:3.21 AS builder
RUN apk --update add build-base git pkgconf perl gperf glib-dev ffmpeg-dev openssl-dev \
    libevent-dev libpcap-dev spandsp-dev json-glib-dev hiredis-dev xmlrpc-c-dev opus-dev libwebsockets-dev\
    mariadb-connector-c-dev cmake libmnl-dev libnftnl-dev pandoc markdown
RUN git clone https://github.com/sipwise/rtpengine -b mr12.5.1 && \
	git clone https://github.com/BelledonneCommunications/bcg729 && \
	cd bcg729 && cmake . && make && make install && cd .. && \
	cd rtpengine/daemon && with_iptables_option=no make

FROM alpine:3.21
RUN apk --update add build-base glib-dev ffmpeg-dev openssl-dev \
    libevent-dev libpcap-dev spandsp-dev json-glib-dev hiredis-dev xmlrpc-c-dev opus-dev libwebsockets-dev\
    mariadb-connector-c-dev libmnl-dev libnftnl-dev 
COPY --from=builder /rtpengine/daemon/rtpengine /usr/bin
# COPY --from=builder /usr/local/lib64/libbcg729.so.0 /usr/lib/
相关推荐
码农101号2 小时前
Linux中shell编程表达式和数组讲解
linux·运维·服务器
powerfulzyh2 小时前
非Root用户启动SSH服务经验小结
运维·ssh
云道轩2 小时前
升级centos 7.9内核到 5.4.x
linux·运维·centos
爱学习的小道长3 小时前
Ubuntu Cursor升级成v1.0
linux·运维·ubuntu
EelBarb3 小时前
seafile:ubuntu搭建社区版seafile12.0
linux·运维·ubuntu
402 Payment Required3 小时前
serv00 ssh登录保活脚本-邮件通知版
运维·chrome·ssh
小柏ぁ3 小时前
calico/node is not ready: BIRD is not ready: BGP not established with xxx
运维·docker·kubernetes
Mintimate3 小时前
云服务器 Linux 手动 DD 安装第三方 Linux 发行版:原理与实战
linux·运维·服务器
RussellFans3 小时前
Linux 环境配置
linux·运维·服务器
高冷的肌肉码喽4 小时前
Linux-进程间的通信
linux·运维·服务器