Change in pysim[master]: utils: fix dec_msisdn(): properly detect international numbers

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Wed Feb 26 19:21:02 UTC 2020


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/17277 )


Change subject: utils: fix dec_msisdn(): properly detect international numbers
......................................................................

utils: fix dec_msisdn(): properly detect international numbers

We should match the whole value of ToN, not just one LSB bit.

Change-Id: Idc51f09b3420d827a75a1161372e4e97c3ddfbc1
---
M pySim/utils.py
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/77/17277/1

diff --git a/pySim/utils.py b/pySim/utils.py
index 8420b23..c098384 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -295,7 +295,7 @@
 
 	msisdn = swap_nibbles(b2h(msisdn_lhv[2:][:bcd_len])).rstrip('f')
 	# International number 10.5.118/3GPP TS 24.008
-	if (ton & 0x01) == 0x01:
+	if ton == 0x01:
 		msisdn = '+' + msisdn
 
 	return (npi, ton, msisdn)

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/17277
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Idc51f09b3420d827a75a1161372e4e97c3ddfbc1
Gerrit-Change-Number: 17277
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200226/7bc8b4cf/attachment.htm>


More information about the gerrit-log mailing list