I am experiencing a consistent issue with WebRTC video calls using Asterisk + SIP over WebSocket, where the call is established successfully, media flows in both directions, but the call drops after ~28–30 seconds.
Below is a full step-by-step summary of what was tested and observed.
Asterisk 16.30.0, FreePBX 16.0.45.
- SIP over WebSocket (WSS):
wss://example.com:8089/ws - WebRTC clients tested:
-
JsSIP 3.10.0
-
SIP.js 0.21.2
-
- Browser: Chrome (latest)
- Transport: WebSocket + ICE
- STUN:
-
stun:stun.l.google.com:19302 -
also tested local STUN and TURN (I understand that this is not necessary in a local network, I did this for testing)
-
Network: local LAN (10.77.50.0/24), no NAT between browser and Asterisk
SIP registration is successful
- INVITE / 200 OK / ACK flow is correct
- Session is confirmed successfully
- No SIP errors or retransmissions
- SIP session timers are disabled on client side (
session_timers: false)
Call termination is not caused by BYE from the browser
Media (RTP / ICE) behavior
We enabled RTP debugging on Asterisk:
rtp set debug on
Observed output during the call:
-
RTP packets are sent and received continuously
-
Both directions are active
-
ICE is in use (
via ICE) -
Example log lines:
Sent RTP packet to 10.77.50.95:10868 (via ICE)
Got RTP packet from 10.77.50.95:33436
This confirms: RTP is flowing both ways, ICE negotiation is successful, no one-way audio/video before disconnect.
What happens after ~28–30 seconds?
-
Call is established and works correctly at first, audio and video are present
-
After ~28–30 seconds - сall is dropped, Asterisk ends the session. No visible SIP error or explicit timeout message. Behavior is 100% reproducible
Any ideas on how to fix this?
P.S.
Additionally, I noticed a very clear correlation with the RTP timeout settings in FreePBX (for my WebRTC Extension).
When I explicitly set RTP timeout values, the call was always terminated exactly after the configured timeout, regardless of signaling or media activity:
rtp timeout = 120 → call drops after 120 seconds
rtp timeout = 600 → call drops after 600 seconds
This happens consistently and reproducibly.
This behavior strongly suggests that Asterisk stops receiving RTP packets (or considers them inactive) after a fixed interval, even though: