Merge pull request #31 from outis1one/claude/asterisk-vpn-mobile-issue-Nt958
Remove incompatible Digium codec_opus — crashes Asterisk on Ubuntu 24.04
This commit is contained in:
+5
-13
@@ -39,19 +39,11 @@ RUN echo "exit 101" > /usr/sbin/policy-rc.d && chmod +x /usr/sbin/policy-rc.d &&
|
|||||||
&& ldconfig \
|
&& ldconfig \
|
||||||
&& update-ca-certificates 2>/dev/null || true
|
&& update-ca-certificates 2>/dev/null || true
|
||||||
|
|
||||||
# Install Opus codec (not included in Ubuntu 24.04 asterisk-modules, bug #2044135)
|
# NOTE: Opus transcoding (codec_opus.so) is NOT available on Ubuntu 24.04 due to
|
||||||
# Download Digium's precompiled codec_opus for Asterisk 20 (Ubuntu 24.04 ships Asterisk 20)
|
# a packaging bug (Launchpad #2044135). The Digium precompiled binary is ABI-incompatible.
|
||||||
RUN MODULES_DIR=$(find /usr/lib -type d -name modules -path "*/asterisk/*" | head -1) && \
|
# Opus pass-through (phone-to-phone) still works via res_format_attr_opus.so from
|
||||||
if [ -z "$MODULES_DIR" ]; then MODULES_DIR="/usr/lib/x86_64-linux-gnu/asterisk/modules"; fi && \
|
# asterisk-modules. Only Opus<->ulaw transcoding is missing, which is rarely needed
|
||||||
mkdir -p "$MODULES_DIR" /var/lib/asterisk/documentation/thirdparty && \
|
# since modern SIP phones all support the same codecs natively.
|
||||||
cd /tmp && \
|
|
||||||
wget -q "http://downloads.digium.com/pub/telephony/codec_opus/asterisk-20.0/x86-64/codec_opus-20.0_1.3.0-x86_64.tar.gz" -O codec_opus.tar.gz && \
|
|
||||||
tar -xzf codec_opus.tar.gz && \
|
|
||||||
find /tmp -name "codec_opus.so" -exec cp {} "$MODULES_DIR/" \; && \
|
|
||||||
find /tmp -name "format_ogg_opus.so" -exec cp {} "$MODULES_DIR/" \; && \
|
|
||||||
find /tmp -name "codec_opus_config-en_US.xml" -exec cp {} /var/lib/asterisk/documentation/thirdparty/ \; && \
|
|
||||||
rm -rf /tmp/codec_opus* && \
|
|
||||||
echo "Opus codec installed to $MODULES_DIR"
|
|
||||||
|
|
||||||
# Create required directories
|
# Create required directories
|
||||||
RUN mkdir -p \
|
RUN mkdir -p \
|
||||||
|
|||||||
@@ -301,6 +301,10 @@ cat > /etc/asterisk/modules.conf << 'EOF'
|
|||||||
autoload=yes
|
autoload=yes
|
||||||
noload => chan_sip.so
|
noload => chan_sip.so
|
||||||
noload => chan_iax2.so
|
noload => chan_iax2.so
|
||||||
|
; Opus transcoding unavailable on Ubuntu 24.04 (bug #2044135)
|
||||||
|
; Opus pass-through still works via res_format_attr_opus.so
|
||||||
|
noload => codec_opus.so
|
||||||
|
noload => format_ogg_opus.so
|
||||||
load => res_pjsip.so
|
load => res_pjsip.so
|
||||||
load => res_pjsip_session.so
|
load => res_pjsip_session.so
|
||||||
load => res_pjsip_logger.so
|
load => res_pjsip_logger.so
|
||||||
@@ -314,6 +318,18 @@ load => app_page.so
|
|||||||
load => pbx_config.so
|
load => pbx_config.so
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# ── Remove incompatible Digium codec_opus if present on volume ──
|
||||||
|
# The Digium binary is ABI-incompatible with Ubuntu 24.04's Asterisk and crashes it
|
||||||
|
MODULES_DIR=$(find /usr/lib -type d -name modules -path "*/asterisk/*" 2>/dev/null | head -1)
|
||||||
|
if [[ -n "$MODULES_DIR" ]]; then
|
||||||
|
for bad_module in codec_opus.so format_ogg_opus.so; do
|
||||||
|
if [[ -f "$MODULES_DIR/$bad_module" ]] && ! dpkg -S "$MODULES_DIR/$bad_module" >/dev/null 2>&1; then
|
||||||
|
log_warn "Removing incompatible $bad_module (not from Ubuntu package)"
|
||||||
|
rm -f "$MODULES_DIR/$bad_module"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# ── 9. Fix permissions ───────────────────────────────────────
|
# ── 9. Fix permissions ───────────────────────────────────────
|
||||||
chown -R asterisk:asterisk /etc/asterisk /var/lib/asterisk /var/log/asterisk /var/spool/asterisk /var/run/asterisk 2>/dev/null || true
|
chown -R asterisk:asterisk /etc/asterisk /var/lib/asterisk /var/log/asterisk /var/spool/asterisk /var/run/asterisk 2>/dev/null || true
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user