Hi all,
I’m running Asterisk 18.26.4 with PJSIP and WebRTC (sipML5 in Chrome). Asterisk is deployed behind NAT.
Problem:
Inbound SIP calls from my provider reach Asterisk immediately and are processed normally (Queue(), ringing, etc.). However, when the WebRTC agent clicks “Answer” in the browser, the SIP 200 OK from the browser is delayed by ~1–2 minutes.
After the 200 OK finally arrives, Asterisk immediately sends ACK and the call bridges successfully.
So the delay happens before Asterisk receives the final 200 OK from the WebRTC client.
Environment:
- Asterisk 18.26.4
- Inbound trunk: UDP 5060
- WebRTC transport: WSS 8089
- Asterisk is behind NAT
- WebRTC uses DTLS-SRTP
- Queue() is used for inbound routing
- TURN server is configured (relay candidate visible in SDP)
Observed behavior:
-
Provider → Asterisk INVITE arrives instantly.
-
Asterisk sends 100 Trying / 180 Ringing immediately.
-
Queue() calls WebRTC endpoint.
-
Asterisk sends INVITE over WSS immediately (confirmed via pjsip logger).
-
Browser rings immediately.
-
User clicks “Answer”.
-
~1.5 minutes delay.
-
Browser finally sends SIP/2.0 200 OK with SDP.
-
Asterisk sends ACK immediately and call connects.
Current transport config:
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
local_net=132.X.X.0/16
[transport-wss]
type=transport
protocol=wss
bind=0.0.0.0:8089
cert_file=/etc/asterisk/certs/xxx.pem
priv_key_file=/etc/asterisk/certs/xxx.pem
WebRTC endpoint template:
type=endpoint
webrtc=yes
media_encryption=dtls
dtls_verify=fingerprint
dtls_setup=actpass
use_avpf=yes
force_rport=yes
rewrite_contact=yes
rtp_symmetric=yes
media_use_received_transport=yes
direct_media=no
transport=transport-wss
allow=opus,ulaw
Questions:
-
If Asterisk is behind NAT, should I explicitly set:
-
external_signaling_address
-
external_media_address
-
proper private local_net ranges
-
ice_support=yes
-
-
Could incorrect NAT settings cause WebRTC ICE to stall for a long time before the browser sends 200 OK?
-
Is a 1–2 minute delay typical when ICE is trying multiple failed candidates before selecting a working relay path?
-
What is the recommended minimal NAT configuration for Asterisk 18 + PJSIP + WebRTC behind NAT?
I can provide:
- Full pjsip set logger on output
- rtp set debug on
- chrome://webrtc-internals dump
- Full pjsip.conf and rtp.conf
Any guidance on proper NAT + ICE configuration for this scenario would be greatly appreciated.