pySim-read.py: Enabled reading P-CSCF address from ISIM

As per 3GPP TS 31.103 version 14.2.0 Release 14, this EF can found under ADF.ISIM at File Id 6f09.

This EF contains one or more Proxy Call Session Control Function addresses.
The first record in the EF shall be considered to be of the highest priority
If ISIM service n°1 and/or service n°5 is available, this file shall be present.

Change-Id: I7a701212c84d3dc5d4c8ccbcf638c97ceda33654
This commit is contained in:
Supreeth Herle
2020-03-24 17:26:40 +01:00
committed by herlesupreeth
parent 75c14c0cbd
commit 5ad9aec98f
3 changed files with 34 additions and 1 deletions

View File

@@ -25,6 +25,7 @@
from pySim.ts_51_011 import EF, DF
from pySim.ts_31_102 import EF_USIM_ADF_map
from pySim.ts_31_103 import EF_ISIM_ADF_map
from pySim.utils import *
from smartcard.util import toBytes
@@ -313,6 +314,18 @@ class IsimCard(Card):
def __init__(self, ssc):
super(IsimCard, self).__init__(ssc)
def read_pcscf(self):
rec_cnt = self._scc.record_count(EF_ISIM_ADF_map['PCSCF'])
pcscf_recs = ""
for i in range(0, rec_cnt):
(res, sw) = self._scc.read_record(EF_ISIM_ADF_map['PCSCF'], i + 1)
if sw == '9000':
content = dec_addr_tlv(res)
pcscf_recs += "%s" % (len(content) and content or '\tNot available\n')
else:
pcscf_recs += "\tP-CSCF: Can't read, response code = %s\n" % (sw)
return pcscf_recs
class _MagicSimBase(Card):
"""