Fix extra button to only work when OFF-hook and add greeting delay
Breaking Behavior Change:
- Extra button NOW only works when handset is OFF-hook (during call)
- Previous: worked when on-hook (idle) - REVERSED
- Reason: Button is for guests to trigger during their call/recording
New Feature - Greeting Delay:
- Add greeting_delay_seconds to config.json (0-10 seconds)
- Delays greeting playback after handset pickup
- Gives guests time to position phone comfortably
- Default: 0 (plays immediately, backward compatible)
Extra Button Logic:
- Only responds when phone_status == "off_hook"
- Ignored when phone is on-hook (idle)
- Can be pressed during greeting or recording
- Plays entire sound without interruption
- Useful for: "Press button to hear special message"
Greeting Delay Use Cases:
- Wedding: Give guests moment to settle in
- Events: Time to position phone comfortably
- Accessibility: Extra time for elderly guests
- Professional: Pause before message delivery
Configuration:
{
"system": {
"greeting_delay_seconds": 2, // 2 second pause
"extra_button_sound": "surprise.wav"
}
}
Console Output:
- "Extra button ignored - phone is on hook" (when idle)
- "Waiting X seconds before greeting..." (delay active)
- "=== Extra button pressed ===" (during call)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
20
README.md
20
README.md
@@ -189,10 +189,21 @@ The web interface provides four main sections:
|
||||
### Extra Button Operation (Optional)
|
||||
|
||||
If enabled in `config.json`:
|
||||
1. **Guest presses button**: System detects GPIO signal
|
||||
2. **Sound plays**: Configured button sound plays through speaker
|
||||
3. **Non-blocking**: Button can be pressed anytime, even during recording
|
||||
4. **Debounced**: 0.5s delay prevents accidental double-presses
|
||||
1. **Guest picks up phone**: Phone goes off-hook
|
||||
2. **Guest presses button**: System detects GPIO signal (only works when off-hook)
|
||||
3. **Sound plays**: Configured button sound plays through speaker
|
||||
4. **Can be pressed multiple times**: Works during greeting or recording
|
||||
5. **Debounced**: 0.5s delay prevents accidental double-presses
|
||||
|
||||
**Note:** Button only responds when handset is off-hook (during active call)
|
||||
|
||||
### Greeting Delay (Optional)
|
||||
|
||||
Configure a delay before the greeting plays:
|
||||
- Set `greeting_delay_seconds` in `config.json` (0-10 seconds)
|
||||
- Useful for giving guests a moment after picking up
|
||||
- Example: 2 second delay gives time to position the phone
|
||||
- Default: 0 (greeting plays immediately)
|
||||
|
||||
## File Structure
|
||||
|
||||
@@ -256,6 +267,7 @@ The `config.json` file contains all system settings:
|
||||
"system": {
|
||||
"active_greeting": "dialtone.wav", // Default greeting
|
||||
"extra_button_sound": "button_sound.wav", // Default button sound
|
||||
"greeting_delay_seconds": 0, // Delay before greeting plays (0-10)
|
||||
"volume": 70 // Default volume (0-100)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user