Asterisk WebRTC randomly disconnected

I am trying to use the Mini-HTTP-Server on Asterisk 18.5.1 to connect WebRTC phones (around 300 hundred) but it is crashing randomly.

Asterisk WS

I just change the domain in the screenshot for security. It works sometimes, but suddenly, the mini-HTTP server starts showing this error when accessing the links below.

https://mydomain.com:8089
https://mydomain.com:8089/httpstatus

When this happens, it is impossible to connect a softphone through the WebSocket.

I am using Centos 7, and Let’s Encrypt.

Thanks in advance for your help!

Some considerations:

  1. make sure that you are NOT hosting any other files, scripts or html in the http server, and switch off static… you don’t want to give Asterisk anything else to work on that it doesn’t absolutely need to. (Like this you should only really be able to get to httpstatus and /ws, but the /ws will not work directly in a web browser, and should respond with a protocol error.)

  2. Turn off http protocol, and only make it accessible via https (tls), and while you are there, give it an obscure port number - something greater than 1024, especially if your server is exposed to the world wide web. (You may have had a dos attack.)

  3. Now that your web service is protected, give it a limit that works for you. There is a connection limit, by default of 100.

You should have no problems with this config

[general]
enabled=no ; HTTP
tlsenable=yes ; HTTPS
tlsbindaddr=0.0.0.0:4431
tlscertfile=/certs/my.crt
tlsprivatekey=/certs/my.key
sessionlimit=1000
enablestatic=no

If this is exhausting Asterisk, then it will be time to consider scaling out - to doo that, just add a load balancer before your Asterisk array, to distribute the connections.

1 Like

Did you mean internet? (The WWW is a web of hyperlinks.)

I mean, the Wild Wild West :wink:

3 Likes

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