HTTP session_keep_alive not working for the websocket

I have enabled the session_keep_alive in my http.conf and my application is connecting to asterisk via websocket on 8088 port. I checked through pcap that the asterisk is not sending keepalive to my application and in certain scenarios of network fluctuation my old connection remains established even though a new connection has been made by the application(The old connection is cleaned up from the application/client side).

My http.conf sample:

bindaddr=0.0.0.0
bindport=8088
tlsenable=yes
tlsbindaddr=0.0.0.0:8089
tlscertfile=/etc/asterisk/keys/foo.pem
tlsprivatekey=/etc/asterisk/keys/foo.pem
session_keep_alive=5000

That’s not what that option does. I don’t believe the functionality you desire is currently implemented. Most people likely don’t experience it as their client registers, and then they use OPTIONS to have traffic flow periodically.

Oh actually there is global keepalive support in PJSIP I forgot about[1] in the global section. That should apply to websockets for PJSIP, and defaults to 90 seconds. It sends “\r\n\r\n” out.

[1] res_pjsip - Asterisk Documentation

2 Likes

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