Claude a4b29082e7 CRITICAL FIX: Kiosk offline + PTT not muting issues
This fixes two critical bugs that prevented the kiosk client from
working properly.

ISSUE 1: Kiosk User Offline/Can't Connect
==========================================
Problem: Client installed but showed offline, couldn't register
with Asterisk server. Services weren't starting properly for
headless/non-logged-in users.

Root Causes:
- Missing DBUS_SESSION_BUS_ADDRESS environment variable
- Insufficient wait time for PipeWire and network
- No logging to diagnose startup issues
- Service dependencies not strong enough

Fixes:
✓ Added DBUS_SESSION_BUS_ADDRESS to all user services
✓ Increased startup delays (5s for baresip, 8s for PTT)
✓ Changed Wants to Requires for pipewire-pulse (hard dependency)
✓ Added StandardOutput/StandardError=journal for logging
✓ Increased RestartSec from 5s to 10s for more stable restarts

ISSUE 2: PTT Not Muting Microphone
===================================
Problem: PTT configured but microphone NOT muted on startup,
pressing PTT button did nothing, had to manually mute.

Root Causes:
- kiosk-ptt script missing XDG_RUNTIME_DIR environment
- pactl commands failing silently without proper context
- No wait for PipeWire to be ready before muting
- No logging to see what was happening

Fixes:
✓ Added XDG_RUNTIME_DIR detection/setup in PTT script
✓ Added 10-second wait loop for PipeWire to become ready
✓ Added error handling with logger for failed pactl commands
✓ Added logging for all PTT press/release events
✓ Export KIOSK_UID env var in PTT service

Enhanced Logging & Diagnostics
===============================
All services now log to systemd journal with tags:

- baresip-launcher: Network detection, config verification, startup
- kiosk-ptt: Startup, mic mute status, PTT press/release events
- baresip.service: Service output (via StandardOutput=journal)

View logs:
  journalctl -t baresip-launcher -f
  journalctl -t kiosk-ptt -f
  sudo -u kiosk journalctl --user -u baresip -f

New Features
============
1. Enhanced Diagnostics (Client Management > Run Diagnostics):
   - Shows launcher logs (last 10 lines)
   - Shows PTT logs (last 5 lines)
   - Shows Baresip service logs (last 10 lines)
   - Displays commands to view live logs

2. Manual Audio Fix Tool (Tools > Fix Audio):
   - Restarts PipeWire services
   - Unmutes microphone and speaker
   - Sets volume to 75%
   - Restarts Baresip
   - Shows current status

Improved Baresip Launcher
==========================
- Logs all startup steps
- Verifies config and accounts files exist
- Better network wait logic with logging
- Clear error messages if files missing
- Network detection logs which interface found

Testing After Update
====================
1. For existing installs - restart services:
   sudo -u kiosk systemctl --user daemon-reload
   sudo -u kiosk systemctl --user restart pipewire pipewire-pulse baresip

2. Check status:
   sudo -u kiosk systemctl --user status baresip

3. View logs:
   journalctl -t baresip-launcher -n 50
   journalctl -t kiosk-ptt -n 20

4. If still offline:
   Main Menu > Tools > Fix Audio (Unmute & Restart)

This should resolve both the offline connection issue and the
PTT mic muting problem. All operations now have proper logging
for easier troubleshooting.
2025-12-03 19:01:08 +00:00
2025-11-28 18:28:24 -05:00
S
Description
Mirror of outis1one/easy-asterisk from GitHub
GPL-3.0
408 KiB
Languages
Shell 98.9%
Dockerfile 1.1%