Added intelligent user selection that scans /home directory and
presents available users, making it much easier to install the
kiosk client for the correct user account.
Features:
1. Smart User Detection
- Scans /etc/passwd for real users (UID >= 1000)
- Excludes system accounts (nologin, /bin/false)
- Shows username, UID, and home directory
- Presents numbered list of available users
2. Intelligent Defaults
- Auto-suggests SUDO_USER if available
- Falls back to first detected user
- Highlights suggested choice as default
3. Manual Override
- Option to manually enter username
- Validates entered username exists
- Shows confirmation with UID
4. Improved User Experience
- install_client_only(): Uses new select_user function
- configure_local_client(): Shows current user, offers to change
- Clear feedback on user selection
- Proper error handling for invalid selections
5. Verified Ownership
All user configs are properly owned by selected user:
- ~/.baresip/config (chown in configure_baresip:1879)
- ~/.baresip/accounts (chown in configure_baresip:1879)
- ~/.config/systemd/user/* (chown in enable_client_services:1962)
- ~/.config/wireplumber/* (chown in configure_audio_ducking:1067)
- All PipeWire/audio operations run as selected user
Example Flow:
$ sudo ./easy-asterisk-interactive-v1.28.sh
> Install Client Only
Scanning for users...
1) kiosk (UID: 1000, Home: /home/kiosk)
2) admin (UID: 1001, Home: /home/admin)
3) Enter username manually
Select user [1]: 1
✓ Selected user: kiosk (UID: 1000)
This makes it much easier to install on kiosk systems where you
might not remember the exact username, and ensures all configs
are created with proper ownership from the start.
This commit addresses multiple critical issues that prevented the
kiosk client from working properly, especially regarding audio.
Issues Fixed:
1. Baresip config check error
- Removed premature check for .baresip directory
- Added option to install Baresip if not present
- Improved user flow for client configuration
2. Audio completely lost after client installation
- PTT service was starting even without PTT device configured
- Added ConditionPathExists to PTT systemd service
- Only enable PTT service when PTT device is actually configured
- Ensured audio is unmuted for normal intercom operation
3. PipeWire/PulseAudio initialization
- Added proper PipeWire and PipeWire-Pulse service dependencies
- Explicitly enable and start PipeWire services for user
- Added audio group membership check
4. Audio unmuting after installation
- Created ensure_audio_unmuted() helper function
- Automatically unmute microphone and speakers after install
- Set reasonable volume levels (75%) if too low
- Only applies when PTT is not configured
5. User permissions and ownership
- Ensured all configs owned by kiosk user
- Proper audio group membership
- Clear messaging about needing to log out/reboot
6. Enhanced diagnostics
- Added PipeWire service status checks
- Show microphone/speaker mute status and volumes
- Display PTT configuration status
- Clear error message when microphone is muted
- Added helpful instructions for troubleshooting
7. Improved user messaging
- Added comprehensive post-install instructions
- Clear explanation of audio configuration
- Guidance on when to log out/reboot
- Better error messages throughout
Key Changes:
- configure_local_client(): Offers to install Baresip if missing
- enable_client_services(): Only enables PTT when configured
- ensure_audio_unmuted(): New function to ensure audio works
- run_client_diagnostics(): Enhanced with audio status info
- install_client_only(): Added detailed audio setup message
The kiosk now works as a proper intercom out of the box, with
microphone and speakers unmuted and ready to use.
The PTT handler was muting the audio source before checking if a PTT
device was configured. This prevented kiosks from sending audio back
to calling phones during normal intercom operation.
Changes:
- Move audio mute command after PTT device check
- Only mute audio when PTT device is actually configured
- Leave audio unmuted for standard kiosk intercom functionality
- Add clarifying comments about PTT mode vs normal operation
This fixes the issue where phones calling the kiosk could send audio
but received no audio back from the kiosk.
ROOT CAUSE FOUND:
- install_server_only() was hardcoding ENABLE_TLS="y" (line 2039)
- install_full() wasn't setting ENABLE_TLS at all
- This caused devices to always use TLS/5061 even for LAN-only setups
FIXES:
1. install_server_only(): Changed ENABLE_TLS="y" to ENABLE_TLS="n"
2. install_full(): Added ENABLE_TLS="n" before configure_asterisk
3. Added debug output showing ENABLE_TLS and DOMAIN_NAME values in device summary
HOW IT WORKS NOW:
- Both install functions start with ENABLE_TLS="n" (LAN-only/UDP)
- Only setup_internet_access() sets ENABLE_TLS="y" (internet/TLS)
- Device configuration respects ENABLE_TLS value from saved config
- Device summary correctly displays UDP/5060 for LAN-only
- Device summary shows TLS/5061 only after internet/certs setup
This ensures devices use UDP transport for LAN-only installations
and TLS only when explicitly configured for internet calling.
CRITICAL FIX:
- Added load_config() call in add_device_menu to read saved ENABLE_TLS setting
- Device display now correctly shows UDP/5060 when ENABLE_TLS != "y"
- Device display shows TLS/5061 only when ENABLE_TLS == "y"
- SRTP requirement properly displayed based on TLS configuration
OTHER FIXES:
- ICE support only enabled when DOMAIN_NAME is set (FQDN/internet calling)
- RTP config: icesupport and STUN only for FQDN setups, not LAN-only
- Added informative message after server install before internet setup prompt
ISSUE RESOLVED:
When installing server-only without selecting internet/certs, devices now
correctly show:
Transport: UDP (port 5060)
SRTP: Not required
This matches the actual pjsip.conf configuration and allows mobile devices
to properly register with UDP transport on LAN networks.
Created v1.28.sh with all fixes, keeping v1.23.sh for reference.