Difference between revisions of "WebRTC"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 32: Line 32:
  systemctl restart asterisk
  systemctl restart asterisk


3. Check if http configuration is applied:
3. Check if HTTP configuration is applied:


  asterisk -rx "http show status"
  asterisk -rx "http show status"

Revision as of 18:29, 27 August 2025

WebRTC/WebSockets/WSS

WebRTC is supported from MOR X18 (with PJSIP enabled)

Requirements

  • Asterisk-20
  • Rocky OS 9
  • MOR X18 (or later)
  • Domain in Asterisk server
  • TLS (SSL) certificate

Enabling WebSockets (WS/WSS)

1. In Asterisk servers edit /etc/asterisk/http.conf and make sure that these settings are configured under [general] section:

[general]
enabled=yes
bindaddr=0.0.0.0
bindport=8088
tlsenable=yes
tlsbindaddr=0.0.0.0:8089
tlscertfile=/path/to/certificate
tlsprivatekey=/path/to/private_key

Note: these settings should be already present in http.conf, but commented out. Just uncomment required settings.

Set proper path to TLS certificate in tlscertfile and private key in tlsprivatekey.

2. Restart Asterisk:

systemctl restart asterisk

3. Check if HTTP configuration is applied:

asterisk -rx "http show status"

The output should be similar to this:

HTTP Server Status:
Prefix: 
Server: Asterisk/20
Server Enabled and Bound to 0.0.0.0:8088

HTTPS Server Enabled and Bound to 0.0.0.0:8089

Enabled URI's:
/httpstatus => Asterisk HTTP General Status
/ws => Asterisk HTTP WebSocket

The important parts are:

HTTPS Server Enabled and Bound to 0.0.0.0:8089
/ws => Asterisk HTTP WebSocket

If these are present, it means that Asterisk is configured to accept calls via WebSockets protocol.

4. Check if Asterisk is accepting HTTP request:

In browser, open the following address (with your own domain address):

https://YOUR_DOMAIN:8089/httpstatus

The output should be similar to this:

Asterisk http status.png

If this page is shown, Asterisk is configured to work with WebSockets protocol and WebRTC calls can be initiated using address:

https://YOUR_DOMAIN:8089/ws

Enabling WebRTC in PJSIP Devices

Only PJSIP Devices are allowed to make WebRTC calls.

In PJSIP Device settings, enable WebRTC option under Advanced settings:

Device webrtc option.png

Testing locally

WIP

MOR X17 (or older) WebRTC/WebSockets/WSS

WebRTC together with MOR can be integrated using 3rd party solutions (Example: https://www.mizu-voip.com/Software/WebRTCtoSIP.aspx).

With Asterisk 1.8: Please note that only audio could work, because in our experience Asterisk 1.8 which MOR uses does not work properly with video over WebRTC.

https://janus.conf.meetecho.com/