From 0d0dc9a0d57d1cec2aa291d3b766ef99b794ad6a Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Sat, 9 Mar 2024 18:31:53 -0300 Subject: [PATCH] Fix for ARM build of app_rtsp_sip --- asterisk/Dockerfile | 19 ++++++++++--------- asterisk/patches/app_rtsp_sip/fix_arm.patch | 13 +++++++++++++ 2 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 asterisk/patches/app_rtsp_sip/fix_arm.patch diff --git a/asterisk/Dockerfile b/asterisk/Dockerfile index 69ef4a8..d72fe92 100644 --- a/asterisk/Dockerfile +++ b/asterisk/Dockerfile @@ -131,16 +131,17 @@ COPY patches/app_rtsp_sip/*.patch ./ ARG APP_RTSP_SIP_VERSION="d0fb18b4813e4ae8940029a8a62030443d9feaec" ARG TARGETARCH # hadolint ignore=DL3003,SC2164 -RUN if [[ "${TARGETARCH}" == "amd64" || "${TARGETARCH}" == "i386" ]]; then \ - curl -fsSL "https://github.com/tommyjlong/app_rtsp_sip/archive/${APP_RTSP_SIP_VERSION}.tar.gz" | \ +RUN curl -fsSL "https://github.com/tommyjlong/app_rtsp_sip/archive/${APP_RTSP_SIP_VERSION}.tar.gz" | \ tar --strip-components 1 -xz; \ - patch -p1 < disable_auth.patch; \ - patch -p1 < remove_sudo.patch; \ - cp -f app_rtsp_sip.c /usr/src/asterisk/apps; \ - cp -f rtsp_sip_links.sh /usr/src/asterisk; \ - cd /usr/src/asterisk; \ - ./rtsp_sip_links.sh; \ - fi + patch -p1 < disable_auth.patch; \ + patch -p1 < remove_sudo.patch; \ + if [[ "${TARGETARCH}" == arm* ]]; then \ + patch -p1 < fix_arm.patch; \ + fi; \ + cp -f app_rtsp_sip.c /usr/src/asterisk/apps; \ + cp -f rtsp_sip_links.sh /usr/src/asterisk; \ + cd /usr/src/asterisk; \ + ./rtsp_sip_links.sh # Copy patches specific for this addon COPY patches/asterisk/*.patch /usr/src/asterisk-patches/ diff --git a/asterisk/patches/app_rtsp_sip/fix_arm.patch b/asterisk/patches/app_rtsp_sip/fix_arm.patch new file mode 100644 index 0000000..354996e --- /dev/null +++ b/asterisk/patches/app_rtsp_sip/fix_arm.patch @@ -0,0 +1,13 @@ +diff --git a/app_rtsp_sip.c b/app_rtsp_sip.c +index 42933af..e72c2f7 100755 +--- a/app_rtsp_sip.c ++++ b/app_rtsp_sip.c +@@ -64,6 +64,8 @@ + #include + #include "asterisk/app.h" /* PORT 17.3 ADDed for parsing args */ + ++#define PJ_IS_BIG_ENDIAN 0 ++#define PJ_IS_LITTLE_ENDIAN 1 + + #include + #include