Skip to content

Commit e246361

Browse files
push-app-to-main[bot]MickLeskmichelroegl-brunner
authored
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 <[email protected]> Co-authored-by: Michel Roegl-Brunner <[email protected]>
1 parent 7d0a964 commit e246361

File tree

4 files changed

+130
-0
lines changed

4 files changed

+130
-0
lines changed

ct/asterisk.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: michelroegl-brunner
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://asterisk.org/
7+
8+
APP="Asterisk"
9+
var_tags="${var_tags:-telephone;pbx}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-2048}"
12+
var_disk="${var_disk:-4}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-12}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
msg_error "No Update function provided for ${APP} LXC"
27+
exit
28+
}
29+
30+
start
31+
build_container
32+
description
33+
34+
msg_ok "Completed Successfully!\n"
35+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"

ct/headers/asterisk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
___ __ _ __
2+
/ | _____/ /____ _____(_)____/ /__
3+
/ /| | / ___/ __/ _ \/ ___/ / ___/ //_/
4+
/ ___ |(__ ) /_/ __/ / / (__ ) ,<
5+
/_/ |_/____/\__/\___/_/ /_/____/_/|_|
6+

frontend/public/json/asterisk.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "Asterisk",
3+
"slug": "asterisk",
4+
"categories": [0],
5+
"date_created": "2025-05-14",
6+
"type": "ct",
7+
"updateable": false,
8+
"privileged": false,
9+
"interface_port": null,
10+
"documentation": "https://docs.asterisk.org/",
11+
"config_path": "/etc/asterisk",
12+
"website": "https://asterisk.org/",
13+
"logo": "https://docs.asterisk.org/favicon.ico",
14+
"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.",
15+
"install_methods": [
16+
{
17+
"type": "default",
18+
"script": "ct/asterisk.sh",
19+
"resources": {
20+
"cpu": 2,
21+
"ram": 2048,
22+
"hdd": 4,
23+
"os": "Debian",
24+
"version": "12"
25+
}
26+
}
27+
],
28+
"default_credentials": {
29+
"username": null,
30+
"password": null
31+
},
32+
"notes": []
33+
}

install/asterisk-install.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: michelroegl-brunner
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://asterisk.org
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
libsrtp2-dev \
19+
build-essential \
20+
libedit-dev \
21+
uuid-dev \
22+
libjansson-dev \
23+
libxml2-dev \
24+
libsqlite3-dev
25+
msg_ok "Installed Dependencies"
26+
27+
msg_info "Downloading Asterisk"
28+
RELEASE=$(curl -fsSL https://downloads.asterisk.org/pub/telephony/asterisk/ | grep -o 'asterisk-[0-9]\+-current\.tar\.gz' | sort -V | tail -n1)
29+
temp_file=$(mktemp)
30+
curl -fsSL "https://downloads.asterisk.org/pub/telephony/asterisk/${RELEASE}" -o "$temp_file"
31+
mkdir -p /opt/asterisk
32+
tar zxf "$temp_file" --strip-components=1 -C /opt/asterisk
33+
cd /opt/asterisk
34+
msg_ok "Downloaded Asterisk"
35+
36+
msg_info "Installing Asterisk"
37+
$STD ./contrib/scripts/install_prereq install
38+
$STD ./configure
39+
$STD make -j$(nproc)
40+
$STD make install
41+
$STD make config
42+
$STD make install-logrotate
43+
$STD make samples
44+
mkdir -p /etc/radiusclient-ng/
45+
ln /etc/radcli/radiusclient.conf /etc/radiusclient-ng/radiusclient.conf
46+
systemctl enable -q --now asterisk
47+
msg_ok "Installed Asterisk"
48+
49+
motd_ssh
50+
customize
51+
52+
msg_info "Cleaning up"
53+
rm -f "$temp_file"
54+
$STD apt-get -y autoremove
55+
$STD apt-get -y autoclean
56+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)