> For the complete documentation index, see [llms.txt](https://digitalsac.gitbook.io/digicalls/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://digitalsac.gitbook.io/digicalls/webphone-widget/recursos/diagnostico.md).

# Diagnóstico

O widget inclui aba **Configurações → Diagnóstico** com informações de ambiente e testes de conectividade.

### Seções

| Seção                 | Conteúdo                                                 |
| --------------------- | -------------------------------------------------------- |
| **Navegador**         | User-Agent                                               |
| **Rede**              | Online, effectiveType, downlink, RTT (quando disponível) |
| **Áudio**             | Permissão microfone, contagem in/out                     |
| **Reachability STUN** | Teste paralelo aos STUNs do `/api/webrtc-config`         |
| **Copiar relatório**  | JSON com snapshot para suporte                           |

### Relatório (exemplo)

```json
{
  "generatedAt": "2026-07-05T03:00:00.000Z",
  "system": {
    "userAgent": "...",
    "online": true,
    "microphonePermission": "granted"
  },
  "stunResults": [
    { "server": "stun:...", "reachable": true, "latencyMs": 42 }
  ]
}
```

### Durante chamada

Indicador de conexão na tela ativa (conectado / chamando). Problemas de ICE aparecem como falha de mídia — consulte Solução de problemas.

### SDK sem widget

Chame `GET /api/webrtc-config` e teste STUN manualmente ou use `pc.getStats()` após negociação WebRTC.

### WABA

Se áudio falha só em linha oficial, verifique webhook Meta e App Secret por conexão — Webhook Meta.
