ts_51_011: fix encoding of EF.MSISDN
The json input that is used with EF.MSISDN seems to be somewhat
ambigious. The original code accepts {"msisdn": "+4916012345678"}
only while the output is {"msisdn": [1, 1, "+4916012345678"]}. Lets
add a check and also accept the latter version.
Change-Id: I8f8dd68aac25d3fa3bc1aab06b855f8ec6640258
Related: OS#4963
This commit is contained in:
@@ -381,7 +381,11 @@ class EF_MSISDN(LinFixedEF):
|
||||
def _decode_record_hex(self, raw_hex_data):
|
||||
return {'msisdn': dec_msisdn(raw_hex_data)}
|
||||
def _encode_record_hex(self, abstract):
|
||||
encoded_msisdn = enc_msisdn(abstract['msisdn'])
|
||||
msisdn = abstract['msisdn']
|
||||
if type(msisdn) == str:
|
||||
encoded_msisdn = enc_msisdn(msisdn)
|
||||
else:
|
||||
encoded_msisdn = enc_msisdn(msisdn[2],msisdn[0],msisdn[1])
|
||||
alpha_identifier = (list(self.rec_len)[0] - len(encoded_msisdn) // 2) * "ff"
|
||||
return alpha_identifier + encoded_msisdn
|
||||
|
||||
|
||||
Reference in New Issue
Block a user