res_pjsip_transport_websocket: Fix security events and simplify implementation.