aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <daniel@totalueberwachung.de>2018-10-02 18:10:21 +0200
committerDaniel Willmann <daniel@totalueberwachung.de>2018-10-02 18:11:42 +0200
commit970b6c781d4ffb7b8b6bff9499d1e72be8ee61c1 (patch)
tree154df2311d2092ed7a317afdd1ed3de3812e2f4a
parent0ec147513c453e1a5a39133494427c0d84f396be (diff)
pySim-prog: Honor international '+' in SMSC numberdaniel/smsc
-rwxr-xr-xpySim-prog.py8
1 files changed, 6 insertions, 2 deletions
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 @@ def gen_parameters(opts):
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