Add Opus codec, show management info after Asterisk startup

- Install Digium precompiled codec_opus.so in Docker image since Ubuntu
  24.04's asterisk-modules package doesn't include it (bug #2044135).
  Opus is the best codec for mobile VoIP (adaptive bitrate, packet loss
  resilience).
- Rework entrypoint to print the management info banner AFTER Asterisk
  finishes loading, so the CLI command isn't buried in startup log noise.
  The management command is now highlighted in yellow.
- Remove explicit load directive for codec_opus.so from modules.conf;
  autoload=yes handles it when the .so exists, and silently skips when
  it doesn't (no more error log noise on systems without Opus).

https://claude.ai/code/session_01Vm6NLaQuzM4VosAotqS1q8
This commit is contained in:
Claude
2026-02-24 17:05:22 +00:00
parent 06c75371d0
commit 8405238fa1
2 changed files with 32 additions and 3 deletions
+17 -3
View File
@@ -308,7 +308,6 @@ load => chan_pjsip.so
load => codec_ulaw.so
load => codec_alaw.so
load => codec_g722.so
load => codec_opus.so
load => res_rtp_asterisk.so
load => app_dial.so
load => app_page.so
@@ -339,6 +338,20 @@ trap cleanup SIGTERM SIGINT
# ── 12. Start Asterisk ───────────────────────────────────────
log_info "Starting Asterisk PBX..."
echo ""
# Start Asterisk in the background, then print management info once ready
asterisk -f -U asterisk -G asterisk &
ASTERISK_PID=$!
# Wait for Asterisk to be ready (up to 60 seconds)
for i in $(seq 1 60); do
if asterisk -rx "core show version" >/dev/null 2>&1; then
break
fi
sleep 1
done
echo ""
echo -e "${CYAN}══════════════════════════════════════════════════════════════${NC}"
echo -e "${CYAN} Easy Asterisk (Docker)${NC}"
@@ -352,9 +365,10 @@ echo -e "${CYAN}─────────────────────
echo -e " SIP clients connect to: ${GREEN}${DOMAIN_NAME:-$local_ip}:5061${NC} (TLS)"
echo -e " Web Admin: ${GREEN}http://${local_ip}:${WEB_ADMIN_PORT:-8080}/clients${NC}"
echo -e "${CYAN}──────────────────────────────────────────────────────────────${NC}"
echo -e " Management: docker exec -it easy-asterisk easy-asterisk"
echo -e " Management: ${YELLOW}docker exec -it easy-asterisk easy-asterisk${NC}"
echo -e " Diagnostics: docker exec -it easy-asterisk vpn-diagnostics"
echo -e "${CYAN}══════════════════════════════════════════════════════════════${NC}"
echo ""
exec asterisk -f -U asterisk -G asterisk
# Wait for Asterisk process (keeps container running)
wait $ASTERISK_PID