Hello,
I think the only way to do this would be to use the dialog module. However, as far as I know the appropriate dialog function (dlg_bye) needs to be run from a route where the SIP message is within the dialog in question.
In other words, there is no way you could run this from event_route[websocket:closed] because even if you were able to to store the information required to identify the (potentially multiple dialogs) relating to the WebSocket connection (perhaps in a hash-table) you can't actually do anything with these dialogs from there.
If this really is a requirement I suspect you're going to need to make some enhancements to the dialog module. Alternatively, you can take advantage of the GRUU and outbound support in Kamailio git master which should allow calls to survive WebSocket connection close and re-establishment.
Regards,
Peter