From 730df06856936dc525c08ed95937368705fef7bd Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 3 Dec 2025 02:47:27 +0000 Subject: [PATCH 1/4] v1.25: Improve menu clarity and add progress indicator Menu Improvements: - Clarified "Quick Local Setup" as "Local LAN only - no internet/FQDN" - Renamed "Full" to "Full Setup (Server + Client + Internet)" - Added detailed descriptions for all install options - "Server Only" now explains it can optionally include FQDN/internet - "Client Only" clarifies it connects to existing server User Experience: - Added progress message during device addition: "Reloading Asterisk configuration (this may take a moment)..." - Prevents confusion when dialplan rebuild causes brief delay - Users now see the script is working, not hanging This addresses user feedback about menu clarity and apparent hangs during device addition. --- easy-asterisk-interactive-v1.25.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/easy-asterisk-interactive-v1.25.sh b/easy-asterisk-interactive-v1.25.sh index 9283dd6..226313e 100644 --- a/easy-asterisk-interactive-v1.25.sh +++ b/easy-asterisk-interactive-v1.25.sh @@ -969,11 +969,13 @@ max_contacts=5 remove_existing=yes qualify_frequency=60 EOF - + chown -R asterisk:asterisk /etc/asterisk + echo "" + print_info "Reloading Asterisk configuration (this may take a moment)..." asterisk -rx "pjsip reload" >/dev/null 2>&1 rebuild_dialplan - + echo "════════════════════════════════════════════════════════" echo " DEVICE ADDED" echo "════════════════════════════════════════════════════════" @@ -3071,12 +3073,15 @@ submenu_install() { clear print_header "Install" echo " ${BOLD}1) Quick Local Setup (Recommended)${NC}" - echo " └─ Local network, PTT, auto-answer - No internet needed" + echo " └─ Local LAN only - PTT, auto-answer, no internet/FQDN" echo "" echo " ${CYAN}Advanced Options:${NC}" - echo " 2) Full (server + client with internet setup)" - echo " 3) Server only" - echo " 4) Client only" + echo " 2) Full Setup (Server + Client + Internet)" + echo " └─ With FQDN, TLS certs, COTURN, internet calling" + echo " 3) Server Only" + echo " └─ Just Asterisk server (optionally with FQDN/internet)" + echo " 4) Client Only" + echo " └─ Just Baresip client (connect to existing server)" echo " 5) Uninstall" echo " 0) Back" read -p " Select: " choice From 7b046a33a5861b6e6b54ffdef93cd4e2f2e0d83d Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 3 Dec 2025 02:51:59 +0000 Subject: [PATCH 2/4] v1.25: Fix menu color rendering and clarify COTURN is optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: - Add -e flag to echo statements so BOLD and CYAN colors render properly - Previously showed raw escape codes like \033[1m instead of formatted text Clarifications: - Changed "Full Setup" description from "With FQDN, TLS certs, COTURN, internet calling" to "Optionally add FQDN, TLS certs, COTURN for internet calling" - COTURN is NOT mandatory in Full Setup - It's only configured if user runs Internet/Certificate Setup wizard afterward User can now see properly formatted menu: 1) Quick Local Setup (Recommended) [in bold] └─ Local LAN only - PTT, auto-answer, no internet/FQDN Advanced Options: [in cyan] 2) Full Setup (Server + Client + Internet) └─ Optionally add FQDN, TLS certs, COTURN for internet calling --- easy-asterisk-interactive-v1.25.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/easy-asterisk-interactive-v1.25.sh b/easy-asterisk-interactive-v1.25.sh index 226313e..a06e80f 100644 --- a/easy-asterisk-interactive-v1.25.sh +++ b/easy-asterisk-interactive-v1.25.sh @@ -3072,12 +3072,12 @@ show_main_menu() { submenu_install() { clear print_header "Install" - echo " ${BOLD}1) Quick Local Setup (Recommended)${NC}" + echo -e " ${BOLD}1) Quick Local Setup (Recommended)${NC}" echo " └─ Local LAN only - PTT, auto-answer, no internet/FQDN" echo "" - echo " ${CYAN}Advanced Options:${NC}" + echo -e " ${CYAN}Advanced Options:${NC}" echo " 2) Full Setup (Server + Client + Internet)" - echo " └─ With FQDN, TLS certs, COTURN, internet calling" + echo " └─ Optionally add FQDN, TLS certs, COTURN for internet calling" echo " 3) Server Only" echo " └─ Just Asterisk server (optionally with FQDN/internet)" echo " 4) Client Only" From 34386f8149826552f9837edcd01ecf0c8e843275 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 3 Dec 2025 03:02:39 +0000 Subject: [PATCH 3/4] v1.26: Make COTURN explicitly optional with clear guidance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Major Installation Flow Restructure: **Full Setup (Option 2):** 1. VPN Detection - Shows benefits of VPN vs COTURN 2. Install base software (Asterisk + Baresip) 3. Optional: Internet/FQDN Setup - Clear YES/NO choice with colored guidance - If NO: Uses local network or VPN IP 4. Optional: COTURN Setup (only offered if internet setup chosen) - Clear warning: "⚠ COTURN is complex and usually NOT needed!" - Shows when you DON'T need it (VPN, port forwarding, same network) - Shows when you MIGHT need it (no VPN, VLAN isolation, symmetric NAT) - Defaults to NO 5. PTT configuration **Server Only (Option 3):** - Same flow as Full Setup, but without client software or PTT **Key Improvements:** - COTURN is now a **separate, explicit** optional step (not buried in wizard) - Users see clear guidance on when COTURN is actually needed - VPN is presented as the better alternative - Default answer is NO for COTURN (safer for users) - Colors render properly with -e flag This addresses user feedback that COTURN setup is complex and should be clearly optional, not implied as mandatory. --- easy-asterisk-interactive-v1.25.sh | 161 ++++++++++++++++++++++++++--- 1 file changed, 148 insertions(+), 13 deletions(-) diff --git a/easy-asterisk-interactive-v1.25.sh b/easy-asterisk-interactive-v1.25.sh index a06e80f..aa64e00 100644 --- a/easy-asterisk-interactive-v1.25.sh +++ b/easy-asterisk-interactive-v1.25.sh @@ -2866,14 +2866,84 @@ install_full() { KIOSK_USER="${target_user:-$default_user}" KIOSK_UID=$(id -u "$KIOSK_USER") - # Check for VPN + # Check for VPN first + echo "" + print_header "VPN Detection" + echo "VPNs (Tailscale, NetBird, WireGuard) are great for:" + echo " • Connecting kiosks on different VLANs without COTURN" + echo " • Allowing internet users to call internal kiosks" + echo " • Avoiding complex firewall/NAT configuration" + echo "" detect_vpn_interface || true + # Basic config if ! collect_common_config; then return; fi collect_client_config + + # Install base software install_dependencies INSTALLED_SERVER="y" INSTALLED_CLIENT="y" + + # Optional: Internet/FQDN setup + echo "" + print_header "Internet Access (Optional)" + echo "Do you want to setup internet calling with FQDN and TLS certificates?" + echo "" + echo -e " ${GREEN}Choose YES if:${NC}" + echo " • You want internet users to call your system" + echo " • You have a domain name (FQDN)" + echo " • You need TLS encryption" + echo "" + echo -e " ${YELLOW}Choose NO if:${NC}" + echo " • Local network only" + echo " • Using VPN for remote access" + echo "" + read -p "Setup internet access with FQDN/certs? [y/N]: " do_internet + + if [[ "$do_internet" =~ ^[Yy]$ ]]; then + setup_internet_access + else + # Local network config + if [[ "$USE_VPN" == "y" ]]; then + ASTERISK_HOST="$VPN_IP" + else + ASTERISK_HOST=$(hostname -I | cut -d' ' -f1) + fi + ENABLE_TLS="n" + USE_COTURN="n" + fi + + # Optional: COTURN setup + if [[ "$do_internet" =~ ^[Yy]$ ]]; then + echo "" + print_header "COTURN Setup (Optional)" + echo "COTURN is a TURN/STUN server for NAT traversal." + echo "" + echo -e " ${YELLOW}⚠ COTURN is complex and usually NOT needed!${NC}" + echo "" + echo -e " ${GREEN}You DON'T need COTURN if:${NC}" + echo " • Using VPN (Tailscale, NetBird, WireGuard)" + echo " • Simple port forwarding works for you" + echo " • All devices on same network/VLANs" + echo "" + echo -e " ${RED}You MIGHT need COTURN if:${NC}" + echo " • VPN is not an option" + echo " • Strict firewall/VLAN isolation" + echo " • Symmetric NAT issues" + echo "" + read -p "Setup COTURN server? [y/N]: " do_coturn + + if [[ "$do_coturn" =~ ^[Yy]$ ]]; then + install_coturn + USE_COTURN="y" + else + USE_COTURN="n" + print_info "Skipping COTURN (recommended for most users)" + fi + fi + + # Configure everything configure_asterisk configure_baresip enable_client_services @@ -2887,27 +2957,92 @@ install_full() { detect_ptt_button fi - echo "" - read -p "Run Internet/Certificate Setup wizard now? [Y/n]: " run_setup - [[ ! "$run_setup" =~ ^[Nn]$ ]] && setup_internet_access - print_success "Installation complete" } install_server_only() { print_header "Server Installation" - ASTERISK_HOST="127.0.0.1" - ENABLE_TLS="y" + + # Check for VPN first + echo "" + print_header "VPN Detection" + echo "VPNs (Tailscale, NetBird, WireGuard) are great for:" + echo " • Connecting kiosks on different VLANs without COTURN" + echo " • Allowing internet users to call internal kiosks" + echo " • Avoiding complex firewall/NAT configuration" + echo "" + detect_vpn_interface || true + + # Basic config + if ! collect_common_config; then return; fi + + # Install base software install_asterisk_packages + INSTALLED_SERVER="y" + + # Optional: Internet/FQDN setup + echo "" + print_header "Internet Access (Optional)" + echo "Do you want to setup internet calling with FQDN and TLS certificates?" + echo "" + echo -e " ${GREEN}Choose YES if:${NC}" + echo " • You want internet users to call your system" + echo " • You have a domain name (FQDN)" + echo " • You need TLS encryption" + echo "" + echo -e " ${YELLOW}Choose NO if:${NC}" + echo " • Local network only" + echo " • Using VPN for remote access" + echo "" + read -p "Setup internet access with FQDN/certs? [y/N]: " do_internet + + if [[ "$do_internet" =~ ^[Yy]$ ]]; then + setup_internet_access + else + # Local network config + if [[ "$USE_VPN" == "y" ]]; then + ASTERISK_HOST="$VPN_IP" + else + ASTERISK_HOST=$(hostname -I | cut -d' ' -f1) + fi + ENABLE_TLS="n" + USE_COTURN="n" + fi + + # Optional: COTURN setup + if [[ "$do_internet" =~ ^[Yy]$ ]]; then + echo "" + print_header "COTURN Setup (Optional)" + echo "COTURN is a TURN/STUN server for NAT traversal." + echo "" + echo -e " ${YELLOW}⚠ COTURN is complex and usually NOT needed!${NC}" + echo "" + echo -e " ${GREEN}You DON'T need COTURN if:${NC}" + echo " • Using VPN (Tailscale, NetBird, WireGuard)" + echo " • Simple port forwarding works for you" + echo " • All devices on same network/VLANs" + echo "" + echo -e " ${RED}You MIGHT need COTURN if:${NC}" + echo " • VPN is not an option" + echo " • Strict firewall/VLAN isolation" + echo " • Symmetric NAT issues" + echo "" + read -p "Setup COTURN server? [y/N]: " do_coturn + + if [[ "$do_coturn" =~ ^[Yy]$ ]]; then + install_coturn + USE_COTURN="y" + else + USE_COTURN="n" + print_info "Skipping COTURN (recommended for most users)" + fi + fi + + # Configure everything configure_asterisk open_firewall_ports - INSTALLED_SERVER="y" save_config - - echo "" - read -p "Run Internet/Certificate Setup wizard now? [Y/n]: " run_setup - [[ ! "$run_setup" =~ ^[Nn]$ ]] && setup_internet_access - + print_success "Server installed" } From 5a0ceea31577868319e0a28efb879fc24ecafd04 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 3 Dec 2025 11:16:09 +0000 Subject: [PATCH 4/4] v1.26: Update version numbers to 1.26 --- easy-asterisk-interactive-v1.25.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/easy-asterisk-interactive-v1.25.sh b/easy-asterisk-interactive-v1.25.sh index aa64e00..1c34f30 100644 --- a/easy-asterisk-interactive-v1.25.sh +++ b/easy-asterisk-interactive-v1.25.sh @@ -74,9 +74,9 @@ set +e # Version and Update Info -SCRIPT_VERSION="1.25" +SCRIPT_VERSION="1.26" GITHUB_REPO="outis1one/asterisk-easy" -SCRIPT_NAME="easy-asterisk-interactive-v1.25.sh" +SCRIPT_NAME="easy-asterisk-interactive-v1.26.sh" BACKUP_DIR="/etc/easy-asterisk/backups" # Colors @@ -1945,7 +1945,7 @@ local_net=$local_net" fi cat > "$conf_file" << EOF -; Easy Asterisk v1.23 (OPNsense/VLAN Ready) +; Easy Asterisk v1.26 (OPNsense/VLAN Ready) ; Generated: $(date) [global] type=global @@ -3170,7 +3170,7 @@ uninstall_menu() { show_main_menu() { clear - print_header "Easy Asterisk v1.25" + print_header "Easy Asterisk v1.26" load_config echo " Status:"