All libssl packages are `1.0.2g-1ubuntu4.16`. Attached is a trap file for both failure modes (with some manual hacking to retrieve pids for failure mode 1). Although I suspect (but didn't verify yet as I don't normally use plaintext SIP over TCP) the issue is with the TCP handling rather than anything SSL specific.
[trap_failuremode1.txt](https://github.com/kamailio/kamailio/files/4886100/trap_failuremode1.txt) [trap_failuremode2.txt](https://github.com/kamailio/kamailio/files/4886103/trap_failuremode2.txt)