[SR-Users] Connection-oriented socket closure event hooks
Alex Balashov
abalashov at evaristesys.com
Fri Sep 18 08:57:11 CEST 2020
Hi,
The `tcpops` module exposes,
* event_route[tcp:closed]
* event_route[tcp:timeout]
* event_route[tcp:reset]
These fire on closure of TCP connections and TLS connections. TLS is
considered a separate transport in Kamailio, having distinct identifiers
in all cases where transport protocol is relevant, configured by
separate and specific parameters, and provided by a separate module
(tls). But TLS runs on top of TCP, of course, so treating a TLS
disconnection as a superset of TCP disconnection makes sense.
WebSocket is considered a separate transport in Kamailio, having
distinct identifiers in all cases where transport protocol is relevant,
configured by separate and specific parameters, and provided by a
separate module (websocket). But WebSocket runs on top of TCP, of course...
... yet it doesn't trigger these TCP connection events. Instead, one
must use a separate `event_route[websocket_closed]` event route for this.
Is there a reason for this inconsistency? I would think that the common
denominator of TCP would lead to the same hierarchy of abstraction when
it comes to events.
It becomes important because if one wishes for Kamailio to log or notify
disconnections for vanilla SIP or browser-based clients, one must
essentially implement the same code twice.
Thank you,
-- Alex
--
Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
More information about the sr-users
mailing list