WebRTC behind NAT

I am using Asterisk 16.7.0 with PJSIP.
The server is behind a NAT.
For UDP, TCP and TLS I use the external_media_address and external_signaling_address parameters to specify the public IP, which is working perfectly.

However I can not get it to work for webSockets (transport wss).
Asterisk is supplying the local IP both in the SIP and SDP.
Are there any special configurations I need to add, so Asterisk will report the external address instead?

It doesn’t matter for SIP, as both Asterisk and the other side will reuse the existing Websocket connection. As for SDP, you can configure in rtp.conf the ICE candidate mapping to include the external IP address as a candidate.

Works like a charm :slight_smile:
Not as pretty as defining it on the transport, though…

Thank you !

One question:
This mapping requires that I know the actual local IP.
Is there a way to get around that?

You could enable a STUN server and see if discovery of the external IP address works as you’d like. Otherwise, there is not.

Ok - thank you again

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.