laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35416?usp=email )
Change subject: 31.102 + 51.011: Fix encode/decode of EF.CFIS ......................................................................
31.102 + 51.011: Fix encode/decode of EF.CFIS
The EF.CFIS definition is not identical to EF.ADN, so we cannot recycle the EF.ADN class to decode EF.CFIS.
Change-Id: Idcab35cbe28332e3c8612bcb90226335b48ea973 --- M pySim/ts_31_102.py M pySim/ts_51_011.py 2 files changed, 36 insertions(+), 4 deletions(-)
Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified
diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index 87bd8c7..e39bad2 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -31,7 +31,7 @@ from pySim.ts_51_011 import EF_ACMmax, EF_AAeM, EF_eMLPP, EF_CMI, EF_PNN from pySim.ts_51_011 import EF_MMSN, EF_MMSICP, EF_MMSUP, EF_MMSUCP, EF_VGCS, EF_VGCSS, EF_NIA from pySim.ts_51_011 import EF_SMSR, EF_DCK, EF_EXT, EF_CNL, EF_OPL, EF_MBI, EF_MWIS -from pySim.ts_51_011 import EF_CBMID, EF_CBMIR, EF_ADN, EF_SMS, EF_MSISDN, EF_SMSP, EF_SMSS +from pySim.ts_51_011 import EF_CBMID, EF_CBMIR, EF_ADN, EF_CFIS, EF_SMS, EF_MSISDN, EF_SMSP, EF_SMSS from pySim.ts_51_011 import EF_IMSI, EF_xPLMNwAcT, EF_SPN, EF_CBMI, EF_ACC, EF_PLMNsel from pySim.ts_51_011 import EF_Kc, EF_CPBCCH, EF_InvScan from pySim.ts_102_221 import EF_ARR @@ -1460,7 +1460,7 @@ EF_EXT('6fc8', None, 'EF.EXT6', desc='Extension6 (MBDN)'), EF_MBI(service=47), EF_MWIS(service=48), - EF_ADN('6fcb', None, 'EF.CFIS', desc='Call Forwarding Indication Status', service=49, ext=7), + EF_CFIS(service=49, ext=7), EF_EXT('6fcc', None, 'EF.EXT7', desc='Extension7 (CFIS)'), TransparentEF('6fcd', None, 'EF.SPDI', desc='Service Provider Display Information', service=51), EF_MMSN(service=52), diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py index 65bc85c..7617210 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -793,6 +793,27 @@ self._construct = FlagsEnum( Byte, in_limited_service_mode=1, after_successful_plmn_selection=2)
+# TS 51.011 Section 10.3.46 +class EF_CFIS(LinFixedEF): + _test_decode = [ + ( '0100ffffffffffffffffffffffffffff', + {"msp_number": 1, "cfu_indicator_status": { "voice": False, "fax": False, "data": False, "rfu": 0 }, + "len_of_bcd": 255, "ton_npi": {"ext": True, + "type_of_number": "reserved_for_extension", + "numbering_plan_id": "reserved_for_extension"}, + "dialing_nr": "", "cap_conf_id": 255, "ext7_record_id": 255} ), + ] + def __init__(self, fid='6fcb', sfid=None, name='EF.CFIS', desc='Call Forwarding Indication Status', ext=7, **kwargs): + super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=(16, 30), **kwargs) + ext_name = 'ext%u_record_id' % ext + self._construct = Struct('msp_number'/Int8ub, + 'cfu_indicator_status'/BitStruct('voice'/Flag, 'fax'/Flag, 'data'/Flag, 'rfu'/BitsRFU(5)), + 'len_of_bcd'/Int8ub, + 'ton_npi'/TonNpi, + 'dialing_nr'/ExtendedBcdAdapter(BcdAdapter(Rpad(Bytes(10)))), + 'cap_conf_id'/Int8ub, + ext_name/Int8ub) + # TS 51.011 Section 4.2.58 class EF_PNN(LinFixedEF): # TODO: 430a82d432bbbc7eb75de432450a82d432bbbc7eb75de432ffffffff @@ -977,8 +998,7 @@ EF_ADN('6fc7', None, 'EF.MBDN', desc='Mailbox Dialling Numbers'), EF_MBI(), EF_MWIS(), - EF_ADN('6fcb', None, 'EF.CFIS', - desc='Call Forwarding Indication Status'), + EF_CFIS(), EF_EXT('6fc8', None, 'EF.EXT6', desc='Externsion6 (MBDN)'), EF_EXT('6fcc', None, 'EF.EXT7', desc='Externsion7 (CFIS)'), EF_SPDI(),