Number of websockets connected to Asterisk

Hi all,

I am using Asterisk 15.4 version with PJSIP. I am using sipML5 as soft phone. When I shifted wifi after connecting to asterisk, sipML5 is getting disconnected. But the web socket connection on asterisk is not getting closed.

My http.conf variables session_inactivity=30000, session_keep_alive=15000 are default values.

Also, How to find number of http sessions/web sockets connected from asterisk cli. (is there any cli command similar to ‘pjsip show contacts’ to check http sessions).

Does it get closed eventually? How long did you wait? TCP connections can hang around for quite awhile unless traffic is actually attempted over them.

Hi jcolp,

web socket connection is taking too much time. I am not able to trace particular connection since we have many users connecting. But I will try to reproduce websocket close time and will let you know.

I want ask you how we can find number of web sockets connections connected to asterisk at one point of time. (Is there any cli command similar to ‘pjsip show contacts’ to check http sessions).

I can’t find any HCI for websockets in the obvious source code files, although the OS level netstat or lsof commands should give you information on the current numbers.

I don’t believe we have any CLI commands to see the open connections within Asterisk.

Hello Mani,

I am also looking for server (Asterisk server) & client combination. Can you please provide me some information in the installation process.


Hi dhayananda,

We are using sipML5 (based on webRTC) to build soft phones. (It may not work on OS which does not support webRTC like - IOS).

We installed asterisk 15.5. I can’t share my config files, but you can find many examples online on writing PJSIP/SIP.confs and dialplan extensions.conf.

Asterisk documentation has a demo example with sipML5, you can find it here.

Here is a link to configure pjsip/sip configurations files.