The built-in Asterisk HTTP server is used to provide the WebSocket support. This can be enabled using the following in the general section of the http.conf configuration file.
If you would like to change the port from the default value of 8088 this can also be done in the general section.
The res_http_websocket must also be built and loaded by Asterisk. For most individuals this is done by default.
Ensure that res_http_websocket.so is selected in menuconfig menuselect prior to building Asterisk. Also ensure that res_http_websocket.so is loaded prior to chan_sip.so if you are not using autoload in modules.conf
To allow a peer, user, or friend access using the WebSocket transport it must be added to their transport options like the following.
To restrict access to clients using only an HTTPS connection allow the 'wss' transport only.
The WebRTC standard has selected AVPF as the audio video profile to use for media streams. This is not the default profile in use by chan_sip. As a result the following must be added to the peer, user, or friend.
This will cause AVPF and SAVPF to be used and the media streams to be accepted.
Asterisk 11.0.0-beta1 has an issue in it where registering over WebSocket may not work properly. The work around is to use a newer version of Asterisk that has been released, or check out the Asterisk 11 branch from SVN. You can also set
on the peer, user, or friend to work around the issue.
The issue report for this problem is viewable at https://issues.asterisk.org/jira/browse/ASTERISK-20238
As media encryption is a requirement of rtcweb the following must be added to the peer, user, or friend to enable it.