Skip to content

Commit 7cbbfbb

Browse files
'Add new script'
1 parent 4762ea8 commit 7cbbfbb

File tree

4 files changed

+136
-0
lines changed

4 files changed

+136
-0
lines changed

ct/asterisk.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/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:-os}"
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+
if [[ ! -d /var ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
msg_info "No Update function provided for ${APP} LXC"
31+
exit
32+
}
33+
34+
start
35+
build_container
36+
description
37+
38+
msg_ok "Completed Successfully!\n"
39+
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: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "Asterisk",
3+
"slug": "asterisk",
4+
"categories": [
5+
0,
6+
4
7+
],
8+
"date_created": "2025-05-13",
9+
"type": "ct",
10+
"updateable": false,
11+
"privileged": false,
12+
"interface_port": null,
13+
"documentation": "https://docs.asterisk.org/",
14+
"config_path": "/etc/asterisk",
15+
"website": "https://asterisk.org/",
16+
"logo": "https://docs.asterisk.org/favicon.ico",
17+
"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.",
18+
"install_methods": [
19+
{
20+
"type": "default",
21+
"script": "ct/asterisk.sh",
22+
"resources": {
23+
"cpu": 2,
24+
"ram": 2048,
25+
"hdd": 4,
26+
"os": "Debian",
27+
"version": "12"
28+
}
29+
}
30+
],
31+
"default_credentials": {
32+
"username": null,
33+
"password": null
34+
},
35+
"notes": []
36+
}

install/asterisk-install.sh

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

0 commit comments

Comments
 (0)