From 9958e7cd82501f77dd3a0f236adeef2be32e6a60 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 6 Apr 2023 13:03:56 -0400 Subject: [PATCH 01/25] remove rtpengine.conf --- Dockerfile | 25 +++++++++++++++++++------ rtpengine.conf | 13 ------------- 2 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 rtpengine.conf diff --git a/Dockerfile b/Dockerfile index df46570..acdc40f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,29 @@ -FROM debian:stretch +FROM debian:buster RUN apt-get update \ && apt-get -y --quiet --force-yes upgrade curl iproute2 \ - && apt-get install -y --no-install-recommends ca-certificates gcc g++ make build-essential git iptables-dev libavfilter-dev \ + && apt-get install -y --no-install-recommends ca-certificates gcc g++ make cmake build-essential git iptables-dev libavfilter-dev \ libevent-dev libpcap-dev libxmlrpc-core-c3-dev markdown \ libjson-glib-dev default-libmysqlclient-dev libhiredis-dev libssl-dev \ - libcurl4-openssl-dev libavcodec-extra gperf libspandsp-dev libwebsockets-dev\ + libcurl4-openssl-dev libavcodec-extra gperf libspandsp-dev \ && cd /usr/local/src \ - && git clone https://github.com/sipwise/rtpengine.git \ + && git clone https://github.com/BelledonneCommunications/bcg729.git \ + && cd bcg729 \ + && echo "building bcg729" \ + && cmake . -DCMAKE_INSTALL_PREFIX=/usr && make && make install \ + && cd /usr/local/src \ + && git clone https://github.com/warmcat/libwebsockets.git -b v3.2.3 \ + && cd /usr/local/src/libwebsockets \ + && echo "building libwebsockets" \ + && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make && make install \ + && git clone https://github.com/sipwise/rtpengine.git -b mr9.3.1.8 \ + && echo "searching for libwebsockets" \ + && find /usr -name libwebsockets.so \ && cd rtpengine/daemon \ - && make && make install \ - && cp /usr/local/src/rtpengine/daemon/rtpengine /usr/local/bin/rtpengine \ + && echo "building rtpengine" \ + && make with_transcoding=yes \ + && find . -name rtpengine \ + && cp rtpengine /usr/local/bin/rtpengine \ && rm -Rf /usr/local/src/rtpengine \ && apt-get purge -y --quiet --force-yes --auto-remove \ ca-certificates gcc g++ make build-essential git markdown \ diff --git a/rtpengine.conf b/rtpengine.conf deleted file mode 100644 index a2dae72..0000000 --- a/rtpengine.conf +++ /dev/null @@ -1,13 +0,0 @@ -[rtpengine] -interface=MY_IP -foreground=true -log-stderr=true -listen-ng=MY_IP:22222 -port-min=23000 -port-max=32768 -recording-dir=/tmp -recording-method=pcap -recording-format=eth -log-level=6 -delete-delay=0 -listen-http=MY_IP:8080 From c4a270e69b1cdabcb2c529e4d8656f0138b11467 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Fri, 5 Nov 2021 13:04:21 -0400 Subject: [PATCH 02/25] more WIP --- Dockerfile | 2 -- entrypoint.sh | 28 ++++++++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index acdc40f..4a5385a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,8 +40,6 @@ EXPOSE 23000-32768/udp 22222/udp COPY ./entrypoint.sh /entrypoint.sh -COPY ./rtpengine.conf /etc - ENTRYPOINT ["/entrypoint.sh"] CMD ["rtpengine"] diff --git a/entrypoint.sh b/entrypoint.sh index 78d4370..1ccd58f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -28,17 +28,33 @@ case $CLOUD in ;; esac -if [ -n "$PUBLIC_IP" ]; then - MY_IP="$LOCAL_IP"!"$PUBLIC_IP" -else - MY_IP=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'` +if [ -z "$PUBLIC_IP" ]; then + LOCAL_IP=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'` + PUBLIC_IP=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'` fi -sed -i -e "s/MY_IP/$MY_IP/g" /etc/rtpengine.conf +if [ -z "$RTP_START_PORT" ]; then + RTP_START_PORT=40000 +fi +if [ -z "$RTP_END_PORT" ]; then + RTP_END_PORT=60000 +fi +if [ -z "$LOGLEVEL" ]; then + LOGLEVEL=7 +fi + +echo "LOGLEVEL is $LOGLEVEL" if [ "$1" = 'rtpengine' ]; then shift - exec rtpengine --config-file /etc/rtpengine.conf "$@" + echo "starting rtpengine" + echo "rtpengine --interface private/${LOCAL_IP} --interface public/${LOCAL_IP}'!'${PUBLIC_IP} --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --recording-dir /tmp --recording-method pcap --recording-format eth --log-level ${LOGLEVEL} --delete-delay 0 $@" + exec rtpengine --interface private/${LOCAL_IP} --interface "public/${LOCAL_IP}'!'${PUBLIC_IP}" --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --recording-dir /tmp --recording-method pcap --recording-format eth --log-level ${LOGLEVEL} --delete-delay 0 +else + exec "$@" fi +<<<<<<< HEAD exec "$@" +======= +>>>>>>> edd8a2f (more WIP) From 543e834f4088636d5d609282176c06efb62d196e Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Fri, 5 Nov 2021 13:27:36 -0400 Subject: [PATCH 03/25] first working version for jambonz needs --- Dockerfile | 1 + entrypoint.sh | 9 ++++----- rtpengine.conf | 8 ++++++++ 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 rtpengine.conf diff --git a/Dockerfile b/Dockerfile index 4a5385a..cb3c669 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,6 +39,7 @@ VOLUME ["/tmp"] EXPOSE 23000-32768/udp 22222/udp COPY ./entrypoint.sh /entrypoint.sh +COPY ./rtpengine.conf /etc/rtpengine.conf ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 1ccd58f..b2d633d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -40,16 +40,15 @@ if [ -z "$RTP_END_PORT" ]; then RTP_END_PORT=60000 fi if [ -z "$LOGLEVEL" ]; then - LOGLEVEL=7 + LOGLEVEL=6 fi -echo "LOGLEVEL is $LOGLEVEL" +sed -i -e "s/LOCAL_IP/$LOCAL_IP/g" /etc/rtpengine.conf +sed -i -e "s/PUBLIC_IP/$PUBLIC_IP/g" /etc/rtpengine.conf if [ "$1" = 'rtpengine' ]; then shift - echo "starting rtpengine" - echo "rtpengine --interface private/${LOCAL_IP} --interface public/${LOCAL_IP}'!'${PUBLIC_IP} --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --recording-dir /tmp --recording-method pcap --recording-format eth --log-level ${LOGLEVEL} --delete-delay 0 $@" - exec rtpengine --interface private/${LOCAL_IP} --interface "public/${LOCAL_IP}'!'${PUBLIC_IP}" --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --recording-dir /tmp --recording-method pcap --recording-format eth --log-level ${LOGLEVEL} --delete-delay 0 + exec rtpengine --config-file /etc/rtpengine.conf --log-level ${LOGLEVEL} --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --recording-dir /tmp --recording-method pcap --recording-format eth --delete-delay 0 --log-stderr --foreground $@ else exec "$@" fi diff --git a/rtpengine.conf b/rtpengine.conf new file mode 100644 index 0000000..ee07f4e --- /dev/null +++ b/rtpengine.conf @@ -0,0 +1,8 @@ +[rtpengine] +interface=private/LOCAL_IP +interface=public/LOCAL_IP!PUBLIC_IP + + + + + From 498429f199fc6c0240b69066ba8fe330c56a3025 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 8 Dec 2021 13:42:28 -0500 Subject: [PATCH 04/25] update to latest rtpengine, eliminate config file --- Dockerfile | 3 +-- entrypoint.sh | 5 +---- rtpengine.conf | 8 -------- 3 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 rtpengine.conf diff --git a/Dockerfile b/Dockerfile index cb3c669..be18e23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get update \ && cd /usr/local/src/libwebsockets \ && echo "building libwebsockets" \ && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make && make install \ - && git clone https://github.com/sipwise/rtpengine.git -b mr9.3.1.8 \ + && git clone https://github.com/sipwise/rtpengine.git -b mr10.2.1.1 \ && echo "searching for libwebsockets" \ && find /usr -name libwebsockets.so \ && cd rtpengine/daemon \ @@ -39,7 +39,6 @@ VOLUME ["/tmp"] EXPOSE 23000-32768/udp 22222/udp COPY ./entrypoint.sh /entrypoint.sh -COPY ./rtpengine.conf /etc/rtpengine.conf ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index b2d633d..5c0ef6d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -43,12 +43,9 @@ if [ -z "$LOGLEVEL" ]; then LOGLEVEL=6 fi -sed -i -e "s/LOCAL_IP/$LOCAL_IP/g" /etc/rtpengine.conf -sed -i -e "s/PUBLIC_IP/$PUBLIC_IP/g" /etc/rtpengine.conf - if [ "$1" = 'rtpengine' ]; then shift - exec rtpengine --config-file /etc/rtpengine.conf --log-level ${LOGLEVEL} --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --recording-dir /tmp --recording-method pcap --recording-format eth --delete-delay 0 --log-stderr --foreground $@ + exec rtpengine --interface private/${LOCAL_IP} --interface public/${PUBLIC_IP} --log-level ${LOGLEVEL} --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --recording-dir /tmp --recording-method pcap --recording-format eth --delete-delay 0 --log-stderr --foreground $@ else exec "$@" fi diff --git a/rtpengine.conf b/rtpengine.conf deleted file mode 100644 index ee07f4e..0000000 --- a/rtpengine.conf +++ /dev/null @@ -1,8 +0,0 @@ -[rtpengine] -interface=private/LOCAL_IP -interface=public/LOCAL_IP!PUBLIC_IP - - - - - From 3a91341ebbef6a4ce172bb8faf769b771b1f2e3f Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 8 Dec 2021 14:38:48 -0500 Subject: [PATCH 05/25] added port range to cmd line args --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 5c0ef6d..22220e9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -45,7 +45,7 @@ fi if [ "$1" = 'rtpengine' ]; then shift - exec rtpengine --interface private/${LOCAL_IP} --interface public/${PUBLIC_IP} --log-level ${LOGLEVEL} --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --recording-dir /tmp --recording-method pcap --recording-format eth --delete-delay 0 --log-stderr --foreground $@ + exec rtpengine --interface private/${LOCAL_IP} --interface public/${PUBLIC_IP} --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --log-level ${LOGLEVEL} --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --recording-dir /tmp --recording-method pcap --recording-format eth --delete-delay 0 --log-stderr --foreground $@ else exec "$@" fi From af821041c8096fe054ed7f557c16c8a9c97ac798 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 8 Dec 2021 15:17:46 -0500 Subject: [PATCH 06/25] formatting --- Dockerfile | 2 +- entrypoint.sh | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index be18e23..29709ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM debian:buster RUN apt-get update \ && apt-get -y --quiet --force-yes upgrade curl iproute2 \ && apt-get install -y --no-install-recommends ca-certificates gcc g++ make cmake build-essential git iptables-dev libavfilter-dev \ - libevent-dev libpcap-dev libxmlrpc-core-c3-dev markdown \ + libevent-dev libpcap-dev libxmlrpc-core-c3-dev markdown \ libjson-glib-dev default-libmysqlclient-dev libhiredis-dev libssl-dev \ libcurl4-openssl-dev libavcodec-extra gperf libspandsp-dev \ && cd /usr/local/src \ diff --git a/entrypoint.sh b/entrypoint.sh index 22220e9..84132e0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -45,7 +45,19 @@ fi if [ "$1" = 'rtpengine' ]; then shift - exec rtpengine --interface private/${LOCAL_IP} --interface public/${PUBLIC_IP} --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --log-level ${LOGLEVEL} --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --recording-dir /tmp --recording-method pcap --recording-format eth --delete-delay 0 --log-stderr --foreground $@ + exec rtpengine \ + --interface private/${LOCAL_IP} --interface public/${PUBLIC_IP} \ + --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} \ + --log-level ${LOGLEVEL} --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} \ + --listen-ng=22222 --listen-http=8080 --listen-udp=12222 \ + --dtmf-log-dest=127.0.0.1:22223 \ + --listen-cli=127.0.0.1:9900 \ + --pidfile /var/run/rtpengine.pid \ + --recording-dir /tmp --recording-method pcap --recording-format eth \ + --delete-delay 0 \ + --log-stderr \ + --foreground \ + $@ else exec "$@" fi From 1a4b633d2a4aef9bd08b9b2ccbf120cd70840b06 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Fri, 10 Dec 2021 12:44:40 -0500 Subject: [PATCH 07/25] fix typo --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 84132e0..f3ac32d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -46,7 +46,7 @@ fi if [ "$1" = 'rtpengine' ]; then shift exec rtpengine \ - --interface private/${LOCAL_IP} --interface public/${PUBLIC_IP} \ + --interface private/${LOCAL_IP} --interface public/${LOCAL_IP}!${PUBLIC_IP} \ --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} \ --log-level ${LOGLEVEL} --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} \ --listen-ng=22222 --listen-http=8080 --listen-udp=12222 \ From aa83ce9290c1938018f2769ca347b7a2e35fa1b3 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Fri, 28 Jan 2022 10:11:20 -0500 Subject: [PATCH 08/25] update to rtpengine mr10.2.1.5 and add support for IMSv2 on aws --- Dockerfile | 4 ++-- entrypoint.sh | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 29709ab..87ab89c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get update \ && cd /usr/local/src/libwebsockets \ && echo "building libwebsockets" \ && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make && make install \ - && git clone https://github.com/sipwise/rtpengine.git -b mr10.2.1.1 \ + && git clone https://github.com/sipwise/rtpengine.git -b mr10.2.1.5 \ && echo "searching for libwebsockets" \ && find /usr -name libwebsockets.so \ && cd rtpengine/daemon \ @@ -36,7 +36,7 @@ RUN apt-get update \ VOLUME ["/tmp"] -EXPOSE 23000-32768/udp 22222/udp +EXPOSE 40000-60000/udp 22222/udp COPY ./entrypoint.sh /entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh index f3ac32d..96df0f0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -9,8 +9,13 @@ case $CLOUD in PUBLIC_IP=$(curl -s -H "Metadata-Flavor: Google" http://metadata/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip) ;; aws) - LOCAL_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4) - PUBLIC_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4) + if [ -z "$IMDSv2" ]; then + LOCAL_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4) + PUBLIC_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4) + else + LOCAL_IP=$(TOKEN=`curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` && curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/local-ipv4) + PUBLIC_IP=$(TOKEN=`curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` && curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/public-ipv4) + fi ;; scaleway) LOCAL_IP=$(curl -s --local-port 1-1024 http://169.254.42.42/conf | grep PRIVATE_IP | cut -d = -f 2) @@ -40,7 +45,7 @@ if [ -z "$RTP_END_PORT" ]; then RTP_END_PORT=60000 fi if [ -z "$LOGLEVEL" ]; then - LOGLEVEL=6 + LOGLEVEL=5 fi if [ "$1" = 'rtpengine' ]; then From 2bba255e4f5dacfed40c616d6140838e6f9ae514 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Tue, 25 Jan 2022 10:17:50 -0500 Subject: [PATCH 09/25] entrypoint.sh handle IMDSv2 on aws --- entrypoint.sh | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 96df0f0..6ec0513 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -48,26 +48,13 @@ if [ -z "$LOGLEVEL" ]; then LOGLEVEL=5 fi +echo "LOGLEVEL is $LOGLEVEL" + if [ "$1" = 'rtpengine' ]; then shift - exec rtpengine \ - --interface private/${LOCAL_IP} --interface public/${LOCAL_IP}!${PUBLIC_IP} \ - --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} \ - --log-level ${LOGLEVEL} --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} \ - --listen-ng=22222 --listen-http=8080 --listen-udp=12222 \ - --dtmf-log-dest=127.0.0.1:22223 \ - --listen-cli=127.0.0.1:9900 \ - --pidfile /var/run/rtpengine.pid \ - --recording-dir /tmp --recording-method pcap --recording-format eth \ - --delete-delay 0 \ - --log-stderr \ - --foreground \ - $@ + echo "starting rtpengine" + echo "rtpengine --interface private/${LOCAL_IP} --interface public/${LOCAL_IP}'!'${PUBLIC_IP} --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --recording-dir /tmp --recording-method pcap --recording-format eth --log-level ${LOGLEVEL} --delete-delay 0 $@" + exec rtpengine --interface private/${LOCAL_IP} --interface "public/${LOCAL_IP}'!'${PUBLIC_IP}" --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --recording-dir /tmp --recording-method pcap --recording-format eth --log-level ${LOGLEVEL} --delete-delay 0 else exec "$@" fi -<<<<<<< HEAD - -exec "$@" -======= ->>>>>>> edd8a2f (more WIP) From 19c5402483e06b4d8a4be253daaf0a7b0f857ce4 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Fri, 28 Jan 2022 10:12:59 -0500 Subject: [PATCH 10/25] remove logging --- Dockerfile | 4 ---- LICENSE | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 87ab89c..e994e68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,13 +14,9 @@ RUN apt-get update \ && cd /usr/local/src \ && git clone https://github.com/warmcat/libwebsockets.git -b v3.2.3 \ && cd /usr/local/src/libwebsockets \ - && echo "building libwebsockets" \ && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make && make install \ && git clone https://github.com/sipwise/rtpengine.git -b mr10.2.1.5 \ - && echo "searching for libwebsockets" \ - && find /usr -name libwebsockets.so \ && cd rtpengine/daemon \ - && echo "building rtpengine" \ && make with_transcoding=yes \ && find . -name rtpengine \ && cp rtpengine /usr/local/bin/rtpengine \ diff --git a/LICENSE b/LICENSE index 96a7461..cee71aa 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 Dave Horton +Copyright (c) 2017-2022 Dave Horton Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 4adb4fed2c1222c0501cbedeff6a50189d0aaad6 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 30 Mar 2022 12:18:43 -0400 Subject: [PATCH 11/25] entrypoint: fix for digital ocean --- entrypoint.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6ec0513..f9cabfb 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,6 +7,8 @@ case $CLOUD in gcp) LOCAL_IP=$(curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip) PUBLIC_IP=$(curl -s -H "Metadata-Flavor: Google" http://metadata/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip) + PRIVATE_INTERFACE="private/${LOCAL_IP}" + PUBLIC_INTERFACE="public/${LOCAL_IP}!${PUBLIC_IP}" ;; aws) if [ -z "$IMDSv2" ]; then @@ -16,6 +18,8 @@ case $CLOUD in LOCAL_IP=$(TOKEN=`curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` && curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/local-ipv4) PUBLIC_IP=$(TOKEN=`curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` && curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/public-ipv4) fi + PRIVATE_INTERFACE="private/${LOCAL_IP}" + PUBLIC_INTERFACE="public/${LOCAL_IP}!${PUBLIC_IP}" ;; scaleway) LOCAL_IP=$(curl -s --local-port 1-1024 http://169.254.42.42/conf | grep PRIVATE_IP | cut -d = -f 2) @@ -24,10 +28,14 @@ case $CLOUD in digitalocean) LOCAL_IP=$(curl -s http://169.254.169.254/metadata/v1/interfaces/private/0/ipv4/address) PUBLIC_IP=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address) + PRIVATE_INTERFACE="private/${LOCAL_IP}" + PUBLIC_INTERFACE="public/${PUBLIC_IP}" ;; azure) LOCAL_IP=$(curl -H Metadata:true "http://169.254.169.254/metadata/instance/network/interface/0/ipv4/ipAddress/0/privateIpAddress?api-version=2017-08-01&format=text") PUBLIC_IP=$(curl -H Metadata:true "http://169.254.169.254/metadata/instance/network/interface/0/ipv4/ipAddress/0/publicIpAddress?api-version=2017-08-01&format=text") + PRIVATE_INTERFACE="private/${LOCAL_IP}" + PUBLIC_INTERFACE="public/${LOCAL_IP}!${PUBLIC_IP}" ;; *) ;; @@ -36,6 +44,8 @@ esac if [ -z "$PUBLIC_IP" ]; then LOCAL_IP=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'` PUBLIC_IP=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'` + PRIVATE_INTERFACE="private/${LOCAL_IP}" + PUBLIC_INTERFACE="public/${LOCAL_IP}!${PUBLIC_IP}" fi if [ -z "$RTP_START_PORT" ]; then @@ -52,9 +62,19 @@ echo "LOGLEVEL is $LOGLEVEL" if [ "$1" = 'rtpengine' ]; then shift - echo "starting rtpengine" - echo "rtpengine --interface private/${LOCAL_IP} --interface public/${LOCAL_IP}'!'${PUBLIC_IP} --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --recording-dir /tmp --recording-method pcap --recording-format eth --log-level ${LOGLEVEL} --delete-delay 0 $@" - exec rtpengine --interface private/${LOCAL_IP} --interface "public/${LOCAL_IP}'!'${PUBLIC_IP}" --listen-ng=22222 --listen-http=8080 --listen-udp=12222 --dtmf-log-dest=127.0.0.1:22223 --listen-cli=127.0.0.1:9900 --pidfile /var/run/rtpengine.pid --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} --recording-dir /tmp --recording-method pcap --recording-format eth --log-level ${LOGLEVEL} --delete-delay 0 + exec rtpengine \ + --interface ${PRIVATE_INTERFACE} --interface ${PUBLIC_INTERFACE} \ + --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} \ + --log-level ${LOGLEVEL} --port-min ${RTP_START_PORT} --port-max ${RTP_END_PORT} \ + --listen-ng=22222 --listen-http=8080 --listen-udp=12222 \ + --dtmf-log-dest=127.0.0.1:22223 \ + --listen-cli=127.0.0.1:9900 \ + --pidfile /var/run/rtpengine.pid \ + --recording-dir /tmp --recording-method pcap --recording-format eth \ + --delete-delay 0 \ + --log-stderr \ + --foreground \ + $@ else exec "$@" fi From 4aa773af401906e3f51c7dd528271f2b73960ce9 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 10 Aug 2022 13:29:26 +0200 Subject: [PATCH 12/25] update rtpengine version to mr10.4.1.4 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e994e68..4d5e1ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get update \ && git clone https://github.com/warmcat/libwebsockets.git -b v3.2.3 \ && cd /usr/local/src/libwebsockets \ && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make && make install \ - && git clone https://github.com/sipwise/rtpengine.git -b mr10.2.1.5 \ + && git clone https://github.com/sipwise/rtpengine.git -b mr10.4.1.4 \ && cd rtpengine/daemon \ && make with_transcoding=yes \ && find . -name rtpengine \ From 17561a6dc4578c9d278ebfaefd9a7f4e0798d9a7 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Fri, 26 Aug 2022 22:54:45 +0200 Subject: [PATCH 13/25] update to rtpengine mr10.5.1.3 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4d5e1ed..b6e667a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get update \ && git clone https://github.com/warmcat/libwebsockets.git -b v3.2.3 \ && cd /usr/local/src/libwebsockets \ && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make && make install \ - && git clone https://github.com/sipwise/rtpengine.git -b mr10.4.1.4 \ + && git clone https://github.com/sipwise/rtpengine.git -b mr10.5.1.3 \ && cd rtpengine/daemon \ && make with_transcoding=yes \ && find . -name rtpengine \ From 685791023a21f673f1442c31552a25f7db31adbb Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Mon, 31 Oct 2022 10:47:43 -0400 Subject: [PATCH 14/25] update to rtpengine mr11.1.1.1 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b6e667a..df1b847 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:buster +FROM debian:buster-slim RUN apt-get update \ && apt-get -y --quiet --force-yes upgrade curl iproute2 \ @@ -15,7 +15,7 @@ RUN apt-get update \ && git clone https://github.com/warmcat/libwebsockets.git -b v3.2.3 \ && cd /usr/local/src/libwebsockets \ && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make && make install \ - && git clone https://github.com/sipwise/rtpengine.git -b mr10.5.1.3 \ + && git clone https://github.com/sipwise/rtpengine.git -b mr11.1.1.1 \ && cd rtpengine/daemon \ && make with_transcoding=yes \ && find . -name rtpengine \ From 6dee87db3ab11fef4d7c54d4ab3077d82d646dc9 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 16 Feb 2023 09:30:13 -0500 Subject: [PATCH 15/25] update to rtpengine mr11.2.1.2 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index df1b847..5e98422 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get update \ && git clone https://github.com/warmcat/libwebsockets.git -b v3.2.3 \ && cd /usr/local/src/libwebsockets \ && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make && make install \ - && git clone https://github.com/sipwise/rtpengine.git -b mr11.1.1.1 \ + && git clone https://github.com/sipwise/rtpengine.git -b mr11.2.1.2 \ && cd rtpengine/daemon \ && make with_transcoding=yes \ && find . -name rtpengine \ From e34844da091611e80ec279481740804e0cb01e4b Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 16 Feb 2023 09:52:23 -0500 Subject: [PATCH 16/25] updates for debian bullseye --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5e98422..87aa977 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,17 @@ -FROM debian:buster-slim +FROM debian:bullseye-slim RUN apt-get update \ + && apt-get remove --auto-remove nftables \ + && apt-get purge nftables \ && apt-get -y --quiet --force-yes upgrade curl iproute2 \ - && apt-get install -y --no-install-recommends ca-certificates gcc g++ make cmake build-essential git iptables-dev libavfilter-dev \ + && apt-get install -y --no-install-recommends ca-certificates gcc g++ make cmake build-essential git libavfilter-dev \ libevent-dev libpcap-dev libxmlrpc-core-c3-dev markdown \ libjson-glib-dev default-libmysqlclient-dev libhiredis-dev libssl-dev \ libcurl4-openssl-dev libavcodec-extra gperf libspandsp-dev \ + libxtables-dev libip6tc-dev libip4tc-dev libiptc-dev \ + libjpeg-dev libsqlite3-dev libpcre3-dev libldns-dev \ + libspeex-dev libspeexdsp-dev libedit-dev libtiff-dev yasm libswscale-dev haveged \ + libopus-dev libopusfile-dev libsndfile-dev libshout3-dev libmpg123-dev libmp3lame-dev \ && cd /usr/local/src \ && git clone https://github.com/BelledonneCommunications/bcg729.git \ && cd bcg729 \ From 7a554ff45c73be838d64caddbadacdd76202206d Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 6 Apr 2023 12:53:34 -0400 Subject: [PATCH 17/25] add scaleway --- entrypoint.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index f9cabfb..8b8e314 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -37,6 +37,10 @@ case $CLOUD in PRIVATE_INTERFACE="private/${LOCAL_IP}" PUBLIC_INTERFACE="public/${LOCAL_IP}!${PUBLIC_IP}" ;; + scaleway) + LOCAL_IP=$(curl -s --local-port 1-1024 http://169.254.42.42/conf | grep PRIVATE_IP | cut -d = -f 2) + PUBLIC_IP=$(curl -s --local-port 1-1024 http://169.254.42.42/conf | grep PUBLIC_IP_ADDRESS | cut -d = -f 2) + ;; *) ;; esac From 5fc9068705a8d37bcfb1c4595bc12e03b650d486 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 6 Apr 2023 13:26:36 -0400 Subject: [PATCH 18/25] fix scaleway --- entrypoint.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 8b8e314..d68a76b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,10 +21,6 @@ case $CLOUD in PRIVATE_INTERFACE="private/${LOCAL_IP}" PUBLIC_INTERFACE="public/${LOCAL_IP}!${PUBLIC_IP}" ;; - scaleway) - LOCAL_IP=$(curl -s --local-port 1-1024 http://169.254.42.42/conf | grep PRIVATE_IP | cut -d = -f 2) - PUBLIC_IP=$(curl -s --local-port 1-1024 http://169.254.42.42/conf | grep PUBLIC_IP_ADDRESS | cut -d = -f 2) - ;; digitalocean) LOCAL_IP=$(curl -s http://169.254.169.254/metadata/v1/interfaces/private/0/ipv4/address) PUBLIC_IP=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address) @@ -40,6 +36,8 @@ case $CLOUD in scaleway) LOCAL_IP=$(curl -s --local-port 1-1024 http://169.254.42.42/conf | grep PRIVATE_IP | cut -d = -f 2) PUBLIC_IP=$(curl -s --local-port 1-1024 http://169.254.42.42/conf | grep PUBLIC_IP_ADDRESS | cut -d = -f 2) + PRIVATE_INTERFACE="private/${LOCAL_IP}" + PUBLIC_INTERFACE="public/${LOCAL_IP}!${PUBLIC_IP}" ;; *) ;; From 0c055131a49b39af25fc01cfe79e4c8f5e404744 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Sat, 23 Mar 2024 16:55:17 -0400 Subject: [PATCH 19/25] update to debian-12 (bookworm) and rtpengine version mr12.2.1.5 --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 87aa977..b3c27aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bullseye-slim +FROM debian:bookworm-slim RUN apt-get update \ && apt-get remove --auto-remove nftables \ @@ -9,7 +9,7 @@ RUN apt-get update \ libjson-glib-dev default-libmysqlclient-dev libhiredis-dev libssl-dev \ libcurl4-openssl-dev libavcodec-extra gperf libspandsp-dev \ libxtables-dev libip6tc-dev libip4tc-dev libiptc-dev \ - libjpeg-dev libsqlite3-dev libpcre3-dev libldns-dev \ + libjpeg-dev libsqlite3-dev libpcre3-dev libldns-dev libmnl-dev libnftnl-dev pandoc \ libspeex-dev libspeexdsp-dev libedit-dev libtiff-dev yasm libswscale-dev haveged \ libopus-dev libopusfile-dev libsndfile-dev libshout3-dev libmpg123-dev libmp3lame-dev \ && cd /usr/local/src \ @@ -18,10 +18,10 @@ RUN apt-get update \ && echo "building bcg729" \ && cmake . -DCMAKE_INSTALL_PREFIX=/usr && make && make install \ && cd /usr/local/src \ - && git clone https://github.com/warmcat/libwebsockets.git -b v3.2.3 \ + && git clone https://github.com/warmcat/libwebsockets.git -b v4.3.2 \ && cd /usr/local/src/libwebsockets \ && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make && make install \ - && git clone https://github.com/sipwise/rtpengine.git -b mr11.2.1.2 \ + && git clone https://github.com/sipwise/rtpengine.git -b mr12.2.1.5 \ && cd rtpengine/daemon \ && make with_transcoding=yes \ && find . -name rtpengine \ From 609abcc3ed110abdfa5eacf1a5f268c492340978 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Mon, 25 Mar 2024 18:20:50 -0400 Subject: [PATCH 20/25] backup to lts version mr11.5.1 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b3c27aa..4160b4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN apt-get update \ && git clone https://github.com/warmcat/libwebsockets.git -b v4.3.2 \ && cd /usr/local/src/libwebsockets \ && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make && make install \ - && git clone https://github.com/sipwise/rtpengine.git -b mr12.2.1.5 \ + && git clone https://github.com/sipwise/rtpengine.git -b mr11.5.1.24 \ && cd rtpengine/daemon \ && make with_transcoding=yes \ && find . -name rtpengine \ From 4c3a7d0c889ef0e984b813371b81c1bf417b45be Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 2 May 2024 12:18:14 -0400 Subject: [PATCH 21/25] use docker cloud build --- .github/workflows/docker-publish.yml | 80 ++++++++++++++++------------ Dockerfile | 6 +-- 2 files changed, 48 insertions(+), 38 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index dc42355..27731f5 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -2,16 +2,10 @@ name: Docker on: push: - # Publish `master` as Docker `latest` image. branches: - - master - - # Publish `v1.2.3` tags as releases. + - jambonz tags: - - v* - -env: - IMAGE_NAME: rtpengine + - '*' jobs: push: @@ -20,32 +14,48 @@ jobs: if: github.event_name == 'push' steps: - - uses: actions/checkout@v2 - - - name: Build image - run: docker build . --file Dockerfile --tag $IMAGE_NAME + - name: Checkout code + uses: actions/checkout@v4 - - name: Log into registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image + - name: prepare tag + id: prepare_tag run: | - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - - # Use Docker `latest` tag convention - [ "$VERSION" == "master" ] && VERSION=latest - - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION + IMAGE_ID=jambonz/rtpengine + + # Strip git ref prefix from version + VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + + # Strip "v" prefix from tag name + [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') + + # Use Docker `latest` tag convention + [ "$VERSION" == "jambonz" ] && VERSION=latest + + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + + echo "image_id=$IMAGE_ID" >> $GITHUB_OUTPUT + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: "lab:latest" + driver: cloud + endpoint: "drachtio/freeswitch-builder" + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + tags: ${{ steps.prepare_tag.outputs.image_id }}:${{ steps.prepare_tag.outputs.version }} + build-args: BUILD_CPUS=16 + # For pull requests, export results to the build cache. + # Otherwise, push to a registry. + outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }} diff --git a/Dockerfile b/Dockerfile index 4160b4f..1107f90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM debian:bookworm-slim - +ARG BUILD_CPUS=1 RUN apt-get update \ && apt-get remove --auto-remove nftables \ && apt-get purge nftables \ @@ -16,14 +16,14 @@ RUN apt-get update \ && git clone https://github.com/BelledonneCommunications/bcg729.git \ && cd bcg729 \ && echo "building bcg729" \ - && cmake . -DCMAKE_INSTALL_PREFIX=/usr && make && make install \ + && cmake . -DCMAKE_INSTALL_PREFIX=/usr && make -j ${BUILD_CPUS} && make install \ && cd /usr/local/src \ && git clone https://github.com/warmcat/libwebsockets.git -b v4.3.2 \ && cd /usr/local/src/libwebsockets \ && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make && make install \ && git clone https://github.com/sipwise/rtpengine.git -b mr11.5.1.24 \ && cd rtpengine/daemon \ - && make with_transcoding=yes \ + && make -j ${BUILD_CPUS} with_transcoding=yes \ && find . -name rtpengine \ && cp rtpengine /usr/local/bin/rtpengine \ && rm -Rf /usr/local/src/rtpengine \ From 5873d40fbe57b0681ccb55f619c6cc8dce76d41c Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 2 May 2024 12:21:33 -0400 Subject: [PATCH 22/25] more build speedup --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1107f90..d9c5c8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN apt-get update \ && cd /usr/local/src \ && git clone https://github.com/warmcat/libwebsockets.git -b v4.3.2 \ && cd /usr/local/src/libwebsockets \ - && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make && make install \ + && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j ${BUILD_CPUS} && make install \ && git clone https://github.com/sipwise/rtpengine.git -b mr11.5.1.24 \ && cd rtpengine/daemon \ && make -j ${BUILD_CPUS} with_transcoding=yes \ From 8ae9d54f1c251f80c6fc21a8867caf3844d68648 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Mon, 28 Oct 2024 08:55:45 -0400 Subject: [PATCH 23/25] update rtpengine and lws --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d9c5c8f..a5ee3f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,10 +18,10 @@ RUN apt-get update \ && echo "building bcg729" \ && cmake . -DCMAKE_INSTALL_PREFIX=/usr && make -j ${BUILD_CPUS} && make install \ && cd /usr/local/src \ - && git clone https://github.com/warmcat/libwebsockets.git -b v4.3.2 \ + && git clone https://github.com/warmcat/libwebsockets.git -b v4.3.3 \ && cd /usr/local/src/libwebsockets \ && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j ${BUILD_CPUS} && make install \ - && git clone https://github.com/sipwise/rtpengine.git -b mr11.5.1.24 \ + && git clone https://github.com/sipwise/rtpengine.git -b mr11.5.1.31 \ && cd rtpengine/daemon \ && make -j ${BUILD_CPUS} with_transcoding=yes \ && find . -name rtpengine \ From 9b7b9f925341309d7e6eef656d333c90658883d7 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Sun, 2 Feb 2025 16:35:21 -0500 Subject: [PATCH 24/25] add support for determining public ip on azure when behind LB --- entrypoint.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index d68a76b..a760c9f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -28,8 +28,13 @@ case $CLOUD in PUBLIC_INTERFACE="public/${PUBLIC_IP}" ;; azure) - LOCAL_IP=$(curl -H Metadata:true "http://169.254.169.254/metadata/instance/network/interface/0/ipv4/ipAddress/0/privateIpAddress?api-version=2017-08-01&format=text") - PUBLIC_IP=$(curl -H Metadata:true "http://169.254.169.254/metadata/instance/network/interface/0/ipv4/ipAddress/0/publicIpAddress?api-version=2017-08-01&format=text") + if [ "$LB_IMDS" = true ]; then + LOCAL_IP=$(curl -H "Metadata:true" --noproxy "*" "http://169.254.169.254:80/metadata/loadbalancer?api-version=2020-10-01&format=text" | jq -r '.loadbalancer.publicIpAddresses[0].privateIpAddress') + PUBLIC_IP=$(curl -H "Metadata:true" --noproxy "*" "http://169.254.169.254:80/metadata/loadbalancer?api-version=2020-10-01&format=text" | jq -r '.loadbalancer.publicIpAddresses[0].frontendIpAddress') + else + LOCAL_IP=$(curl -H Metadata:true "http://169.254.169.254/metadata/instance/network/interface/0/ipv4/ipAddress/0/privateIpAddress?api-version=2017-08-01&format=text") + PUBLIC_IP=$(curl -H Metadata:true "http://169.254.169.254/metadata/instance/network/interface/0/ipv4/ipAddress/0/publicIpAddress?api-version=2017-08-01&format=text") + fi PRIVATE_INTERFACE="private/${LOCAL_IP}" PUBLIC_INTERFACE="public/${LOCAL_IP}!${PUBLIC_IP}" ;; From 2f25f9c3632fa50ae83dc141b73e3632a96f4363 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Sun, 2 Feb 2025 16:40:47 -0500 Subject: [PATCH 25/25] add jq dep --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a5ee3f9..31be0e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ RUN apt-get update \ && apt-get purge nftables \ && apt-get -y --quiet --force-yes upgrade curl iproute2 \ && apt-get install -y --no-install-recommends ca-certificates gcc g++ make cmake build-essential git libavfilter-dev \ - libevent-dev libpcap-dev libxmlrpc-core-c3-dev markdown \ + libevent-dev libpcap-dev libxmlrpc-core-c3-dev markdown jq \ libjson-glib-dev default-libmysqlclient-dev libhiredis-dev libssl-dev \ libcurl4-openssl-dev libavcodec-extra gperf libspandsp-dev \ libxtables-dev libip6tc-dev libip4tc-dev libiptc-dev \