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).
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.