laforge has uploaded this change for review. ( 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, 35 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/16/35416/1
diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index 87bd8c7..a203a22 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -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 efec79d..cc8d032 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(),