aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSupreeth Herle <herlesupreeth@gmail.com>2020-03-26 10:00:45 +0100
committerherlesupreeth <herlesupreeth@gmail.com>2021-01-05 15:59:37 +0100
commitc60192375e6da9cdc370e140e88a49618fc03b1d (patch)
treeffa5ac3b536fb8a7393d4a171d2f14d0638cd983
parentbe7007e1d9b03399f2599d6a31441a4cc304eb5a (diff)
sysmoISIM-SJA2: Enable programming of EF.MSISDN
-rw-r--r--pySim/cards.py11
-rw-r--r--pysim-testdata/sysmoISIM-SJA2.ok2
2 files changed, 12 insertions, 1 deletions
diff --git a/pySim/cards.py b/pySim/cards.py
index ac6d223..a8dcf10 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -1287,6 +1287,17 @@ class SysmoISIMSJA2(UsimCard, IsimCard):
r = self._scc.select_file(['3f00', '7f10'])
data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 104), force_len=True)
+ # EF.MSISDN
+ # TODO: Alpha Identifier (currently 'ff'O * 20)
+ # TODO: Capability/Configuration1 Record Identifier
+ # TODO: Extension1 Record Identifier
+ if p.get('msisdn') is not None:
+ msisdn = enc_msisdn(p['msisdn'])
+ content = 'ff' * 20 + msisdn + 'ff' * 2
+
+ r = self._scc.select_file(['3f00', '7f10'])
+ data, sw = self._scc.update_record('6F40', 1, content, force_len=True)
+
# Populate AIDs
self.read_aids()
diff --git a/pysim-testdata/sysmoISIM-SJA2.ok b/pysim-testdata/sysmoISIM-SJA2.ok
index 26e20b0..b521c6d 100644
--- a/pysim-testdata/sysmoISIM-SJA2.ok
+++ b/pysim-testdata/sysmoISIM-SJA2.ok
@@ -53,7 +53,7 @@ HPLMNAcT:
ffffff0000 # unused
ACC: 0200
-MSISDN: Not available
+MSISDN (NPI=1 ToN=3): 6766266
Administrative data: 00000002
MS operation mode: normal operation
Ciphering Indicator: disabled