aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorherlesupreeth <herlesupreeth@gmail.com>2020-12-24 09:38:42 +0100
committerherlesupreeth <herlesupreeth@gmail.com>2021-01-05 11:46:41 +0100
commit1279085f7ee5e3434eaa3c467a7a2955b092be9d (patch)
tree2d3b80d84a8aabfa278d0f9eb592b1f78a00597b
parentc491dc019f46137e6700a918d589182b954eec8c (diff)
sysmoISIM-SJA2: Add support for programming IPv4 address for PCSCF
This commit allows programming of IPv4 or FQDN in EF.PCSCF Example: ./pySim-prog.py -p 0 -x 001 -y 01 -s 8988211900000000004 -i 001011234567895 -k 8baf473f2f8fd09487cccbd7097c6862 --op 11111111111111111111111111111111 -o 8E27B6AF0E692E750F32667A3B14605D -a 85524953 -n isim.test --msisdn 0598765432100 --epdgid 172.24.15.20 --pcscf 99.100.80.102 --ims-hdomain testims.org Change-Id: I247a5413e9e5fef6b9d7b6cb8442313e72f9156a
-rw-r--r--pySim/cards.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pySim/cards.py b/pySim/cards.py
index b7be6e8..17da506 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -336,12 +336,16 @@ class IsimCard(Card):
def update_pcscf(self, pcscf):
if len(pcscf) > 0:
- content = enc_addr_tlv(pcscf)
+ addr_type = get_addr_type(pcscf)
+ if addr_type == None:
+ raise ValueError("Unknown PCSCF address type or invalid address provided")
+ content = enc_addr_tlv(pcscf, ('%02x' % addr_type))
else:
# Just the tag value
content = '80'
rec_size_bytes = self._scc.record_size(EF_ISIM_ADF_map['PCSCF'])
- data, sw = self._scc.update_record(EF_ISIM_ADF_map['PCSCF'], 1, rpad(content, rec_size_bytes*2))
+ pcscf_tlv = rpad(content, rec_size_bytes*2)
+ data, sw = self._scc.update_record(EF_ISIM_ADF_map['PCSCF'], 1, pcscf_tlv)
return sw
def read_domain(self):