From 04443878a7d636237f879f66866b4ff01612c4b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A2=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Sat, 19 Sep 2026 00:29:33 +0300 Subject: [PATCH] Show destination address in MO SHORT MESSAGE CONTROL summaries - _build_summary: append 'DA ' after the SMSC part for the MO SHORT MESSAGE CONTROL envelope (the envelope decoder already stores the second address TLV as cmd.tp_da; the detail view already showed it) - test: constructed D5 envelope with SMSC + destination address - Backend-only, no version bump --- simtrace2_pysniff/server/decode.py | 2 ++ tests/test_decode.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/simtrace2_pysniff/server/decode.py b/simtrace2_pysniff/server/decode.py index eb995fc..a41674d 100644 --- a/simtrace2_pysniff/server/decode.py +++ b/simtrace2_pysniff/server/decode.py @@ -3744,6 +3744,8 @@ def _build_summary(result): parts.append(cmd['text']) if cmd.get('smsc'): parts.append(f"SMSC {cmd['smsc']}") + if cmd.get('tp_da'): + parts.append(f"DA {cmd['tp_da']}") if cmd.get('events'): parts.append(', '.join(cmd['events'])) if cmd.get('address'): diff --git a/tests/test_decode.py b/tests/test_decode.py index e465147..4178467 100644 --- a/tests/test_decode.py +++ b/tests/test_decode.py @@ -108,6 +108,20 @@ class TestCatDecoding(unittest.TestCase): self.assertEqual(t['text'], 'Hi') self.assertEqual(t['scts'], '2026-08-12 14:30:00 (UTC+03:00)') + def test_envelope_mo_short_message_control(self): + # D5 envelope: device ids + SMSC address + destination address + # (first address TLV → smsc, second → tp_da). + r = decode_message(bytes.fromhex( + '80C2000018' + 'D516820283818607919733824009F08607919721436587F9' + '9000')) + self.assertEqual(r['ins_name'], 'ENVELOPE') + self.assertEqual(r['cat_command'], 'MO SHORT MESSAGE CONTROL') + cmd = r['cmd'] + self.assertEqual(cmd['smsc'], '+79332804900') + self.assertEqual(cmd['tp_da'], '+79123456789') + self.assertEqual(r['summary'], 'SMSC +79332804900, DA +79123456789') + class TestCommandTypeTables(unittest.TestCase): def test_known_values(self):