<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/pysim/+/23997">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ts_51_011: fix encoding of EF.MSISDN<br><br>The json input that is used with EF.MSISDN seems to be somewhat<br>ambigious. The original code accepts {"msisdn": "+4916012345678"}<br>only while the output is {"msisdn": [1, 1, "+4916012345678"]}. Lets<br>add a check and also accept the latter version.<br><br>Change-Id: I8f8dd68aac25d3fa3bc1aab06b855f8ec6640258<br>Related: OS#4963<br>---<br>M pySim/ts_51_011.py<br>1 file changed, 5 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/97/23997/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py</span><br><span>index 9123330..15a7907 100644</span><br><span>--- a/pySim/ts_51_011.py</span><br><span>+++ b/pySim/ts_51_011.py</span><br><span>@@ -381,7 +381,11 @@</span><br><span>     def _decode_record_hex(self, raw_hex_data):</span><br><span>         return {'msisdn': dec_msisdn(raw_hex_data)}</span><br><span>     def _encode_record_hex(self, abstract):</span><br><span style="color: hsl(0, 100%, 40%);">-        encoded_msisdn = enc_msisdn(abstract['msisdn'])</span><br><span style="color: hsl(120, 100%, 40%);">+        msisdn = abstract['msisdn']</span><br><span style="color: hsl(120, 100%, 40%);">+        if type(msisdn) == str:</span><br><span style="color: hsl(120, 100%, 40%);">+            encoded_msisdn = enc_msisdn(msisdn)</span><br><span style="color: hsl(120, 100%, 40%);">+        else:</span><br><span style="color: hsl(120, 100%, 40%);">+            encoded_msisdn = enc_msisdn(msisdn[2],msisdn[0],msisdn[1])</span><br><span>         alpha_identifier = (list(self.rec_len)[0] - len(encoded_msisdn) // 2) * "ff"</span><br><span>         return alpha_identifier + encoded_msisdn</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/23997">change 23997</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/pysim/+/23997"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: pysim </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I8f8dd68aac25d3fa3bc1aab06b855f8ec6640258 </div>
<div style="display:none"> Gerrit-Change-Number: 23997 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>