From e24636133dd734e63feae9ecb6effb2841fd5964 Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 14:28:37 +0200 Subject: [PATCH] asterisk (#4468) * 'Add new script' * Update asterisk.json * Update asterisk.json * Update asterisk-install.sh * Update asterisk.sh * Update asterisk-install.sh * Update asterisk-install.sh * Update asterisk.sh * noob STD service call --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com> Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> --- ct/asterisk.sh | 35 +++++++++++++++++++ ct/headers/asterisk | 6 ++++ frontend/public/json/asterisk.json | 33 ++++++++++++++++++ install/asterisk-install.sh | 56 ++++++++++++++++++++++++++++++ 4 files changed, 130 insertions(+) create mode 100644 ct/asterisk.sh create mode 100644 ct/headers/asterisk create mode 100644 frontend/public/json/asterisk.json create mode 100644 install/asterisk-install.sh diff --git a/ct/asterisk.sh b/ct/asterisk.sh new file mode 100644 index 000000000..40fdb64fe --- /dev/null +++ b/ct/asterisk.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: michelroegl-brunner +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://asterisk.org/ + +APP="Asterisk" +var_tags="${var_tags:-telephone;pbx}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-4}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + msg_error "No Update function provided for ${APP} LXC" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" diff --git a/ct/headers/asterisk b/ct/headers/asterisk new file mode 100644 index 000000000..ed4356862 --- /dev/null +++ b/ct/headers/asterisk @@ -0,0 +1,6 @@ + ___ __ _ __ + / | _____/ /____ _____(_)____/ /__ + / /| | / ___/ __/ _ \/ ___/ / ___/ //_/ + / ___ |(__ ) /_/ __/ / / (__ ) ,< +/_/ |_/____/\__/\___/_/ /_/____/_/|_| + diff --git a/frontend/public/json/asterisk.json b/frontend/public/json/asterisk.json new file mode 100644 index 000000000..dc27574f2 --- /dev/null +++ b/frontend/public/json/asterisk.json @@ -0,0 +1,33 @@ +{ + "name": "Asterisk", + "slug": "asterisk", + "categories": [0], + "date_created": "2025-05-14", + "type": "ct", + "updateable": false, + "privileged": false, + "interface_port": null, + "documentation": "https://docs.asterisk.org/", + "config_path": "/etc/asterisk", + "website": "https://asterisk.org/", + "logo": "https://docs.asterisk.org/favicon.ico", + "description": "Asterisk is an open-source framework for building communications applications, most commonly used as a phone system (PBX). Developed by Digium (now part of Sangoma), it turns a standard computer into a powerful telephony server.", + "install_methods": [ + { + "type": "default", + "script": "ct/asterisk.sh", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 4, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} diff --git a/install/asterisk-install.sh b/install/asterisk-install.sh new file mode 100644 index 000000000..adb53406e --- /dev/null +++ b/install/asterisk-install.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: michelroegl-brunner +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://asterisk.org + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + libsrtp2-dev \ + build-essential \ + libedit-dev \ + uuid-dev \ + libjansson-dev \ + libxml2-dev \ + libsqlite3-dev +msg_ok "Installed Dependencies" + +msg_info "Downloading Asterisk" +RELEASE=$(curl -fsSL https://downloads.asterisk.org/pub/telephony/asterisk/ | grep -o 'asterisk-[0-9]\+-current\.tar\.gz' | sort -V | tail -n1) +temp_file=$(mktemp) +curl -fsSL "https://downloads.asterisk.org/pub/telephony/asterisk/${RELEASE}" -o "$temp_file" +mkdir -p /opt/asterisk +tar zxf "$temp_file" --strip-components=1 -C /opt/asterisk +cd /opt/asterisk +msg_ok "Downloaded Asterisk" + +msg_info "Installing Asterisk" +$STD ./contrib/scripts/install_prereq install +$STD ./configure +$STD make -j$(nproc) +$STD make install +$STD make config +$STD make install-logrotate +$STD make samples +mkdir -p /etc/radiusclient-ng/ +ln /etc/radcli/radiusclient.conf /etc/radiusclient-ng/radiusclient.conf +systemctl enable -q --now asterisk +msg_ok "Installed Asterisk" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -f "$temp_file" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned"