110 lines
3.0 KiB
Markdown
110 lines
3.0 KiB
Markdown
# SMDR Panasonic NS1000 - Integrazione Operativa
|
|
|
|
## Stato attuale
|
|
|
|
- Listener attivo via comando Laravel `smdr:listen`.
|
|
- Ingestione su:
|
|
- `communication_messages` (`channel = smdr`)
|
|
- `chiamate_post_it` (record operativi)
|
|
|
|
## Comando base
|
|
|
|
```bash
|
|
php artisan smdr:listen \
|
|
--host=192.168.0.101 \
|
|
--port=2300 \
|
|
--user=SMDR \
|
|
--pass=PCCSMDR \
|
|
--write-postit=1 \
|
|
--write-communications=1 \
|
|
--reconnect=1 \
|
|
--reconnect-delay=5
|
|
```
|
|
|
|
## Wrapper operativo consigliato
|
|
|
|
Per evitare comandi manuali lunghi e mantenere la stessa configurazione tra sviluppo e staging:
|
|
|
|
```bash
|
|
cd /home/michele/netgescon/netgescon-day0
|
|
bash scripts/ops/netgescon-smdr-listener.sh
|
|
```
|
|
|
|
Configurazione opzionale via file dedicato `.env.smdr` nella root applicativa:
|
|
|
|
```env
|
|
NETGESCON_SMDR_HOST=192.168.0.101
|
|
NETGESCON_SMDR_PORT=2300
|
|
NETGESCON_SMDR_USER=SMDR
|
|
NETGESCON_SMDR_PASS=PCCSMDR
|
|
NETGESCON_SMDR_RECONNECT=1
|
|
NETGESCON_SMDR_RECONNECT_DELAY=5
|
|
NETGESCON_SMDR_WRITE_POSTIT=1
|
|
NETGESCON_SMDR_WRITE_COMMUNICATIONS=1
|
|
NETGESCON_SMDR_TIMEOUT=0
|
|
NETGESCON_SMDR_MAX_LINES=0
|
|
NETGESCON_SMDR_NO_AUTH=0
|
|
```
|
|
|
|
## Daemon systemd consigliato
|
|
|
|
Il blocco osservato il `13/03/2026` e stato coerente con un listener non piu in esecuzione. La soluzione stabile e tenerlo sotto `systemd` con restart automatico.
|
|
|
|
Template repo:
|
|
|
|
- `scripts/systemd/netgescon-smdr-listener.service.template`
|
|
- `scripts/ops/install-smdr-systemd.sh`
|
|
|
|
Installazione tipica sviluppo:
|
|
|
|
```bash
|
|
cd /home/michele/netgescon/netgescon-day0
|
|
RUN_AS=michele RUN_GROUP=michele bash scripts/ops/install-smdr-systemd.sh
|
|
```
|
|
|
|
Installazione tipica staging:
|
|
|
|
```bash
|
|
cd /var/www/netgescon
|
|
RUN_AS=www-data RUN_GROUP=www-data bash scripts/ops/install-smdr-systemd.sh
|
|
```
|
|
|
|
Verifica:
|
|
|
|
```bash
|
|
systemctl status netgescon-smdr-listener.service --no-pager
|
|
journalctl -u netgescon-smdr-listener.service -n 100 --no-pager
|
|
```
|
|
|
|
## Opzioni utili
|
|
|
|
- `--no-auth`: se il centralino non richiede credenziali su socket.
|
|
- `--max-lines=50`: test rapido su N righe e stop.
|
|
- `--timeout=30`: timeout lettura socket.
|
|
|
|
## Verifica dati acquisiti
|
|
|
|
```bash
|
|
php artisan tinker --execute="echo App\\Models\\CommunicationMessage::where('channel','smdr')->count();"
|
|
php artisan tinker --execute="echo App\\Models\\ChiamataPostIt::count();"
|
|
php artisan tinker --execute="echo optional(App\\Models\\CommunicationMessage::where('channel','smdr')->latest('created_at')->first())->created_at;"
|
|
```
|
|
|
|
## URL operativi correlati
|
|
|
|
- Fornitore: `/fornitore/tickets`
|
|
- Mobile admin: `/admin/mobile`
|
|
- Mobile tickets: `/admin/tickets-mobile`
|
|
|
|
## Note parsing SMDR
|
|
|
|
- Le righe vengono salvate raw per audit.
|
|
- Esempio formato rilevato:
|
|
- `03/02/26 15:22 206 03 3333395405 00:00'03 EU00000.00`
|
|
- `03/02/26 17:03 201 03 <I>3478160508 00:00'59 EU00000.00`
|
|
- `\u003cI\u003e` indica tipicamente ingresso; numeri esterni senza `\u003cI\u003e` tipicamente uscita; `EXTxxx` chiamata interna.
|
|
|
|
## Prossimo step consigliato
|
|
|
|
- Mappare parser SMDR su campi strutturati (interno, trunk, numero, durata, costo, direzione) e dashboard live chiamate in ingresso/uscita.
|