Skip to content

Kamailio

Maximum WS simultaneous connections reached for IP

Log

WARNING: <script>: websocket|log|2.2.2.2:22857 is at the maximum allowable sockets per IP, rejecting request for another websocket

 

How to fix it

Increase limit and restart kamilio

Step by Step

vim /etc/kazoo/kamailio/websockets-role.cfg

Increase limit or whitelist IP

if($sht(websockets=>$si::count) > 2500) {
        if ($si =~ "1.1.1.1" || $si =~ "2.2.2.2") {
                xlog("L_WARN", "websocket|log|$si:$sp is at the maximum allowable sockets per IP, NOT rejecting request for another websocket\n");
        } else {
                xlog("L_WARN", "websocket|log|$si:$sp is at the maximum allowable sockets per IP, rejecting request for another websocket\n");
                xhttp_reply("403", "Forbidden", "", "");
                exit;
        }
    }

 

Then copy this file to all other servers

# scp /etc/kazoo/kamailio/websockets-role.cfg server02://etc/kazoo/kamailio/websockets-role.cfg

 

this particular file can be copied  others cannot

 

Restart Kamailio