Changeset

9373:1a69803d5d5d

mod_scansion_record: Record disconnection
author Kim Alvefur <zash@zash.se>
date Sat, 22 Sep 2018 19:30:31 +0200
parents 9372:0e685b7ec039
children 9374:a1a39d395260
files plugins/mod_scansion_record.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_scansion_record.lua	Sat Sep 22 19:29:27 2018 +0200
+++ b/plugins/mod_scansion_record.lua	Sat Sep 22 19:30:31 2018 +0200
@@ -87,6 +87,13 @@
 	filters.add_filter(session, "stanzas/out", record_stanza_out);
 end);
 
+module:hook("resource-unbind", function (event)
+	local session = event.session;
+	if session.scansion_id then
+		record_event(session, "disconnects");
+	end
+end)
+
 record_header("# mod_scansion_record on host '"..module.host.."' recording started "..dt.datetime().."\n\n");
 
 record[[