From 721c457e614a16942ec92648963f71a6ff55341c Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 20 Oct 2010 18:58:12 +0200 Subject: [PATCH] lua: Check for disconnects with non normal release too --- openbsc/contrib/a-link/sccp-split-by-con.lua | 38 ++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/openbsc/contrib/a-link/sccp-split-by-con.lua b/openbsc/contrib/a-link/sccp-split-by-con.lua index 51ca4ef07..df3a70bad 100644 --- a/openbsc/contrib/a-link/sccp-split-by-con.lua +++ b/openbsc/contrib/a-link/sccp-split-by-con.lua @@ -11,9 +11,47 @@ do local ip_src_field = Field.new("ip.src") local ip_dst_field = Field.new("ip.dst") + -- + local bssmap_msgtype_field = Field.new("gsm_a.bssmap_msgtype") + -- assignment failure 0x03 + -- + + -- + local dtap_cause_field = Field.new("gsm_a_dtap.cause") + local dtap_cc_field = Field.new("gsm_a.dtap_msg_cc_type") + local connections = {} function check_failure(con) + check_lu_reject(con) + check_disconnect(con) + end + + -- check if a DISCONNECT is normal + function check_disconnect(con) + local msg_type = dtap_cc_field() + if not msg_type then + return + end + + if tonumber(msg_type) ~= 0x25 then + return + end + + local cause = dtap_cause_field() + if not cause then + return + end + + cause = tonumber(cause) + if cause ~= 0x10 then + print("DISCONNECT != Normal") + con[4] = true + end + end + + -- check if we have a LU Reject + function check_lu_reject(con) local msg_type = msg_type_field() if not msg_type then return