diff --git a/asterisk/20.18.2-trixie/Dockerfile b/asterisk/20.18.2-trixie/Dockerfile new file mode 100644 index 000000000..4f7efe954 --- /dev/null +++ b/asterisk/20.18.2-trixie/Dockerfile @@ -0,0 +1,169 @@ +# Multi-stage optimized Asterisk Docker build +# Asterisk 20.18.2 on Debian trixie +# Generated from YAML configuration - DO NOT EDIT MANUALLY + +# ============================================================================== +# STAGE 1: Build Environment +# ============================================================================== +FROM debian:trixie AS asterisk-builder + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX Builder" +LABEL org.opencontainers.image.description="Build stage for Asterisk 20.18.2" +LABEL org.opencontainers.image.version="20.18.2" +LABEL org.opencontainers.image.source="https://github.com/andrius/asterisk" + +# Build arguments +ARG ASTERISK_VERSION=20.18.2 +ARG JOBS=8 +ARG DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH + +# Environment variables +ENV ASTERISK_VERSION=${ASTERISK_VERSION} +ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND} +ENV TMPDIR="/tmp/asterisk_build" + +# Create build directories first +RUN mkdir -p \ + /usr/src/asterisk \ + ${TMPDIR} \ + && chmod 777 ${TMPDIR} + +# EOL distribution setup (if needed) +# Update package lists and install ca-certificates first, then build dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates \ + && apt-get install -y --no-install-recommends \ + build-essential autoconf binutils-dev curl file libcurl4-openssl-dev \ + libedit-dev libgsm1-dev libicu-dev libjansson-dev libncurses-dev libogg-dev \ + libpopt-dev libpqxx-dev libresample1-dev libspandsp-dev libspeex-dev \ + libspeexdsp-dev libsqlite3-dev libssl-dev libtool libvorbis-dev libxml2-dev \ + libxslt1-dev make odbcinst patch pkg-config portaudio19-dev procps \ + python3-dev unixodbc unixodbc-dev uuid uuid-dev xmlstarlet libsrtp2-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p ${TMPDIR} && chmod 777 ${TMPDIR} + + +WORKDIR /usr/src/asterisk + +# Download and extract Asterisk source +RUN curl -fsSL https://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-20.18.2.tar.gz \ + | tar --strip-components=1 -xz + + +# Configure Asterisk build (skip for very old versions that don't have configure script) +RUN ./configure + +# Generate menuselect configuration +RUN make menuselect/menuselect menuselect-tree menuselect.makeopts + +# Optimize build configuration for smaller image +RUN sed -i 's/HAVE_XML2 = yes/HAVE_XML2 = no/' makeopts \ + && sed -i 's/HAVE_XMLSTARLET = yes/HAVE_XMLSTARLET = no/' makeopts + +# Copy and execute build script +COPY build.sh /usr/src/asterisk/build.sh +RUN chmod +x build.sh && ./build.sh + +# ============================================================================== +# STAGE 2: Runtime Environment +# ============================================================================== +FROM debian:trixie AS asterisk-runtime + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX Runtime" +LABEL org.opencontainers.image.description="Runtime environment for Asterisk 20.18.2" + +ARG DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH +ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND} + +# Install only runtime dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + binutils curl libedit2 libgsm1 libjansson4 libogg0 libpopt0 libresample1 \ + libspandsp2 libspeex1 libspeexdsp1 libsqlite3-0 libvorbis0a libxml2 \ + libxslt1.1 odbcinst portaudio19-dev procps python3 unixodbc uuid libcurl4t64 \ + libssl3t64 libsrtp2-1 libncurses6 libpqxx-7.10 libicu76 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Create asterisk user and required directories +RUN useradd --uid 1000 --system --user-group \ + --home-dir /home/asterisk --create-home \ + asterisk \ + && mkdir -p \ + /var/run/asterisk \ + /var/log/asterisk \ + /var/spool/asterisk/monitor \ + /var/spool/asterisk/outgoing \ + /var/spool/asterisk/tmp \ + /var/spool/asterisk/voicemail \ + /var/spool/asterisk/fax \ + /var/lib/asterisk/keys \ + /var/lib/asterisk/phoneprov \ + /var/lib/asterisk/sounds \ + /var/lib/asterisk/docs + +# ============================================================================== +# STAGE 3: Final Production Image +# ============================================================================== +FROM asterisk-runtime AS asterisk-production + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX" +LABEL org.opencontainers.image.description="Production Asterisk PBX 20.18.2" +LABEL org.opencontainers.image.version="20.18.2" +LABEL org.opencontainers.image.source="https://github.com/andrius/asterisk" +LABEL org.opencontainers.image.vendor="Andrius Kairiukstis " + +# Copy Asterisk binaries and configurations from builder +COPY --from=asterisk-builder /usr/sbin/asterisk /usr/sbin/asterisk +COPY --from=asterisk-builder /usr/lib/asterisk /usr/lib/asterisk +COPY --from=asterisk-builder /var/lib/asterisk /var/lib/asterisk +COPY --from=asterisk-builder /etc/asterisk /etc/asterisk + +# Copy Asterisk shared libraries +COPY --from=asterisk-builder /usr/lib/libasterisk*.so* /usr/lib/ + +# Copy healthcheck script +COPY healthcheck.sh /usr/local/bin/healthcheck.sh +RUN chmod +x /usr/local/bin/healthcheck.sh + +# Set proper ownership and permissions +RUN chown -R asterisk:asterisk \ + /etc/asterisk \ + /home/asterisk \ + /var/*/asterisk \ + /usr/lib*/asterisk 2>/dev/null || true \ + && chmod -R 750 /var/spool/asterisk + +# Runtime verification +RUN asterisk -V || (echo "Error: Unable to run asterisk -V" && exit 1) + +# Configure networking +# EXPOSE 5060/udp +# EXPOSE 5060/tcp +# EXPOSE 5061/tcp +# EXPOSE 10000-10099/udp + +# Define volumes for persistent data +VOLUME ["/var/lib/asterisk/sounds", "/var/lib/asterisk/keys", "/var/lib/asterisk/phoneprov", "/var/spool/asterisk", "/var/log/asterisk", "/etc/asterisk"] + +# Add health check +HEALTHCHECK --interval=30s \ + --timeout=10s \ + --start-period=30s \ + --retries=3 \ + CMD /usr/local/bin/healthcheck.sh + +# Switch to non-root user +USER asterisk + +# Set working directory +WORKDIR /home/asterisk + +# Default command with production settings +CMD ["/usr/sbin/asterisk", "-vvvdddf", "-T", "-W", "-U", "asterisk", "-p"] diff --git a/asterisk/20.18.2-trixie/build.sh b/asterisk/20.18.2-trixie/build.sh new file mode 100755 index 000000000..2d9944b33 --- /dev/null +++ b/asterisk/20.18.2-trixie/build.sh @@ -0,0 +1,107 @@ +#!/bin/bash +# Asterisk build script +# Generated from template for 20.18.2 +# Contains menuselect configuration and build commands + +set -euo pipefail + +# Color output for better readability +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +log() { + echo -e "${GREEN}[BUILD]${NC} $1" +} + +warn() { + echo -e "${YELLOW}[WARN]${NC} $1" +} + +error() { + echo -e "${RED}[ERROR]${NC} $1" +} + +log "Starting Asterisk 20.18.2 build process..." + +# Set build parallelization (use Docker ARG or default) +NPROC=$(nproc) +JOBS=${JOBS:-8} +log "Using $JOBS parallel jobs for compilation (detected $NPROC CPUs)" + +# Configure Asterisk +log "Configuring Asterisk with options..." +./configure --with-pjproject-bundled --with-ssl=ssl --with-crypto + +# Build menuselect tool +log "Building menuselect tool..." +make menuselect + +# Configure Asterisk modules using menuselect +log "Configuring Asterisk modules..." + +# Disable BUILD_NATIVE optimization for container builds +menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts + +# Enable better backtraces for debugging +menuselect/menuselect --enable BETTER_BACKTRACES menuselect.makeopts + +# Disable sound packages to reduce image size +menuselect/menuselect --disable-category MENUSELECT_CORE_SOUNDS menuselect.makeopts +menuselect/menuselect --disable-category MENUSELECT_MOH menuselect.makeopts +menuselect/menuselect --disable-category MENUSELECT_EXTRA_SOUNDS menuselect.makeopts + +# Enable core applications +menuselect/menuselect --enable app_voicemail menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_voicemail menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_queue menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_queue menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_confbridge menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_confbridge menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_directory menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_directory menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_dial menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_dial menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_playback menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_playback menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_record menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_record menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_echo menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_echo menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_mixmonitor menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_mixmonitor menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Enable CDR and CEL modules + +# Enable channel drivers +menuselect/menuselect --enable chan_pjsip menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_pjsip menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_iax2 menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_iax2 menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_local menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_local menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_bridge_media menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_bridge_media menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Enable resource modules +menuselect/menuselect --enable res_musiconhold menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_musiconhold menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_session menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_session menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_outbound_registration menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_outbound_registration menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_registrar menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_registrar menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_rtp_asterisk menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_rtp_asterisk menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_timing_timerfd menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_timing_timerfd menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_crypto menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_crypto menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Disable unwanted modules +menuselect/menuselect --disable chan_dahdi menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable chan_dahdi menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --disable chan_misdn menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable chan_misdn menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --disable app_festival menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable app_festival menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + + +log "Module configuration completed" + + +# Build Asterisk +log "Building Asterisk core (this may take several minutes)..." +TMPDIR=${TMPDIR} make -j $JOBS all +log "Installing Asterisk..." +TMPDIR=${TMPDIR} make install +log "Installing sample configurations..." +TMPDIR=${TMPDIR} make samples + + +# Strip binaries to reduce size +log "Stripping binaries to reduce image size..." +find /usr/sbin /usr/lib/asterisk -type f -executable \ + -exec strip --strip-unneeded {} + 2>/dev/null || true + +log "Asterisk 20.18.2 build completed successfully!" \ No newline at end of file diff --git a/asterisk/20.18.2-trixie/healthcheck.sh b/asterisk/20.18.2-trixie/healthcheck.sh new file mode 100755 index 000000000..54a481295 --- /dev/null +++ b/asterisk/20.18.2-trixie/healthcheck.sh @@ -0,0 +1,157 @@ +#!/bin/bash +# Asterisk health check script +# Generated from template for 20.18.2 + +set -euo pipefail + +# Configuration +ASTERISK_CLI="/usr/sbin/asterisk -rx" +TIMEOUT=10 +VERBOSE=false + +# Parse command line arguments +while [[ $# -gt 0 ]]; do + case $1 in + -v|--verbose) + VERBOSE=true + shift + ;; + -t|--timeout) + TIMEOUT="$2" + shift 2 + ;; + *) + echo "Unknown option: $1" >&2 + exit 1 + ;; + esac +done + +# Logging functions +log() { + if [[ "$VERBOSE" == "true" ]]; then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" >&2 + fi +} + +error() { + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ERROR: $*" >&2 +} + +# Health check functions +check_asterisk_running() { + log "Checking if Asterisk is running..." + if ! pgrep -x asterisk >/dev/null; then + error "Asterisk process not found" + return 1 + fi + log "✓ Asterisk process is running" + return 0 +} + +check_asterisk_responsive() { + log "Checking if Asterisk CLI is responsive..." + if ! timeout $TIMEOUT $ASTERISK_CLI "core show version" >/dev/null 2>&1; then + error "Asterisk CLI not responsive" + return 1 + fi + log "✓ Asterisk CLI is responsive" + return 0 +} + +check_pjsip_status() { + log "Checking PJSIP status..." + if ! timeout $TIMEOUT $ASTERISK_CLI "pjsip show version" >/dev/null 2>&1; then + error "PJSIP not available or not responding" + return 1 + fi + log "✓ PJSIP is available" + return 0 +} + +check_database_connectivity() { + log "Checking database connectivity..." + # Check if ODBC is configured and working + if ! timeout $TIMEOUT $ASTERISK_CLI "odbc show all" | grep -q "Connected" 2>/dev/null; then + log "⚠ No ODBC connections found (this may be normal)" + else + log "✓ Database connections available" + fi + return 0 +} + +check_essential_modules() { + log "Checking essential modules..." + local required_modules=( + "res_rtp_asterisk" + "res_timing_timerfd" + "res_crypto" + "res_pjsip" + ) + + for module in "${required_modules[@]}"; do + if ! timeout $TIMEOUT $ASTERISK_CLI "module show like $module" | grep -q "$module" >/dev/null 2>&1; then + error "Required module $module not loaded" + return 1 + fi + done + log "✓ Essential modules are loaded" + return 0 +} + +check_filesystem_access() { + log "Checking filesystem access..." + local required_dirs=( + "/var/log/asterisk" + "/var/spool/asterisk" + "/var/lib/asterisk" + "/etc/asterisk" + ) + + for dir in "${required_dirs[@]}"; do + if [[ ! -d "$dir" ]]; then + error "Required directory $dir not found" + return 1 + fi + if [[ ! -r "$dir" ]]; then + error "Directory $dir not readable" + return 1 + fi + done + log "✓ Filesystem access is working" + return 0 +} + +# Main health check +main() { + log "Starting Asterisk health check..." + + local checks=( + "check_asterisk_running" + "check_asterisk_responsive" + "check_pjsip_status" + "check_database_connectivity" + "check_essential_modules" + "check_filesystem_access" + ) + + local failed=0 + for check in "${checks[@]}"; do + if ! $check; then + failed=$((failed + 1)) + fi + done + + if [[ $failed -eq 0 ]]; then + log "✓ All health checks passed" + exit 0 + else + error "Health check failed: $failed checks failed" + exit 1 + fi +} + +# Handle signals +trap 'error "Health check interrupted"; exit 1' INT TERM + +main "$@" \ No newline at end of file diff --git a/asterisk/20.7-cert9-trixie/Dockerfile b/asterisk/20.7-cert9-trixie/Dockerfile new file mode 100644 index 000000000..c7f32bc8e --- /dev/null +++ b/asterisk/20.7-cert9-trixie/Dockerfile @@ -0,0 +1,169 @@ +# Multi-stage optimized Asterisk Docker build +# Asterisk 20.7-cert9 on Debian trixie +# Generated from YAML configuration - DO NOT EDIT MANUALLY + +# ============================================================================== +# STAGE 1: Build Environment +# ============================================================================== +FROM debian:trixie AS asterisk-builder + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX Builder" +LABEL org.opencontainers.image.description="Build stage for Asterisk 20.7-cert9" +LABEL org.opencontainers.image.version="20.7-cert9" +LABEL org.opencontainers.image.source="https://github.com/andrius/asterisk" + +# Build arguments +ARG ASTERISK_VERSION=20.7-cert9 +ARG JOBS=8 +ARG DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH + +# Environment variables +ENV ASTERISK_VERSION=${ASTERISK_VERSION} +ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND} +ENV TMPDIR="/tmp/asterisk_build" + +# Create build directories first +RUN mkdir -p \ + /usr/src/asterisk \ + ${TMPDIR} \ + && chmod 777 ${TMPDIR} + +# EOL distribution setup (if needed) +# Update package lists and install ca-certificates first, then build dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates \ + && apt-get install -y --no-install-recommends \ + build-essential autoconf binutils-dev curl file libcurl4-openssl-dev \ + libedit-dev libgsm1-dev libicu-dev libjansson-dev libncurses-dev libogg-dev \ + libpopt-dev libpqxx-dev libresample1-dev libspandsp-dev libspeex-dev \ + libspeexdsp-dev libsqlite3-dev libssl-dev libtool libvorbis-dev libxml2-dev \ + libxslt1-dev make odbcinst patch pkg-config portaudio19-dev procps \ + python3-dev unixodbc unixodbc-dev uuid uuid-dev xmlstarlet libsrtp2-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p ${TMPDIR} && chmod 777 ${TMPDIR} + + +WORKDIR /usr/src/asterisk + +# Download and extract Asterisk source +RUN curl -fsSL https://downloads.asterisk.org/pub/telephony/certified-asterisk/releases/asterisk-certified-20.7-cert9.tar.gz \ + | tar --strip-components=1 -xz + + +# Configure Asterisk build (skip for very old versions that don't have configure script) +RUN ./configure + +# Generate menuselect configuration +RUN make menuselect/menuselect menuselect-tree menuselect.makeopts + +# Optimize build configuration for smaller image +RUN sed -i 's/HAVE_XML2 = yes/HAVE_XML2 = no/' makeopts \ + && sed -i 's/HAVE_XMLSTARLET = yes/HAVE_XMLSTARLET = no/' makeopts + +# Copy and execute build script +COPY build.sh /usr/src/asterisk/build.sh +RUN chmod +x build.sh && ./build.sh + +# ============================================================================== +# STAGE 2: Runtime Environment +# ============================================================================== +FROM debian:trixie AS asterisk-runtime + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX Runtime" +LABEL org.opencontainers.image.description="Runtime environment for Asterisk 20.7-cert9" + +ARG DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH +ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND} + +# Install only runtime dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + binutils curl libedit2 libgsm1 libjansson4 libogg0 libpopt0 libresample1 \ + libspandsp2 libspeex1 libspeexdsp1 libsqlite3-0 libvorbis0a libxml2 \ + libxslt1.1 odbcinst portaudio19-dev procps python3 unixodbc uuid libcurl4t64 \ + libssl3t64 libsrtp2-1 libncurses6 libpqxx-7.10 libicu76 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Create asterisk user and required directories +RUN useradd --uid 1000 --system --user-group \ + --home-dir /home/asterisk --create-home \ + asterisk \ + && mkdir -p \ + /var/run/asterisk \ + /var/log/asterisk \ + /var/spool/asterisk/monitor \ + /var/spool/asterisk/outgoing \ + /var/spool/asterisk/tmp \ + /var/spool/asterisk/voicemail \ + /var/spool/asterisk/fax \ + /var/lib/asterisk/keys \ + /var/lib/asterisk/phoneprov \ + /var/lib/asterisk/sounds \ + /var/lib/asterisk/docs + +# ============================================================================== +# STAGE 3: Final Production Image +# ============================================================================== +FROM asterisk-runtime AS asterisk-production + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX" +LABEL org.opencontainers.image.description="Production Asterisk PBX 20.7-cert9" +LABEL org.opencontainers.image.version="20.7-cert9" +LABEL org.opencontainers.image.source="https://github.com/andrius/asterisk" +LABEL org.opencontainers.image.vendor="Andrius Kairiukstis " + +# Copy Asterisk binaries and configurations from builder +COPY --from=asterisk-builder /usr/sbin/asterisk /usr/sbin/asterisk +COPY --from=asterisk-builder /usr/lib/asterisk /usr/lib/asterisk +COPY --from=asterisk-builder /var/lib/asterisk /var/lib/asterisk +COPY --from=asterisk-builder /etc/asterisk /etc/asterisk + +# Copy Asterisk shared libraries +COPY --from=asterisk-builder /usr/lib/libasterisk*.so* /usr/lib/ + +# Copy healthcheck script +COPY healthcheck.sh /usr/local/bin/healthcheck.sh +RUN chmod +x /usr/local/bin/healthcheck.sh + +# Set proper ownership and permissions +RUN chown -R asterisk:asterisk \ + /etc/asterisk \ + /home/asterisk \ + /var/*/asterisk \ + /usr/lib*/asterisk 2>/dev/null || true \ + && chmod -R 750 /var/spool/asterisk + +# Runtime verification +RUN asterisk -V || (echo "Error: Unable to run asterisk -V" && exit 1) + +# Configure networking +# EXPOSE 5060/udp +# EXPOSE 5060/tcp +# EXPOSE 5061/tcp +# EXPOSE 10000-10099/udp + +# Define volumes for persistent data +VOLUME ["/var/lib/asterisk/sounds", "/var/lib/asterisk/keys", "/var/lib/asterisk/phoneprov", "/var/spool/asterisk", "/var/log/asterisk", "/etc/asterisk"] + +# Add health check +HEALTHCHECK --interval=30s \ + --timeout=10s \ + --start-period=30s \ + --retries=3 \ + CMD /usr/local/bin/healthcheck.sh + +# Switch to non-root user +USER asterisk + +# Set working directory +WORKDIR /home/asterisk + +# Default command with production settings +CMD ["/usr/sbin/asterisk", "-vvvdddf", "-T", "-W", "-U", "asterisk", "-p"] diff --git a/asterisk/20.7-cert9-trixie/build.sh b/asterisk/20.7-cert9-trixie/build.sh new file mode 100755 index 000000000..9ce5dc976 --- /dev/null +++ b/asterisk/20.7-cert9-trixie/build.sh @@ -0,0 +1,107 @@ +#!/bin/bash +# Asterisk build script +# Generated from template for 20.7-cert9 +# Contains menuselect configuration and build commands + +set -euo pipefail + +# Color output for better readability +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +log() { + echo -e "${GREEN}[BUILD]${NC} $1" +} + +warn() { + echo -e "${YELLOW}[WARN]${NC} $1" +} + +error() { + echo -e "${RED}[ERROR]${NC} $1" +} + +log "Starting Asterisk 20.7-cert9 build process..." + +# Set build parallelization (use Docker ARG or default) +NPROC=$(nproc) +JOBS=${JOBS:-8} +log "Using $JOBS parallel jobs for compilation (detected $NPROC CPUs)" + +# Configure Asterisk +log "Configuring Asterisk with options..." +./configure --with-pjproject-bundled --with-ssl=ssl --with-crypto + +# Build menuselect tool +log "Building menuselect tool..." +make menuselect + +# Configure Asterisk modules using menuselect +log "Configuring Asterisk modules..." + +# Disable BUILD_NATIVE optimization for container builds +menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts + +# Enable better backtraces for debugging +menuselect/menuselect --enable BETTER_BACKTRACES menuselect.makeopts + +# Disable sound packages to reduce image size +menuselect/menuselect --disable-category MENUSELECT_CORE_SOUNDS menuselect.makeopts +menuselect/menuselect --disable-category MENUSELECT_MOH menuselect.makeopts +menuselect/menuselect --disable-category MENUSELECT_EXTRA_SOUNDS menuselect.makeopts + +# Enable core applications +menuselect/menuselect --enable app_voicemail menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_voicemail menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_queue menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_queue menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_confbridge menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_confbridge menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_directory menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_directory menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_dial menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_dial menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_playback menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_playback menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_record menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_record menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_echo menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_echo menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_mixmonitor menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_mixmonitor menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Enable CDR and CEL modules + +# Enable channel drivers +menuselect/menuselect --enable chan_pjsip menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_pjsip menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_iax2 menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_iax2 menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_local menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_local menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_bridge_media menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_bridge_media menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Enable resource modules +menuselect/menuselect --enable res_musiconhold menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_musiconhold menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_session menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_session menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_outbound_registration menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_outbound_registration menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_registrar menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_registrar menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_rtp_asterisk menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_rtp_asterisk menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_timing_timerfd menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_timing_timerfd menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_crypto menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_crypto menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Disable unwanted modules +menuselect/menuselect --disable chan_dahdi menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable chan_dahdi menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --disable chan_misdn menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable chan_misdn menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --disable app_festival menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable app_festival menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + + +log "Module configuration completed" + + +# Build Asterisk +log "Building Asterisk core (this may take several minutes)..." +TMPDIR=${TMPDIR} make -j $JOBS all +log "Installing Asterisk..." +TMPDIR=${TMPDIR} make install +log "Installing sample configurations..." +TMPDIR=${TMPDIR} make samples + + +# Strip binaries to reduce size +log "Stripping binaries to reduce image size..." +find /usr/sbin /usr/lib/asterisk -type f -executable \ + -exec strip --strip-unneeded {} + 2>/dev/null || true + +log "Asterisk 20.7-cert9 build completed successfully!" \ No newline at end of file diff --git a/asterisk/20.7-cert9-trixie/healthcheck.sh b/asterisk/20.7-cert9-trixie/healthcheck.sh new file mode 100755 index 000000000..a8e901193 --- /dev/null +++ b/asterisk/20.7-cert9-trixie/healthcheck.sh @@ -0,0 +1,157 @@ +#!/bin/bash +# Asterisk health check script +# Generated from template for 20.7-cert9 + +set -euo pipefail + +# Configuration +ASTERISK_CLI="/usr/sbin/asterisk -rx" +TIMEOUT=10 +VERBOSE=false + +# Parse command line arguments +while [[ $# -gt 0 ]]; do + case $1 in + -v|--verbose) + VERBOSE=true + shift + ;; + -t|--timeout) + TIMEOUT="$2" + shift 2 + ;; + *) + echo "Unknown option: $1" >&2 + exit 1 + ;; + esac +done + +# Logging functions +log() { + if [[ "$VERBOSE" == "true" ]]; then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" >&2 + fi +} + +error() { + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ERROR: $*" >&2 +} + +# Health check functions +check_asterisk_running() { + log "Checking if Asterisk is running..." + if ! pgrep -x asterisk >/dev/null; then + error "Asterisk process not found" + return 1 + fi + log "✓ Asterisk process is running" + return 0 +} + +check_asterisk_responsive() { + log "Checking if Asterisk CLI is responsive..." + if ! timeout $TIMEOUT $ASTERISK_CLI "core show version" >/dev/null 2>&1; then + error "Asterisk CLI not responsive" + return 1 + fi + log "✓ Asterisk CLI is responsive" + return 0 +} + +check_pjsip_status() { + log "Checking PJSIP status..." + if ! timeout $TIMEOUT $ASTERISK_CLI "pjsip show version" >/dev/null 2>&1; then + error "PJSIP not available or not responding" + return 1 + fi + log "✓ PJSIP is available" + return 0 +} + +check_database_connectivity() { + log "Checking database connectivity..." + # Check if ODBC is configured and working + if ! timeout $TIMEOUT $ASTERISK_CLI "odbc show all" | grep -q "Connected" 2>/dev/null; then + log "⚠ No ODBC connections found (this may be normal)" + else + log "✓ Database connections available" + fi + return 0 +} + +check_essential_modules() { + log "Checking essential modules..." + local required_modules=( + "res_rtp_asterisk" + "res_timing_timerfd" + "res_crypto" + "res_pjsip" + ) + + for module in "${required_modules[@]}"; do + if ! timeout $TIMEOUT $ASTERISK_CLI "module show like $module" | grep -q "$module" >/dev/null 2>&1; then + error "Required module $module not loaded" + return 1 + fi + done + log "✓ Essential modules are loaded" + return 0 +} + +check_filesystem_access() { + log "Checking filesystem access..." + local required_dirs=( + "/var/log/asterisk" + "/var/spool/asterisk" + "/var/lib/asterisk" + "/etc/asterisk" + ) + + for dir in "${required_dirs[@]}"; do + if [[ ! -d "$dir" ]]; then + error "Required directory $dir not found" + return 1 + fi + if [[ ! -r "$dir" ]]; then + error "Directory $dir not readable" + return 1 + fi + done + log "✓ Filesystem access is working" + return 0 +} + +# Main health check +main() { + log "Starting Asterisk health check..." + + local checks=( + "check_asterisk_running" + "check_asterisk_responsive" + "check_pjsip_status" + "check_database_connectivity" + "check_essential_modules" + "check_filesystem_access" + ) + + local failed=0 + for check in "${checks[@]}"; do + if ! $check; then + failed=$((failed + 1)) + fi + done + + if [[ $failed -eq 0 ]]; then + log "✓ All health checks passed" + exit 0 + else + error "Health check failed: $failed checks failed" + exit 1 + fi +} + +# Handle signals +trap 'error "Health check interrupted"; exit 1' INT TERM + +main "$@" \ No newline at end of file diff --git a/asterisk/21.12.1-trixie/Dockerfile b/asterisk/21.12.1-trixie/Dockerfile new file mode 100644 index 000000000..200ae9873 --- /dev/null +++ b/asterisk/21.12.1-trixie/Dockerfile @@ -0,0 +1,169 @@ +# Multi-stage optimized Asterisk Docker build +# Asterisk 21.12.1 on Debian trixie +# Generated from YAML configuration - DO NOT EDIT MANUALLY + +# ============================================================================== +# STAGE 1: Build Environment +# ============================================================================== +FROM debian:trixie AS asterisk-builder + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX Builder" +LABEL org.opencontainers.image.description="Build stage for Asterisk 21.12.1" +LABEL org.opencontainers.image.version="21.12.1" +LABEL org.opencontainers.image.source="https://github.com/andrius/asterisk" + +# Build arguments +ARG ASTERISK_VERSION=21.12.1 +ARG JOBS=8 +ARG DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH + +# Environment variables +ENV ASTERISK_VERSION=${ASTERISK_VERSION} +ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND} +ENV TMPDIR="/tmp/asterisk_build" + +# Create build directories first +RUN mkdir -p \ + /usr/src/asterisk \ + ${TMPDIR} \ + && chmod 777 ${TMPDIR} + +# EOL distribution setup (if needed) +# Update package lists and install ca-certificates first, then build dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates \ + && apt-get install -y --no-install-recommends \ + build-essential autoconf binutils-dev curl file libcurl4-openssl-dev \ + libedit-dev libgsm1-dev libicu-dev libjansson-dev libncurses-dev libogg-dev \ + libpopt-dev libpqxx-dev libresample1-dev libspandsp-dev libspeex-dev \ + libspeexdsp-dev libsqlite3-dev libssl-dev libtool libvorbis-dev libxml2-dev \ + libxslt1-dev make odbcinst patch pkg-config portaudio19-dev procps \ + python3-dev unixodbc unixodbc-dev uuid uuid-dev xmlstarlet libsrtp2-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p ${TMPDIR} && chmod 777 ${TMPDIR} + + +WORKDIR /usr/src/asterisk + +# Download and extract Asterisk source +RUN curl -fsSL https://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-21.12.1.tar.gz \ + | tar --strip-components=1 -xz + + +# Configure Asterisk build (skip for very old versions that don't have configure script) +RUN ./configure + +# Generate menuselect configuration +RUN make menuselect/menuselect menuselect-tree menuselect.makeopts + +# Optimize build configuration for smaller image +RUN sed -i 's/HAVE_XML2 = yes/HAVE_XML2 = no/' makeopts \ + && sed -i 's/HAVE_XMLSTARLET = yes/HAVE_XMLSTARLET = no/' makeopts + +# Copy and execute build script +COPY build.sh /usr/src/asterisk/build.sh +RUN chmod +x build.sh && ./build.sh + +# ============================================================================== +# STAGE 2: Runtime Environment +# ============================================================================== +FROM debian:trixie AS asterisk-runtime + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX Runtime" +LABEL org.opencontainers.image.description="Runtime environment for Asterisk 21.12.1" + +ARG DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH +ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND} + +# Install only runtime dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + binutils curl libedit2 libgsm1 libjansson4 libogg0 libpopt0 libresample1 \ + libspandsp2 libspeex1 libspeexdsp1 libsqlite3-0 libvorbis0a libxml2 \ + libxslt1.1 odbcinst portaudio19-dev procps python3 unixodbc uuid libcurl4t64 \ + libssl3t64 libsrtp2-1 libncurses6 libpqxx-7.10 libicu76 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Create asterisk user and required directories +RUN useradd --uid 1000 --system --user-group \ + --home-dir /home/asterisk --create-home \ + asterisk \ + && mkdir -p \ + /var/run/asterisk \ + /var/log/asterisk \ + /var/spool/asterisk/monitor \ + /var/spool/asterisk/outgoing \ + /var/spool/asterisk/tmp \ + /var/spool/asterisk/voicemail \ + /var/spool/asterisk/fax \ + /var/lib/asterisk/keys \ + /var/lib/asterisk/phoneprov \ + /var/lib/asterisk/sounds \ + /var/lib/asterisk/docs + +# ============================================================================== +# STAGE 3: Final Production Image +# ============================================================================== +FROM asterisk-runtime AS asterisk-production + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX" +LABEL org.opencontainers.image.description="Production Asterisk PBX 21.12.1" +LABEL org.opencontainers.image.version="21.12.1" +LABEL org.opencontainers.image.source="https://github.com/andrius/asterisk" +LABEL org.opencontainers.image.vendor="Andrius Kairiukstis " + +# Copy Asterisk binaries and configurations from builder +COPY --from=asterisk-builder /usr/sbin/asterisk /usr/sbin/asterisk +COPY --from=asterisk-builder /usr/lib/asterisk /usr/lib/asterisk +COPY --from=asterisk-builder /var/lib/asterisk /var/lib/asterisk +COPY --from=asterisk-builder /etc/asterisk /etc/asterisk + +# Copy Asterisk shared libraries +COPY --from=asterisk-builder /usr/lib/libasterisk*.so* /usr/lib/ + +# Copy healthcheck script +COPY healthcheck.sh /usr/local/bin/healthcheck.sh +RUN chmod +x /usr/local/bin/healthcheck.sh + +# Set proper ownership and permissions +RUN chown -R asterisk:asterisk \ + /etc/asterisk \ + /home/asterisk \ + /var/*/asterisk \ + /usr/lib*/asterisk 2>/dev/null || true \ + && chmod -R 750 /var/spool/asterisk + +# Runtime verification +RUN asterisk -V || (echo "Error: Unable to run asterisk -V" && exit 1) + +# Configure networking +# EXPOSE 5060/udp +# EXPOSE 5060/tcp +# EXPOSE 5061/tcp +# EXPOSE 10000-10099/udp + +# Define volumes for persistent data +VOLUME ["/var/lib/asterisk/sounds", "/var/lib/asterisk/keys", "/var/lib/asterisk/phoneprov", "/var/spool/asterisk", "/var/log/asterisk", "/etc/asterisk"] + +# Add health check +HEALTHCHECK --interval=30s \ + --timeout=10s \ + --start-period=30s \ + --retries=3 \ + CMD /usr/local/bin/healthcheck.sh + +# Switch to non-root user +USER asterisk + +# Set working directory +WORKDIR /home/asterisk + +# Default command with production settings +CMD ["/usr/sbin/asterisk", "-vvvdddf", "-T", "-W", "-U", "asterisk", "-p"] diff --git a/asterisk/21.12.1-trixie/build.sh b/asterisk/21.12.1-trixie/build.sh new file mode 100755 index 000000000..42caa5256 --- /dev/null +++ b/asterisk/21.12.1-trixie/build.sh @@ -0,0 +1,108 @@ +#!/bin/bash +# Asterisk build script +# Generated from template for 21.12.1 +# Contains menuselect configuration and build commands + +set -euo pipefail + +# Color output for better readability +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +log() { + echo -e "${GREEN}[BUILD]${NC} $1" +} + +warn() { + echo -e "${YELLOW}[WARN]${NC} $1" +} + +error() { + echo -e "${RED}[ERROR]${NC} $1" +} + +log "Starting Asterisk 21.12.1 build process..." + +# Set build parallelization (use Docker ARG or default) +NPROC=$(nproc) +JOBS=${JOBS:-8} +log "Using $JOBS parallel jobs for compilation (detected $NPROC CPUs)" + +# Configure Asterisk +log "Configuring Asterisk with options..." +./configure --with-pjproject-bundled --with-ssl=ssl --with-crypto + +# Build menuselect tool +log "Building menuselect tool..." +make menuselect + +# Configure Asterisk modules using menuselect +log "Configuring Asterisk modules..." + +# Disable BUILD_NATIVE optimization for container builds +menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts + +# Enable better backtraces for debugging +menuselect/menuselect --enable BETTER_BACKTRACES menuselect.makeopts + +# Disable sound packages to reduce image size +menuselect/menuselect --disable-category MENUSELECT_CORE_SOUNDS menuselect.makeopts +menuselect/menuselect --disable-category MENUSELECT_MOH menuselect.makeopts +menuselect/menuselect --disable-category MENUSELECT_EXTRA_SOUNDS menuselect.makeopts + +# Enable core applications +menuselect/menuselect --enable app_voicemail menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_voicemail menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_queue menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_queue menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_confbridge menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_confbridge menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_directory menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_directory menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_dial menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_dial menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_playback menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_playback menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_record menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_record menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_echo menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_echo menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_mixmonitor menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_mixmonitor menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Enable CDR and CEL modules + +# Enable channel drivers +menuselect/menuselect --enable chan_pjsip menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_pjsip menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_iax2 menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_iax2 menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_local menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_local menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_bridge_media menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_bridge_media menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Enable resource modules +menuselect/menuselect --enable res_musiconhold menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_musiconhold menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_session menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_session menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_outbound_registration menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_outbound_registration menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_registrar menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_registrar menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_rtp_asterisk menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_rtp_asterisk menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_timing_timerfd menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_timing_timerfd menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_crypto menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_crypto menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Disable unwanted modules +menuselect/menuselect --disable chan_dahdi menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable chan_dahdi menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --disable chan_misdn menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable chan_misdn menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --disable app_festival menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable app_festival menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --disable chan_sip menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable chan_sip menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + + +log "Module configuration completed" + + +# Build Asterisk +log "Building Asterisk core (this may take several minutes)..." +TMPDIR=${TMPDIR} make -j $JOBS all +log "Installing Asterisk..." +TMPDIR=${TMPDIR} make install +log "Installing sample configurations..." +TMPDIR=${TMPDIR} make samples + + +# Strip binaries to reduce size +log "Stripping binaries to reduce image size..." +find /usr/sbin /usr/lib/asterisk -type f -executable \ + -exec strip --strip-unneeded {} + 2>/dev/null || true + +log "Asterisk 21.12.1 build completed successfully!" \ No newline at end of file diff --git a/asterisk/21.12.1-trixie/healthcheck.sh b/asterisk/21.12.1-trixie/healthcheck.sh new file mode 100755 index 000000000..f20c6e8c2 --- /dev/null +++ b/asterisk/21.12.1-trixie/healthcheck.sh @@ -0,0 +1,157 @@ +#!/bin/bash +# Asterisk health check script +# Generated from template for 21.12.1 + +set -euo pipefail + +# Configuration +ASTERISK_CLI="/usr/sbin/asterisk -rx" +TIMEOUT=10 +VERBOSE=false + +# Parse command line arguments +while [[ $# -gt 0 ]]; do + case $1 in + -v|--verbose) + VERBOSE=true + shift + ;; + -t|--timeout) + TIMEOUT="$2" + shift 2 + ;; + *) + echo "Unknown option: $1" >&2 + exit 1 + ;; + esac +done + +# Logging functions +log() { + if [[ "$VERBOSE" == "true" ]]; then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" >&2 + fi +} + +error() { + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ERROR: $*" >&2 +} + +# Health check functions +check_asterisk_running() { + log "Checking if Asterisk is running..." + if ! pgrep -x asterisk >/dev/null; then + error "Asterisk process not found" + return 1 + fi + log "✓ Asterisk process is running" + return 0 +} + +check_asterisk_responsive() { + log "Checking if Asterisk CLI is responsive..." + if ! timeout $TIMEOUT $ASTERISK_CLI "core show version" >/dev/null 2>&1; then + error "Asterisk CLI not responsive" + return 1 + fi + log "✓ Asterisk CLI is responsive" + return 0 +} + +check_pjsip_status() { + log "Checking PJSIP status..." + if ! timeout $TIMEOUT $ASTERISK_CLI "pjsip show version" >/dev/null 2>&1; then + error "PJSIP not available or not responding" + return 1 + fi + log "✓ PJSIP is available" + return 0 +} + +check_database_connectivity() { + log "Checking database connectivity..." + # Check if ODBC is configured and working + if ! timeout $TIMEOUT $ASTERISK_CLI "odbc show all" | grep -q "Connected" 2>/dev/null; then + log "⚠ No ODBC connections found (this may be normal)" + else + log "✓ Database connections available" + fi + return 0 +} + +check_essential_modules() { + log "Checking essential modules..." + local required_modules=( + "res_rtp_asterisk" + "res_timing_timerfd" + "res_crypto" + "res_pjsip" + ) + + for module in "${required_modules[@]}"; do + if ! timeout $TIMEOUT $ASTERISK_CLI "module show like $module" | grep -q "$module" >/dev/null 2>&1; then + error "Required module $module not loaded" + return 1 + fi + done + log "✓ Essential modules are loaded" + return 0 +} + +check_filesystem_access() { + log "Checking filesystem access..." + local required_dirs=( + "/var/log/asterisk" + "/var/spool/asterisk" + "/var/lib/asterisk" + "/etc/asterisk" + ) + + for dir in "${required_dirs[@]}"; do + if [[ ! -d "$dir" ]]; then + error "Required directory $dir not found" + return 1 + fi + if [[ ! -r "$dir" ]]; then + error "Directory $dir not readable" + return 1 + fi + done + log "✓ Filesystem access is working" + return 0 +} + +# Main health check +main() { + log "Starting Asterisk health check..." + + local checks=( + "check_asterisk_running" + "check_asterisk_responsive" + "check_pjsip_status" + "check_database_connectivity" + "check_essential_modules" + "check_filesystem_access" + ) + + local failed=0 + for check in "${checks[@]}"; do + if ! $check; then + failed=$((failed + 1)) + fi + done + + if [[ $failed -eq 0 ]]; then + log "✓ All health checks passed" + exit 0 + else + error "Health check failed: $failed checks failed" + exit 1 + fi +} + +# Handle signals +trap 'error "Health check interrupted"; exit 1' INT TERM + +main "$@" \ No newline at end of file diff --git a/asterisk/22.8.2-trixie/Dockerfile b/asterisk/22.8.2-trixie/Dockerfile new file mode 100644 index 000000000..6617c7de6 --- /dev/null +++ b/asterisk/22.8.2-trixie/Dockerfile @@ -0,0 +1,169 @@ +# Multi-stage optimized Asterisk Docker build +# Asterisk 22.8.2 on Debian trixie +# Generated from YAML configuration - DO NOT EDIT MANUALLY + +# ============================================================================== +# STAGE 1: Build Environment +# ============================================================================== +FROM debian:trixie AS asterisk-builder + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX Builder" +LABEL org.opencontainers.image.description="Build stage for Asterisk 22.8.2" +LABEL org.opencontainers.image.version="22.8.2" +LABEL org.opencontainers.image.source="https://github.com/andrius/asterisk" + +# Build arguments +ARG ASTERISK_VERSION=22.8.2 +ARG JOBS=8 +ARG DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH + +# Environment variables +ENV ASTERISK_VERSION=${ASTERISK_VERSION} +ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND} +ENV TMPDIR="/tmp/asterisk_build" + +# Create build directories first +RUN mkdir -p \ + /usr/src/asterisk \ + ${TMPDIR} \ + && chmod 777 ${TMPDIR} + +# EOL distribution setup (if needed) +# Update package lists and install ca-certificates first, then build dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates \ + && apt-get install -y --no-install-recommends \ + build-essential autoconf binutils-dev curl file libcurl4-openssl-dev \ + libedit-dev libgsm1-dev libicu-dev libjansson-dev libncurses-dev libogg-dev \ + libpopt-dev libpqxx-dev libresample1-dev libspandsp-dev libspeex-dev \ + libspeexdsp-dev libsqlite3-dev libssl-dev libtool libvorbis-dev libxml2-dev \ + libxslt1-dev make odbcinst patch pkg-config portaudio19-dev procps \ + python3-dev unixodbc unixodbc-dev uuid uuid-dev xmlstarlet libsrtp2-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p ${TMPDIR} && chmod 777 ${TMPDIR} + + +WORKDIR /usr/src/asterisk + +# Download and extract Asterisk source +RUN curl -fsSL https://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-22.8.2.tar.gz \ + | tar --strip-components=1 -xz + + +# Configure Asterisk build (skip for very old versions that don't have configure script) +RUN ./configure + +# Generate menuselect configuration +RUN make menuselect/menuselect menuselect-tree menuselect.makeopts + +# Optimize build configuration for smaller image +RUN sed -i 's/HAVE_XML2 = yes/HAVE_XML2 = no/' makeopts \ + && sed -i 's/HAVE_XMLSTARLET = yes/HAVE_XMLSTARLET = no/' makeopts + +# Copy and execute build script +COPY build.sh /usr/src/asterisk/build.sh +RUN chmod +x build.sh && ./build.sh + +# ============================================================================== +# STAGE 2: Runtime Environment +# ============================================================================== +FROM debian:trixie AS asterisk-runtime + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX Runtime" +LABEL org.opencontainers.image.description="Runtime environment for Asterisk 22.8.2" + +ARG DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH +ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND} + +# Install only runtime dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + binutils curl libedit2 libgsm1 libjansson4 libogg0 libpopt0 libresample1 \ + libspandsp2 libspeex1 libspeexdsp1 libsqlite3-0 libvorbis0a libxml2 \ + libxslt1.1 odbcinst portaudio19-dev procps python3 unixodbc uuid libcurl4t64 \ + libssl3t64 libsrtp2-1 libncurses6 libpqxx-7.10 libicu76 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Create asterisk user and required directories +RUN useradd --uid 1000 --system --user-group \ + --home-dir /home/asterisk --create-home \ + asterisk \ + && mkdir -p \ + /var/run/asterisk \ + /var/log/asterisk \ + /var/spool/asterisk/monitor \ + /var/spool/asterisk/outgoing \ + /var/spool/asterisk/tmp \ + /var/spool/asterisk/voicemail \ + /var/spool/asterisk/fax \ + /var/lib/asterisk/keys \ + /var/lib/asterisk/phoneprov \ + /var/lib/asterisk/sounds \ + /var/lib/asterisk/docs + +# ============================================================================== +# STAGE 3: Final Production Image +# ============================================================================== +FROM asterisk-runtime AS asterisk-production + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX" +LABEL org.opencontainers.image.description="Production Asterisk PBX 22.8.2" +LABEL org.opencontainers.image.version="22.8.2" +LABEL org.opencontainers.image.source="https://github.com/andrius/asterisk" +LABEL org.opencontainers.image.vendor="Andrius Kairiukstis " + +# Copy Asterisk binaries and configurations from builder +COPY --from=asterisk-builder /usr/sbin/asterisk /usr/sbin/asterisk +COPY --from=asterisk-builder /usr/lib/asterisk /usr/lib/asterisk +COPY --from=asterisk-builder /var/lib/asterisk /var/lib/asterisk +COPY --from=asterisk-builder /etc/asterisk /etc/asterisk + +# Copy Asterisk shared libraries +COPY --from=asterisk-builder /usr/lib/libasterisk*.so* /usr/lib/ + +# Copy healthcheck script +COPY healthcheck.sh /usr/local/bin/healthcheck.sh +RUN chmod +x /usr/local/bin/healthcheck.sh + +# Set proper ownership and permissions +RUN chown -R asterisk:asterisk \ + /etc/asterisk \ + /home/asterisk \ + /var/*/asterisk \ + /usr/lib*/asterisk 2>/dev/null || true \ + && chmod -R 750 /var/spool/asterisk + +# Runtime verification +RUN asterisk -V || (echo "Error: Unable to run asterisk -V" && exit 1) + +# Configure networking +# EXPOSE 5060/udp +# EXPOSE 5060/tcp +# EXPOSE 5061/tcp +# EXPOSE 10000-10099/udp + +# Define volumes for persistent data +VOLUME ["/var/lib/asterisk/sounds", "/var/lib/asterisk/keys", "/var/lib/asterisk/phoneprov", "/var/spool/asterisk", "/var/log/asterisk", "/etc/asterisk"] + +# Add health check +HEALTHCHECK --interval=30s \ + --timeout=10s \ + --start-period=30s \ + --retries=3 \ + CMD /usr/local/bin/healthcheck.sh + +# Switch to non-root user +USER asterisk + +# Set working directory +WORKDIR /home/asterisk + +# Default command with production settings +CMD ["/usr/sbin/asterisk", "-vvvdddf", "-T", "-W", "-U", "asterisk", "-p"] diff --git a/asterisk/22.8.2-trixie/build.sh b/asterisk/22.8.2-trixie/build.sh new file mode 100755 index 000000000..0c4edd3f1 --- /dev/null +++ b/asterisk/22.8.2-trixie/build.sh @@ -0,0 +1,108 @@ +#!/bin/bash +# Asterisk build script +# Generated from template for 22.8.2 +# Contains menuselect configuration and build commands + +set -euo pipefail + +# Color output for better readability +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +log() { + echo -e "${GREEN}[BUILD]${NC} $1" +} + +warn() { + echo -e "${YELLOW}[WARN]${NC} $1" +} + +error() { + echo -e "${RED}[ERROR]${NC} $1" +} + +log "Starting Asterisk 22.8.2 build process..." + +# Set build parallelization (use Docker ARG or default) +NPROC=$(nproc) +JOBS=${JOBS:-8} +log "Using $JOBS parallel jobs for compilation (detected $NPROC CPUs)" + +# Configure Asterisk +log "Configuring Asterisk with options..." +./configure --with-pjproject-bundled --with-ssl=ssl --with-crypto + +# Build menuselect tool +log "Building menuselect tool..." +make menuselect + +# Configure Asterisk modules using menuselect +log "Configuring Asterisk modules..." + +# Disable BUILD_NATIVE optimization for container builds +menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts + +# Enable better backtraces for debugging +menuselect/menuselect --enable BETTER_BACKTRACES menuselect.makeopts + +# Disable sound packages to reduce image size +menuselect/menuselect --disable-category MENUSELECT_CORE_SOUNDS menuselect.makeopts +menuselect/menuselect --disable-category MENUSELECT_MOH menuselect.makeopts +menuselect/menuselect --disable-category MENUSELECT_EXTRA_SOUNDS menuselect.makeopts + +# Enable core applications +menuselect/menuselect --enable app_voicemail menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_voicemail menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_queue menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_queue menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_confbridge menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_confbridge menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_directory menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_directory menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_dial menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_dial menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_playback menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_playback menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_record menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_record menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_echo menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_echo menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_mixmonitor menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_mixmonitor menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Enable CDR and CEL modules + +# Enable channel drivers +menuselect/menuselect --enable chan_pjsip menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_pjsip menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_iax2 menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_iax2 menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_local menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_local menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_bridge_media menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_bridge_media menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Enable resource modules +menuselect/menuselect --enable res_musiconhold menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_musiconhold menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_session menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_session menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_outbound_registration menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_outbound_registration menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_registrar menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_registrar menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_rtp_asterisk menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_rtp_asterisk menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_timing_timerfd menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_timing_timerfd menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_crypto menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_crypto menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Disable unwanted modules +menuselect/menuselect --disable chan_dahdi menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable chan_dahdi menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --disable chan_misdn menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable chan_misdn menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --disable app_festival menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable app_festival menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --disable chan_sip menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable chan_sip menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + + +log "Module configuration completed" + + +# Build Asterisk +log "Building Asterisk core (this may take several minutes)..." +TMPDIR=${TMPDIR} make -j $JOBS all +log "Installing Asterisk..." +TMPDIR=${TMPDIR} make install +log "Installing sample configurations..." +TMPDIR=${TMPDIR} make samples + + +# Strip binaries to reduce size +log "Stripping binaries to reduce image size..." +find /usr/sbin /usr/lib/asterisk -type f -executable \ + -exec strip --strip-unneeded {} + 2>/dev/null || true + +log "Asterisk 22.8.2 build completed successfully!" \ No newline at end of file diff --git a/asterisk/22.8.2-trixie/healthcheck.sh b/asterisk/22.8.2-trixie/healthcheck.sh new file mode 100755 index 000000000..ef4a98aa4 --- /dev/null +++ b/asterisk/22.8.2-trixie/healthcheck.sh @@ -0,0 +1,157 @@ +#!/bin/bash +# Asterisk health check script +# Generated from template for 22.8.2 + +set -euo pipefail + +# Configuration +ASTERISK_CLI="/usr/sbin/asterisk -rx" +TIMEOUT=10 +VERBOSE=false + +# Parse command line arguments +while [[ $# -gt 0 ]]; do + case $1 in + -v|--verbose) + VERBOSE=true + shift + ;; + -t|--timeout) + TIMEOUT="$2" + shift 2 + ;; + *) + echo "Unknown option: $1" >&2 + exit 1 + ;; + esac +done + +# Logging functions +log() { + if [[ "$VERBOSE" == "true" ]]; then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" >&2 + fi +} + +error() { + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ERROR: $*" >&2 +} + +# Health check functions +check_asterisk_running() { + log "Checking if Asterisk is running..." + if ! pgrep -x asterisk >/dev/null; then + error "Asterisk process not found" + return 1 + fi + log "✓ Asterisk process is running" + return 0 +} + +check_asterisk_responsive() { + log "Checking if Asterisk CLI is responsive..." + if ! timeout $TIMEOUT $ASTERISK_CLI "core show version" >/dev/null 2>&1; then + error "Asterisk CLI not responsive" + return 1 + fi + log "✓ Asterisk CLI is responsive" + return 0 +} + +check_pjsip_status() { + log "Checking PJSIP status..." + if ! timeout $TIMEOUT $ASTERISK_CLI "pjsip show version" >/dev/null 2>&1; then + error "PJSIP not available or not responding" + return 1 + fi + log "✓ PJSIP is available" + return 0 +} + +check_database_connectivity() { + log "Checking database connectivity..." + # Check if ODBC is configured and working + if ! timeout $TIMEOUT $ASTERISK_CLI "odbc show all" | grep -q "Connected" 2>/dev/null; then + log "⚠ No ODBC connections found (this may be normal)" + else + log "✓ Database connections available" + fi + return 0 +} + +check_essential_modules() { + log "Checking essential modules..." + local required_modules=( + "res_rtp_asterisk" + "res_timing_timerfd" + "res_crypto" + "res_pjsip" + ) + + for module in "${required_modules[@]}"; do + if ! timeout $TIMEOUT $ASTERISK_CLI "module show like $module" | grep -q "$module" >/dev/null 2>&1; then + error "Required module $module not loaded" + return 1 + fi + done + log "✓ Essential modules are loaded" + return 0 +} + +check_filesystem_access() { + log "Checking filesystem access..." + local required_dirs=( + "/var/log/asterisk" + "/var/spool/asterisk" + "/var/lib/asterisk" + "/etc/asterisk" + ) + + for dir in "${required_dirs[@]}"; do + if [[ ! -d "$dir" ]]; then + error "Required directory $dir not found" + return 1 + fi + if [[ ! -r "$dir" ]]; then + error "Directory $dir not readable" + return 1 + fi + done + log "✓ Filesystem access is working" + return 0 +} + +# Main health check +main() { + log "Starting Asterisk health check..." + + local checks=( + "check_asterisk_running" + "check_asterisk_responsive" + "check_pjsip_status" + "check_database_connectivity" + "check_essential_modules" + "check_filesystem_access" + ) + + local failed=0 + for check in "${checks[@]}"; do + if ! $check; then + failed=$((failed + 1)) + fi + done + + if [[ $failed -eq 0 ]]; then + log "✓ All health checks passed" + exit 0 + else + error "Health check failed: $failed checks failed" + exit 1 + fi +} + +# Handle signals +trap 'error "Health check interrupted"; exit 1' INT TERM + +main "$@" \ No newline at end of file diff --git a/asterisk/23.2.2-trixie/Dockerfile b/asterisk/23.2.2-trixie/Dockerfile new file mode 100644 index 000000000..4a9bc5ea2 --- /dev/null +++ b/asterisk/23.2.2-trixie/Dockerfile @@ -0,0 +1,169 @@ +# Multi-stage optimized Asterisk Docker build +# Asterisk 23.2.2 on Debian trixie +# Generated from YAML configuration - DO NOT EDIT MANUALLY + +# ============================================================================== +# STAGE 1: Build Environment +# ============================================================================== +FROM debian:trixie AS asterisk-builder + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX Builder" +LABEL org.opencontainers.image.description="Build stage for Asterisk 23.2.2" +LABEL org.opencontainers.image.version="23.2.2" +LABEL org.opencontainers.image.source="https://github.com/andrius/asterisk" + +# Build arguments +ARG ASTERISK_VERSION=23.2.2 +ARG JOBS=8 +ARG DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH + +# Environment variables +ENV ASTERISK_VERSION=${ASTERISK_VERSION} +ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND} +ENV TMPDIR="/tmp/asterisk_build" + +# Create build directories first +RUN mkdir -p \ + /usr/src/asterisk \ + ${TMPDIR} \ + && chmod 777 ${TMPDIR} + +# EOL distribution setup (if needed) +# Update package lists and install ca-certificates first, then build dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates \ + && apt-get install -y --no-install-recommends \ + build-essential autoconf binutils-dev curl file libcurl4-openssl-dev \ + libedit-dev libgsm1-dev libicu-dev libjansson-dev libncurses-dev libogg-dev \ + libpopt-dev libpqxx-dev libresample1-dev libspandsp-dev libspeex-dev \ + libspeexdsp-dev libsqlite3-dev libssl-dev libtool libvorbis-dev libxml2-dev \ + libxslt1-dev make odbcinst patch pkg-config portaudio19-dev procps \ + python3-dev unixodbc unixodbc-dev uuid uuid-dev xmlstarlet libsrtp2-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p ${TMPDIR} && chmod 777 ${TMPDIR} + + +WORKDIR /usr/src/asterisk + +# Download and extract Asterisk source +RUN curl -fsSL https://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-23.2.2.tar.gz \ + | tar --strip-components=1 -xz + + +# Configure Asterisk build (skip for very old versions that don't have configure script) +RUN ./configure + +# Generate menuselect configuration +RUN make menuselect/menuselect menuselect-tree menuselect.makeopts + +# Optimize build configuration for smaller image +RUN sed -i 's/HAVE_XML2 = yes/HAVE_XML2 = no/' makeopts \ + && sed -i 's/HAVE_XMLSTARLET = yes/HAVE_XMLSTARLET = no/' makeopts + +# Copy and execute build script +COPY build.sh /usr/src/asterisk/build.sh +RUN chmod +x build.sh && ./build.sh + +# ============================================================================== +# STAGE 2: Runtime Environment +# ============================================================================== +FROM debian:trixie AS asterisk-runtime + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX Runtime" +LABEL org.opencontainers.image.description="Runtime environment for Asterisk 23.2.2" + +ARG DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH +ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND} + +# Install only runtime dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + binutils curl libedit2 libgsm1 libjansson4 libogg0 libpopt0 libresample1 \ + libspandsp2 libspeex1 libspeexdsp1 libsqlite3-0 libvorbis0a libxml2 \ + libxslt1.1 odbcinst portaudio19-dev procps python3 unixodbc uuid libcurl4t64 \ + libssl3t64 libsrtp2-1 libncurses6 libpqxx-7.10 libicu76 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Create asterisk user and required directories +RUN useradd --uid 1000 --system --user-group \ + --home-dir /home/asterisk --create-home \ + asterisk \ + && mkdir -p \ + /var/run/asterisk \ + /var/log/asterisk \ + /var/spool/asterisk/monitor \ + /var/spool/asterisk/outgoing \ + /var/spool/asterisk/tmp \ + /var/spool/asterisk/voicemail \ + /var/spool/asterisk/fax \ + /var/lib/asterisk/keys \ + /var/lib/asterisk/phoneprov \ + /var/lib/asterisk/sounds \ + /var/lib/asterisk/docs + +# ============================================================================== +# STAGE 3: Final Production Image +# ============================================================================== +FROM asterisk-runtime AS asterisk-production + +LABEL maintainer="Andrius Kairiukstis " +LABEL org.opencontainers.image.title="Asterisk PBX" +LABEL org.opencontainers.image.description="Production Asterisk PBX 23.2.2" +LABEL org.opencontainers.image.version="23.2.2" +LABEL org.opencontainers.image.source="https://github.com/andrius/asterisk" +LABEL org.opencontainers.image.vendor="Andrius Kairiukstis " + +# Copy Asterisk binaries and configurations from builder +COPY --from=asterisk-builder /usr/sbin/asterisk /usr/sbin/asterisk +COPY --from=asterisk-builder /usr/lib/asterisk /usr/lib/asterisk +COPY --from=asterisk-builder /var/lib/asterisk /var/lib/asterisk +COPY --from=asterisk-builder /etc/asterisk /etc/asterisk + +# Copy Asterisk shared libraries +COPY --from=asterisk-builder /usr/lib/libasterisk*.so* /usr/lib/ + +# Copy healthcheck script +COPY healthcheck.sh /usr/local/bin/healthcheck.sh +RUN chmod +x /usr/local/bin/healthcheck.sh + +# Set proper ownership and permissions +RUN chown -R asterisk:asterisk \ + /etc/asterisk \ + /home/asterisk \ + /var/*/asterisk \ + /usr/lib*/asterisk 2>/dev/null || true \ + && chmod -R 750 /var/spool/asterisk + +# Runtime verification +RUN asterisk -V || (echo "Error: Unable to run asterisk -V" && exit 1) + +# Configure networking +# EXPOSE 5060/udp +# EXPOSE 5060/tcp +# EXPOSE 5061/tcp +# EXPOSE 10000-10099/udp + +# Define volumes for persistent data +VOLUME ["/var/lib/asterisk/sounds", "/var/lib/asterisk/keys", "/var/lib/asterisk/phoneprov", "/var/spool/asterisk", "/var/log/asterisk", "/etc/asterisk"] + +# Add health check +HEALTHCHECK --interval=30s \ + --timeout=10s \ + --start-period=30s \ + --retries=3 \ + CMD /usr/local/bin/healthcheck.sh + +# Switch to non-root user +USER asterisk + +# Set working directory +WORKDIR /home/asterisk + +# Default command with production settings +CMD ["/usr/sbin/asterisk", "-vvvdddf", "-T", "-W", "-U", "asterisk", "-p"] diff --git a/asterisk/23.2.2-trixie/build.sh b/asterisk/23.2.2-trixie/build.sh new file mode 100755 index 000000000..d79ac685e --- /dev/null +++ b/asterisk/23.2.2-trixie/build.sh @@ -0,0 +1,109 @@ +#!/bin/bash +# Asterisk build script +# Generated from template for 23.2.2 +# Contains menuselect configuration and build commands + +set -euo pipefail + +# Color output for better readability +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +log() { + echo -e "${GREEN}[BUILD]${NC} $1" +} + +warn() { + echo -e "${YELLOW}[WARN]${NC} $1" +} + +error() { + echo -e "${RED}[ERROR]${NC} $1" +} + +log "Starting Asterisk 23.2.2 build process..." + +# Set build parallelization (use Docker ARG or default) +NPROC=$(nproc) +JOBS=${JOBS:-8} +log "Using $JOBS parallel jobs for compilation (detected $NPROC CPUs)" + +# Configure Asterisk +log "Configuring Asterisk with options..." +./configure --with-pjproject-bundled --with-ssl=ssl --with-crypto + +# Build menuselect tool +log "Building menuselect tool..." +make menuselect + +# Configure Asterisk modules using menuselect +log "Configuring Asterisk modules..." + +# Disable BUILD_NATIVE optimization for container builds +menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts + +# Enable better backtraces for debugging +menuselect/menuselect --enable BETTER_BACKTRACES menuselect.makeopts + +# Disable sound packages to reduce image size +menuselect/menuselect --disable-category MENUSELECT_CORE_SOUNDS menuselect.makeopts +menuselect/menuselect --disable-category MENUSELECT_MOH menuselect.makeopts +menuselect/menuselect --disable-category MENUSELECT_EXTRA_SOUNDS menuselect.makeopts + +# Enable core applications +menuselect/menuselect --enable app_voicemail menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_voicemail menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_queue menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_queue menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_confbridge menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_confbridge menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_directory menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_directory menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_dial menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_dial menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_playback menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_playback menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_record menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_record menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_echo menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_echo menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable app_mixmonitor menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable app_mixmonitor menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Enable CDR and CEL modules + +# Enable channel drivers +menuselect/menuselect --enable chan_pjsip menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_pjsip menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_iax2 menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_iax2 menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_local menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_local menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_bridge_media menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_bridge_media menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable chan_websocket menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable chan_websocket menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Enable resource modules +menuselect/menuselect --enable res_musiconhold menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_musiconhold menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_session menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_session menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_outbound_registration menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_outbound_registration menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_pjsip_registrar menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_pjsip_registrar menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_rtp_asterisk menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_rtp_asterisk menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_timing_timerfd menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_timing_timerfd menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --enable res_crypto menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --enable res_crypto menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + +# Disable unwanted modules +menuselect/menuselect --disable chan_dahdi menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable chan_dahdi menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --disable chan_misdn menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable chan_misdn menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --disable app_festival menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable app_festival menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" +menuselect/menuselect --disable chan_sip menuselect.makeopts || warn "Module not found: $(echo 'menuselect/menuselect --disable chan_sip menuselect.makeopts' | grep -o '[a-z_]*' | tail -1)" + + +log "Module configuration completed" + + +# Build Asterisk +log "Building Asterisk core (this may take several minutes)..." +TMPDIR=${TMPDIR} make -j $JOBS all +log "Installing Asterisk..." +TMPDIR=${TMPDIR} make install +log "Installing sample configurations..." +TMPDIR=${TMPDIR} make samples + + +# Strip binaries to reduce size +log "Stripping binaries to reduce image size..." +find /usr/sbin /usr/lib/asterisk -type f -executable \ + -exec strip --strip-unneeded {} + 2>/dev/null || true + +log "Asterisk 23.2.2 build completed successfully!" \ No newline at end of file diff --git a/asterisk/23.2.2-trixie/healthcheck.sh b/asterisk/23.2.2-trixie/healthcheck.sh new file mode 100755 index 000000000..b17f4e890 --- /dev/null +++ b/asterisk/23.2.2-trixie/healthcheck.sh @@ -0,0 +1,157 @@ +#!/bin/bash +# Asterisk health check script +# Generated from template for 23.2.2 + +set -euo pipefail + +# Configuration +ASTERISK_CLI="/usr/sbin/asterisk -rx" +TIMEOUT=10 +VERBOSE=false + +# Parse command line arguments +while [[ $# -gt 0 ]]; do + case $1 in + -v|--verbose) + VERBOSE=true + shift + ;; + -t|--timeout) + TIMEOUT="$2" + shift 2 + ;; + *) + echo "Unknown option: $1" >&2 + exit 1 + ;; + esac +done + +# Logging functions +log() { + if [[ "$VERBOSE" == "true" ]]; then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" >&2 + fi +} + +error() { + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ERROR: $*" >&2 +} + +# Health check functions +check_asterisk_running() { + log "Checking if Asterisk is running..." + if ! pgrep -x asterisk >/dev/null; then + error "Asterisk process not found" + return 1 + fi + log "✓ Asterisk process is running" + return 0 +} + +check_asterisk_responsive() { + log "Checking if Asterisk CLI is responsive..." + if ! timeout $TIMEOUT $ASTERISK_CLI "core show version" >/dev/null 2>&1; then + error "Asterisk CLI not responsive" + return 1 + fi + log "✓ Asterisk CLI is responsive" + return 0 +} + +check_pjsip_status() { + log "Checking PJSIP status..." + if ! timeout $TIMEOUT $ASTERISK_CLI "pjsip show version" >/dev/null 2>&1; then + error "PJSIP not available or not responding" + return 1 + fi + log "✓ PJSIP is available" + return 0 +} + +check_database_connectivity() { + log "Checking database connectivity..." + # Check if ODBC is configured and working + if ! timeout $TIMEOUT $ASTERISK_CLI "odbc show all" | grep -q "Connected" 2>/dev/null; then + log "⚠ No ODBC connections found (this may be normal)" + else + log "✓ Database connections available" + fi + return 0 +} + +check_essential_modules() { + log "Checking essential modules..." + local required_modules=( + "res_rtp_asterisk" + "res_timing_timerfd" + "res_crypto" + "res_pjsip" + ) + + for module in "${required_modules[@]}"; do + if ! timeout $TIMEOUT $ASTERISK_CLI "module show like $module" | grep -q "$module" >/dev/null 2>&1; then + error "Required module $module not loaded" + return 1 + fi + done + log "✓ Essential modules are loaded" + return 0 +} + +check_filesystem_access() { + log "Checking filesystem access..." + local required_dirs=( + "/var/log/asterisk" + "/var/spool/asterisk" + "/var/lib/asterisk" + "/etc/asterisk" + ) + + for dir in "${required_dirs[@]}"; do + if [[ ! -d "$dir" ]]; then + error "Required directory $dir not found" + return 1 + fi + if [[ ! -r "$dir" ]]; then + error "Directory $dir not readable" + return 1 + fi + done + log "✓ Filesystem access is working" + return 0 +} + +# Main health check +main() { + log "Starting Asterisk health check..." + + local checks=( + "check_asterisk_running" + "check_asterisk_responsive" + "check_pjsip_status" + "check_database_connectivity" + "check_essential_modules" + "check_filesystem_access" + ) + + local failed=0 + for check in "${checks[@]}"; do + if ! $check; then + failed=$((failed + 1)) + fi + done + + if [[ $failed -eq 0 ]]; then + log "✓ All health checks passed" + exit 0 + else + error "Health check failed: $failed checks failed" + exit 1 + fi +} + +# Handle signals +trap 'error "Health check interrupted"; exit 1' INT TERM + +main "$@" \ No newline at end of file diff --git a/asterisk/asterisk-certified-releases.txt b/asterisk/asterisk-certified-releases.txt index 10550ef5f..23c75ab53 100644 --- a/asterisk/asterisk-certified-releases.txt +++ b/asterisk/asterisk-certified-releases.txt @@ -79,3 +79,4 @@ current 20.7-cert6 20.7-cert7 20.7-cert8 +20.7-cert9 diff --git a/asterisk/asterisk-certified-releases.yml b/asterisk/asterisk-certified-releases.yml index fae37d0b1..ac99fdcc2 100644 --- a/asterisk/asterisk-certified-releases.yml +++ b/asterisk/asterisk-certified-releases.yml @@ -101,5 +101,6 @@ - 20.7-cert6 - 20.7-cert7 - 20.7-cert8 + - 20.7-cert9 current: - current diff --git a/asterisk/asterisk-releases.txt b/asterisk/asterisk-releases.txt index 7226c0380..275435c68 100644 --- a/asterisk/asterisk-releases.txt +++ b/asterisk/asterisk-releases.txt @@ -1189,6 +1189,8 @@ 20.17.0-rc2 20.18.0 20.18.0-rc1 +20.18.1 +20.18.2 21.0.0 21.0.0-rc1 21.0.1 @@ -1233,6 +1235,7 @@ 21.12.0 21.12.0-rc1 21.12.0-rc2 +21.12.1 22.0.0 22.0.0-rc1 22.0.0-rc2 @@ -1261,6 +1264,8 @@ 22.7.0-rc2 22.8.0 22.8.0-rc1 +22.8.1 +22.8.2 23.0.0 23.0.0-rc1 23.0.0-rc2 @@ -1269,3 +1274,5 @@ 23.1.0-rc2 23.2.0 23.2.0-rc1 +23.2.1 +23.2.2 diff --git a/asterisk/asterisk-releases.yml b/asterisk/asterisk-releases.yml index 5a0eb0a7f..ff3b47f08 100644 --- a/asterisk/asterisk-releases.yml +++ b/asterisk/asterisk-releases.yml @@ -1202,6 +1202,8 @@ - 20.17.0-rc2 - 20.18.0 - 20.18.0-rc1 + - 20.18.1 + - 20.18.2 21: - 21.0.0 - 21.0.0-rc1 @@ -1247,6 +1249,7 @@ - 21.12.0 - 21.12.0-rc1 - 21.12.0-rc2 + - 21.12.1 22: - 22.0.0 - 22.0.0-rc1 @@ -1276,6 +1279,8 @@ - 22.7.0-rc2 - 22.8.0 - 22.8.0-rc1 + - 22.8.1 + - 22.8.2 23: - 23.0.0 - 23.0.0-rc1 @@ -1285,3 +1290,5 @@ - 23.1.0-rc2 - 23.2.0 - 23.2.0-rc1 + - 23.2.1 + - 23.2.2 diff --git a/asterisk/supported-asterisk-builds.yml b/asterisk/supported-asterisk-builds.yml index 14d58d8dd..66bb890d4 100644 --- a/asterisk/supported-asterisk-builds.yml +++ b/asterisk/supported-asterisk-builds.yml @@ -240,8 +240,48 @@ latest_builds: - "amd64" - "arm64" + - version: "20.18.2" + os_matrix: + - os: "debian" + distribution: "trixie" + architectures: + - "amd64" + - "arm64" + + - version: "20.7-cert9" + os_matrix: + - os: "debian" + distribution: "trixie" + architectures: + - "amd64" + - "arm64" + + - version: "21.12.1" + os_matrix: + - os: "debian" + distribution: "trixie" + architectures: + - "amd64" + - "arm64" + + - version: "22.8.2" + os_matrix: + - os: "debian" + distribution: "trixie" + architectures: + - "amd64" + - "arm64" + + - version: "23.2.2" + os_matrix: + - os: "debian" + distribution: "trixie" + architectures: + - "amd64" + - "arm64" + metadata: - generated_at: "2026-01-25T20:06:46Z" + generated_at: "2026-02-08T20:06:42Z" supported_os: debian: ["stretch", "jessie", "buster", "bullseye", "bookworm", "trixie"] supported_architectures: ["amd64", "arm64"] diff --git a/configs/generated/asterisk-20.18.2-trixie.yml b/configs/generated/asterisk-20.18.2-trixie.yml new file mode 100644 index 000000000..53f3f61cc --- /dev/null +++ b/configs/generated/asterisk-20.18.2-trixie.yml @@ -0,0 +1,140 @@ +asterisk: + addons: + version: null + configure_options: + - --with-pjproject-bundled + - --with-ssl=ssl + - --with-crypto + menuselect: + apps: + - app_voicemail + - app_queue + - app_confbridge + - app_directory + - app_dial + - app_playback + - app_record + - app_echo + - app_mixmonitor + channels: + - chan_pjsip + - chan_iax2 + - chan_local + - chan_bridge_media + drivers: + - res_musiconhold + - res_pjsip + - res_pjsip_session + - res_pjsip_outbound_registration + - res_pjsip_registrar + - res_rtp_asterisk + - res_timing_timerfd + - res_crypto + exclude: + - chan_dahdi + - chan_misdn + - app_festival + opus_codec: null + source: + url_template: https://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-{version}.tar.gz +base: + distribution: trixie + image: debian:trixie + os: debian +build: + args: + ASTERISK_VERSION: 20.18.2 + DEBIAN_FRONTEND: noninteractive + script: build-asterisk.sh +docker: + expose_ports: + - 5060/udp + - 5060/tcp + - 10000-20000/udp + registry: docker.io + repository: asterisk + tags: + - 20.18.2_debian-trixie + - 20.18.2_debian-trixie-amd64 + volumes: + - /var/lib/asterisk/sounds + - /var/lib/asterisk/keys + - /var/lib/asterisk/phoneprov + - /var/spool/asterisk + - /var/log/asterisk + - /etc/asterisk +features: + hep: false + pjsip: true + recordings: true + tls: true + websockets: false +packages: + build: + - build-essential + - autoconf + - binutils-dev + - ca-certificates + - curl + - file + - libcurl4-openssl-dev + - libedit-dev + - libgsm1-dev + - libicu-dev + - libjansson-dev + - libncurses-dev + - libogg-dev + - libpopt-dev + - libpqxx-dev + - libresample1-dev + - libspandsp-dev + - libspeex-dev + - libspeexdsp-dev + - libsqlite3-dev + - libssl-dev + - libtool + - libvorbis-dev + - libxml2-dev + - libxslt1-dev + - make + - odbcinst + - patch + - pkg-config + - portaudio19-dev + - procps + - python3-dev + - unixodbc + - unixodbc-dev + - uuid + - uuid-dev + - xmlstarlet + - libsrtp2-dev + runtime: + - binutils + - curl + - libedit2 + - libgsm1 + - libjansson4 + - libogg0 + - libpopt0 + - libresample1 + - libspandsp2 + - libspeex1 + - libspeexdsp1 + - libsqlite3-0 + - libvorbis0a + - libxml2 + - libxslt1.1 + - odbcinst + - portaudio19-dev + - procps + - python3 + - unixodbc + - uuid + - libcurl4t64 + - libssl3t64 + - libsrtp2-1 + - libncurses6 + - libpqxx-7.10 + - libicu76 +version: 20.18.2 diff --git a/configs/generated/asterisk-20.7-cert9-trixie.yml b/configs/generated/asterisk-20.7-cert9-trixie.yml new file mode 100644 index 000000000..461c3dfac --- /dev/null +++ b/configs/generated/asterisk-20.7-cert9-trixie.yml @@ -0,0 +1,141 @@ +asterisk: + addons: + version: null + configure_options: + - --with-pjproject-bundled + - --with-ssl=ssl + - --with-crypto + - --disable-xmldoc + menuselect: + apps: + - app_voicemail + - app_queue + - app_confbridge + - app_directory + - app_dial + - app_playback + - app_record + - app_echo + - app_mixmonitor + channels: + - chan_pjsip + - chan_iax2 + - chan_local + - chan_bridge_media + drivers: + - res_musiconhold + - res_pjsip + - res_pjsip_session + - res_pjsip_outbound_registration + - res_pjsip_registrar + - res_rtp_asterisk + - res_timing_timerfd + - res_crypto + exclude: + - chan_dahdi + - chan_misdn + - app_festival + opus_codec: null + source: + url_template: https://downloads.asterisk.org/pub/telephony/certified-asterisk/releases/asterisk-certified-{version}.tar.gz +base: + distribution: trixie + image: debian:trixie + os: debian +build: + args: + ASTERISK_VERSION: 20.7-cert9 + DEBIAN_FRONTEND: noninteractive + script: build-asterisk.sh +docker: + expose_ports: + - 5060/udp + - 5060/tcp + - 10000-20000/udp + registry: docker.io + repository: asterisk + tags: + - 20.7-cert9_debian-trixie + - 20.7-cert9_debian-trixie-amd64 + volumes: + - /var/lib/asterisk/sounds + - /var/lib/asterisk/keys + - /var/lib/asterisk/phoneprov + - /var/spool/asterisk + - /var/log/asterisk + - /etc/asterisk +features: + hep: false + pjsip: true + recordings: true + tls: true + websockets: false +packages: + build: + - build-essential + - autoconf + - binutils-dev + - ca-certificates + - curl + - file + - libcurl4-openssl-dev + - libedit-dev + - libgsm1-dev + - libicu-dev + - libjansson-dev + - libncurses-dev + - libogg-dev + - libpopt-dev + - libpqxx-dev + - libresample1-dev + - libspandsp-dev + - libspeex-dev + - libspeexdsp-dev + - libsqlite3-dev + - libssl-dev + - libtool + - libvorbis-dev + - libxml2-dev + - libxslt1-dev + - make + - odbcinst + - patch + - pkg-config + - portaudio19-dev + - procps + - python3-dev + - unixodbc + - unixodbc-dev + - uuid + - uuid-dev + - xmlstarlet + - libsrtp2-dev + runtime: + - binutils + - curl + - libedit2 + - libgsm1 + - libjansson4 + - libogg0 + - libpopt0 + - libresample1 + - libspandsp2 + - libspeex1 + - libspeexdsp1 + - libsqlite3-0 + - libvorbis0a + - libxml2 + - libxslt1.1 + - odbcinst + - portaudio19-dev + - procps + - python3 + - unixodbc + - uuid + - libcurl4t64 + - libssl3t64 + - libsrtp2-1 + - libncurses6 + - libpqxx-7.10 + - libicu76 +version: 20.7-cert9 diff --git a/configs/generated/asterisk-21.12.1-trixie.yml b/configs/generated/asterisk-21.12.1-trixie.yml new file mode 100644 index 000000000..56ae43856 --- /dev/null +++ b/configs/generated/asterisk-21.12.1-trixie.yml @@ -0,0 +1,141 @@ +asterisk: + addons: + version: null + configure_options: + - --with-pjproject-bundled + - --with-ssl=ssl + - --with-crypto + menuselect: + apps: + - app_voicemail + - app_queue + - app_confbridge + - app_directory + - app_dial + - app_playback + - app_record + - app_echo + - app_mixmonitor + channels: + - chan_pjsip + - chan_iax2 + - chan_local + - chan_bridge_media + drivers: + - res_musiconhold + - res_pjsip + - res_pjsip_session + - res_pjsip_outbound_registration + - res_pjsip_registrar + - res_rtp_asterisk + - res_timing_timerfd + - res_crypto + exclude: + - chan_dahdi + - chan_misdn + - app_festival + - chan_sip + opus_codec: null + source: + url_template: https://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-{version}.tar.gz +base: + distribution: trixie + image: debian:trixie + os: debian +build: + args: + ASTERISK_VERSION: 21.12.1 + DEBIAN_FRONTEND: noninteractive + script: build-asterisk.sh +docker: + expose_ports: + - 5060/udp + - 5060/tcp + - 10000-20000/udp + registry: docker.io + repository: asterisk + tags: + - 21.12.1_debian-trixie + - 21.12.1_debian-trixie-amd64 + volumes: + - /var/lib/asterisk/sounds + - /var/lib/asterisk/keys + - /var/lib/asterisk/phoneprov + - /var/spool/asterisk + - /var/log/asterisk + - /etc/asterisk +features: + hep: false + pjsip: true + recordings: true + tls: true + websockets: false +packages: + build: + - build-essential + - autoconf + - binutils-dev + - ca-certificates + - curl + - file + - libcurl4-openssl-dev + - libedit-dev + - libgsm1-dev + - libicu-dev + - libjansson-dev + - libncurses-dev + - libogg-dev + - libpopt-dev + - libpqxx-dev + - libresample1-dev + - libspandsp-dev + - libspeex-dev + - libspeexdsp-dev + - libsqlite3-dev + - libssl-dev + - libtool + - libvorbis-dev + - libxml2-dev + - libxslt1-dev + - make + - odbcinst + - patch + - pkg-config + - portaudio19-dev + - procps + - python3-dev + - unixodbc + - unixodbc-dev + - uuid + - uuid-dev + - xmlstarlet + - libsrtp2-dev + runtime: + - binutils + - curl + - libedit2 + - libgsm1 + - libjansson4 + - libogg0 + - libpopt0 + - libresample1 + - libspandsp2 + - libspeex1 + - libspeexdsp1 + - libsqlite3-0 + - libvorbis0a + - libxml2 + - libxslt1.1 + - odbcinst + - portaudio19-dev + - procps + - python3 + - unixodbc + - uuid + - libcurl4t64 + - libssl3t64 + - libsrtp2-1 + - libncurses6 + - libpqxx-7.10 + - libicu76 +version: 21.12.1 diff --git a/configs/generated/asterisk-22.8.2-trixie.yml b/configs/generated/asterisk-22.8.2-trixie.yml new file mode 100644 index 000000000..7213f9a75 --- /dev/null +++ b/configs/generated/asterisk-22.8.2-trixie.yml @@ -0,0 +1,141 @@ +asterisk: + addons: + version: null + configure_options: + - --with-pjproject-bundled + - --with-ssl=ssl + - --with-crypto + menuselect: + apps: + - app_voicemail + - app_queue + - app_confbridge + - app_directory + - app_dial + - app_playback + - app_record + - app_echo + - app_mixmonitor + channels: + - chan_pjsip + - chan_iax2 + - chan_local + - chan_bridge_media + drivers: + - res_musiconhold + - res_pjsip + - res_pjsip_session + - res_pjsip_outbound_registration + - res_pjsip_registrar + - res_rtp_asterisk + - res_timing_timerfd + - res_crypto + exclude: + - chan_dahdi + - chan_misdn + - app_festival + - chan_sip + opus_codec: null + source: + url_template: https://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-{version}.tar.gz +base: + distribution: trixie + image: debian:trixie + os: debian +build: + args: + ASTERISK_VERSION: 22.8.2 + DEBIAN_FRONTEND: noninteractive + script: build-asterisk.sh +docker: + expose_ports: + - 5060/udp + - 5060/tcp + - 10000-20000/udp + registry: docker.io + repository: asterisk + tags: + - 22.8.2_debian-trixie + - 22.8.2_debian-trixie-amd64 + volumes: + - /var/lib/asterisk/sounds + - /var/lib/asterisk/keys + - /var/lib/asterisk/phoneprov + - /var/spool/asterisk + - /var/log/asterisk + - /etc/asterisk +features: + hep: false + pjsip: true + recordings: true + tls: true + websockets: false +packages: + build: + - build-essential + - autoconf + - binutils-dev + - ca-certificates + - curl + - file + - libcurl4-openssl-dev + - libedit-dev + - libgsm1-dev + - libicu-dev + - libjansson-dev + - libncurses-dev + - libogg-dev + - libpopt-dev + - libpqxx-dev + - libresample1-dev + - libspandsp-dev + - libspeex-dev + - libspeexdsp-dev + - libsqlite3-dev + - libssl-dev + - libtool + - libvorbis-dev + - libxml2-dev + - libxslt1-dev + - make + - odbcinst + - patch + - pkg-config + - portaudio19-dev + - procps + - python3-dev + - unixodbc + - unixodbc-dev + - uuid + - uuid-dev + - xmlstarlet + - libsrtp2-dev + runtime: + - binutils + - curl + - libedit2 + - libgsm1 + - libjansson4 + - libogg0 + - libpopt0 + - libresample1 + - libspandsp2 + - libspeex1 + - libspeexdsp1 + - libsqlite3-0 + - libvorbis0a + - libxml2 + - libxslt1.1 + - odbcinst + - portaudio19-dev + - procps + - python3 + - unixodbc + - uuid + - libcurl4t64 + - libssl3t64 + - libsrtp2-1 + - libncurses6 + - libpqxx-7.10 + - libicu76 +version: 22.8.2 diff --git a/configs/generated/asterisk-23.2.2-trixie.yml b/configs/generated/asterisk-23.2.2-trixie.yml new file mode 100644 index 000000000..0ee076931 --- /dev/null +++ b/configs/generated/asterisk-23.2.2-trixie.yml @@ -0,0 +1,142 @@ +asterisk: + addons: + version: null + configure_options: + - --with-pjproject-bundled + - --with-ssl=ssl + - --with-crypto + menuselect: + apps: + - app_voicemail + - app_queue + - app_confbridge + - app_directory + - app_dial + - app_playback + - app_record + - app_echo + - app_mixmonitor + channels: + - chan_pjsip + - chan_iax2 + - chan_local + - chan_bridge_media + - chan_websocket + drivers: + - res_musiconhold + - res_pjsip + - res_pjsip_session + - res_pjsip_outbound_registration + - res_pjsip_registrar + - res_rtp_asterisk + - res_timing_timerfd + - res_crypto + exclude: + - chan_dahdi + - chan_misdn + - app_festival + - chan_sip + opus_codec: null + source: + url_template: https://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-{version}.tar.gz +base: + distribution: trixie + image: debian:trixie + os: debian +build: + args: + ASTERISK_VERSION: 23.2.2 + DEBIAN_FRONTEND: noninteractive + script: build-asterisk.sh +docker: + expose_ports: + - 5060/udp + - 5060/tcp + - 10000-20000/udp + registry: docker.io + repository: asterisk + tags: + - 23.2.2_debian-trixie + - 23.2.2_debian-trixie-amd64 + volumes: + - /var/lib/asterisk/sounds + - /var/lib/asterisk/keys + - /var/lib/asterisk/phoneprov + - /var/spool/asterisk + - /var/log/asterisk + - /etc/asterisk +features: + hep: false + pjsip: true + recordings: true + tls: true + websockets: true +packages: + build: + - build-essential + - autoconf + - binutils-dev + - ca-certificates + - curl + - file + - libcurl4-openssl-dev + - libedit-dev + - libgsm1-dev + - libicu-dev + - libjansson-dev + - libncurses-dev + - libogg-dev + - libpopt-dev + - libpqxx-dev + - libresample1-dev + - libspandsp-dev + - libspeex-dev + - libspeexdsp-dev + - libsqlite3-dev + - libssl-dev + - libtool + - libvorbis-dev + - libxml2-dev + - libxslt1-dev + - make + - odbcinst + - patch + - pkg-config + - portaudio19-dev + - procps + - python3-dev + - unixodbc + - unixodbc-dev + - uuid + - uuid-dev + - xmlstarlet + - libsrtp2-dev + runtime: + - binutils + - curl + - libedit2 + - libgsm1 + - libjansson4 + - libogg0 + - libpopt0 + - libresample1 + - libspandsp2 + - libspeex1 + - libspeexdsp1 + - libsqlite3-0 + - libvorbis0a + - libxml2 + - libxslt1.1 + - odbcinst + - portaudio19-dev + - procps + - python3 + - unixodbc + - uuid + - libcurl4t64 + - libssl3t64 + - libsrtp2-1 + - libncurses6 + - libpqxx-7.10 + - libicu76 +version: 23.2.2