feat: configurable call timeout & username normalization

This commit is contained in:
Joan
2026-01-26 18:07:22 +01:00
parent 442c08888d
commit b062b15797
6 changed files with 8772 additions and 1021 deletions

View File

@@ -7,9 +7,10 @@ A dockerized application that converts text to audio (using Piper Neural TTS) an
* **High Quality TTS**: Uses [Piper](https://github.com/rhasspy/piper) with `es_ES-sharvard-medium` model for human-like speech.
* **Web Dashboard**: Manage queue, view history, and test voices via browser.
* **Web-based Login**: Log in to your Telegram account directly from the UI (supports 2FA).
* **Web-based Configuration**: Set `API_ID` and `API_HASH` without touching config files.
* **Web-based Configuration**: Set `API_ID`, `API_HASH`, and `Call Timeout` via the UI.
* **Flexible Inputs**: Auto-handles usernames with or without `@` prefix.
* **Real-time Queue**: Redis-backed queue with history and error reporting.
* **Smart Dialing**: Waits for the user to answer before playing audio.
* **Smart Dialing**: Configurable timeout (default 15s), detects "Rejected" vs "No Answer", and watches for user hang-ups during playback.
* **Legacy API Support**: Compatible with simple GET requests.
## Prerequisites
@@ -39,26 +40,28 @@ A dockerized application that converts text to audio (using Piper Neural TTS) an
### 1. Initial Setup
1. Open your browser and navigate to `http://localhost:8777`.
2. You will be prompted to enter your **Telegram API ID** and **API Hash**.
* Get these from [my.telegram.org](https://my.telegram.org).
2. You will be prompted to enter your **Telegram API ID**, **API Hash**, **Phone Number**, and **Call Timeout**.
* Get API keys from [my.telegram.org](https://my.telegram.org).
* **Call Timeout**: Seconds to wait for the user to answer before cancelling (default 15s).
3. Click **Save Configuration**. The worker will restart.
### 2. Login
1. After configuration, the dashboard will show a **Login Now** button.
2. Enter your **Phone Number** (international format, e.g., `+34...`).
3. Scan the **QR Code** using your Telegram Mobile App (Settings > Devices > Link Desktop Device).
* *Note: If the QR code expires or fails, check `docker logs telemovris_app` for details.*
1. After configuration, the dashboard will verify calls.
2. Follow the simple 2-step process (Config -> Login) if not auto-logged in.
3. Enter the **Login Code** sent to your Telegram app.
4. If you have 2FA enabled, you will be prompted for your password.
### 3. Sending Messages
* **Via Dashboard**: Use the "Queue New Task" form.
* Username can be `@username` or just `username`.
* **Via Legacy API**:
```
GET http://localhost:8777/sendmessage?user=@username&message=Hello+World&audio=yes
GET http://localhost:8777/sendmessage?user=username&message=Hello+World&audio=yes
```
## Development
* **Reset Config**: If you need to change accounts or keys, click the "Reset Config" button in the dashboard (when disconnected).
* **Reset Config**: If you need to change accounts, keys, or timeout settings, click the "Reset Config" button in the dashboard.
* **Logs**: Check worker logs for debugging:
```bash
docker logs -f telemovris_app