From 742b8eef6ef291d724e78ae9e8e749d612f54f21 Mon Sep 17 00:00:00 2001
From: CanbiZ <47820557+MickLesk@users.noreply.github.com>
Date: Thu, 30 Oct 2025 04:13:26 -0700
Subject: [PATCH] Asterisk: add interactive version selection to installer
(#8726)
---
install/asterisk-install.sh | 69 +++++++++++++++++++++++++++++++++----
1 file changed, 63 insertions(+), 6 deletions(-)
diff --git a/install/asterisk-install.sh b/install/asterisk-install.sh
index adb53406e..07557a072 100644
--- a/install/asterisk-install.sh
+++ b/install/asterisk-install.sh
@@ -13,8 +13,65 @@ setting_up_container
network_check
update_os
+ASTERISK_VERSIONS_URL="https://www.asterisk.org/downloads/asterisk/all-asterisk-versions/"
+html=$(curl -fsSL "$ASTERISK_VERSIONS_URL")
+
+LTS_VERSION=""
+for major in 20 22 24 26; do
+ block=$(echo "$html" | awk "/Asterisk $major - LTS/,/
/")
+ ver=$(echo "$block" | grep -oE 'Download Latest - [0-9]+\.[0-9]+(\.[0-9]+)?' | head -n1 | sed -E 's/.* - //')
+ if [ -n "$ver" ]; then
+ LTS_VERSION="$LTS_VERSION $ver"
+ fi
+ unset ver block
+done
+LTS_VERSION=$(echo "$LTS_VERSION" | xargs | tr ' ' '\n' | sort -V | tail -n1)
+
+STD_VERSION=""
+for major in 21 23 25 27; do
+ block=$(echo "$html" | awk "/Asterisk $major,//")
+ ver=$(echo "$block" | grep -oE 'Download (Latest - )?[0-9]+\.[0-9]+(\.[0-9]+)?' | head -n1 | sed -E 's/.* - //;s/Download //')
+ if [ -n "$ver" ]; then
+ STD_VERSION="$STD_VERSION $ver"
+ fi
+ unset ver block
+done
+STD_VERSION=$(echo "$STD_VERSION" | xargs | tr ' ' '\n' | sort -V | tail -n1)
+
+cert_block=$(echo "$html" | awk '/Certified Asterisk/,//')
+CERT_VERSION=$(echo "$cert_block" | grep -oE 'Download Latest - [0-9]+\.[0-9]+-cert[0-9]+' | head -n1 | sed -E 's/.* - //')
+
+cat <