Cancelling ClientWebSocket.ReceiveAsync via CancellationToken ABORTS the socket (a half-read WS frame can't resume). The per-iteration iterationCts.CancelAfter(WebSocketReceiveTimeoutSeconds) therefore aborted a healthy idle ARI WebSocket every 45s (state=Aborted), not the keepalive pong (proven: loop persisted after pong-timeout 15s->3600s). A large receive timeout lets ReceiveAsync block harmlessly while the PBX is idle; real drops still surface immediately as WebSocketException -> reconnect. Proper code fix (stop using CancelAfter on the receive) tracked separately. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
15 KiB
15 KiB