Change in pysim[master]: pySim-prog: Honor international '+' in SMSC number

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/.

daniel gerrit-no-reply at lists.osmocom.org
Tue Oct 2 17:15:16 UTC 2018


daniel has uploaded this change for review. ( https://gerrit.osmocom.org/11201


Change subject: pySim-prog: Honor international '+' in SMSC number
......................................................................

pySim-prog: Honor international '+' in SMSC number

The smsc no. programmed by pySim-prog would always be a national number
in the past. Check whether the first 'digit' is a + and indicate that it
is an international number.

Change-Id: Ia79913f5b0307e9786a5acea75c0811927be2eef
---
M pySim-prog.py
1 file changed, 6 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/01/11201/1

diff --git a/pySim-prog.py b/pySim-prog.py
index eca8b4e..923a035 100755
--- a/pySim-prog.py
+++ b/pySim-prog.py
@@ -319,14 +319,18 @@
 			raise ValueError('SMSP must be at least 28 bytes')
 
 	else:
+                ton = "81"
 		if opts.smsc is not None:
 			smsc = opts.smsc
-			if not _isnum(smsc):
+                        if smsc[0] == '+':
+                            ton = "91"
+                            smsc = smsc[1:]
+                        if not _isnum(smsc):
 				raise ValueError('SMSC must be digits only !')
 		else:
 			smsc = '00%d' % opts.country + '5555'	# Hack ...
 
-		smsc = '%02d' % ((len(smsc) + 3)//2,) + "81" + swap_nibbles(rpad(smsc, 20))
+		smsc = '%02d' % ((len(smsc) + 3)//2,) + ton + swap_nibbles(rpad(smsc, 20))
 
 		smsp = (
 			'e1' +			# Parameters indicator

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia79913f5b0307e9786a5acea75c0811927be2eef
Gerrit-Change-Number: 11201
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181002/fce3c239/attachment.htm>


More information about the gerrit-log mailing list