Change in pysim[master]: Add ability to parse SIM Service Table (EF.SST)

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

laforge gerrit-no-reply at lists.osmocom.org
Fri Apr 17 10:13:01 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/17831 )

Change subject: Add ability to parse SIM Service Table (EF.SST)
......................................................................

Add ability to parse SIM Service Table (EF.SST)

As per TS.51.011, This EF indicates which services in the SIM are allocated, and whether, if allocated, the service is activated
.If a service is not indicated as available in the SIM, the ME shall not select this service.

Change-Id: Id28a35727adbaaa9df19b1adc621a0c51ad0e51b
---
M pySim-read.py
M pySim/cards.py
M pysim-testdata/Fairwaves-SIM.ok
M pysim-testdata/Wavemobile-SIM.ok
M pysim-testdata/fakemagicsim.ok
M pysim-testdata/sysmoISIM-SJA2.ok
M pysim-testdata/sysmoUSIM-SJS1.ok
M pysim-testdata/sysmosim-gr1.ok
8 files changed, 264 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/pySim-read.py b/pySim-read.py
index 98a2e81..31a3374 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -28,7 +28,7 @@
 import random
 import re
 import sys
-from pySim.ts_51_011 import EF, DF
+from pySim.ts_51_011 import EF, DF, EF_SST_map
 
 from pySim.commands import SimCardCommands
 from pySim.cards import card_detect, Card
@@ -219,5 +219,19 @@
 	else:
 		print("AD: Can't read, response code = %s" % (sw,))
 
+	# EF.SST
+	(res, sw) = card.read_sst()
+	if sw == '9000':
+		# (st_hex, avail_src_list) = res
+		# st_hex - Service Table in hex format
+		# avail_src_list - List of services available
+		print("SIM Service Table: %s" % res[0])
+		# Print those which are available
+		for s in res[1]:
+			if s in EF_SST_map:
+				print('\tService %d - %s: %s' % (s, EF_SST_map[s], s in res[1]))
+	else:
+		print("SIM Service Table: Can't read, response code = %s" % (sw,))
+
 	# Done for this card and maybe for everything ?
 	print("Done !\n")
diff --git a/pySim/cards.py b/pySim/cards.py
index d27092d..a12b111 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -188,7 +188,15 @@
 		else:
 			return (None, sw)
 
-	# Read the (full) AID for either ISIM or USIM application
+	# Read SIM Service table
+	def read_sst(self):
+		(res, sw) = self._scc.read_binary(EF['SST'])
+		if sw == '9000':
+			return ((res, parse_st(res)), sw)
+		else:
+			return (None, sw)
+
+	# Read the (full) AID for either ISIM or USIM or ISIM application
 	def read_aid(self, isim = False):
 
 		# First (known) halves of the AID
diff --git a/pysim-testdata/Fairwaves-SIM.ok b/pysim-testdata/Fairwaves-SIM.ok
index ffe9c42..1dbaab6 100644
--- a/pysim-testdata/Fairwaves-SIM.ok
+++ b/pysim-testdata/Fairwaves-SIM.ok
@@ -43,5 +43,47 @@
 ACC: 0008
 MSISDN: Not available
 AD: 00000002
+SIM Service Table: ff3cc3ff030fff0f000fff03f0c0
+	Service 1 - CHV1 disable function: True
+	Service 2 - Abbreviated Dialling Numbers (ADN): True
+	Service 3 - Fixed Dialling Numbers (FDN): True
+	Service 4 - Short Message Storage (SMS): True
+	Service 5 - Advice of Charge (AoC): True
+	Service 6 - Capability Configuration Parameters (CCP): True
+	Service 7 - PLMN selector: True
+	Service 8 - RFU: True
+	Service 11 - Extension2: True
+	Service 12 - SMS Parameters: True
+	Service 13 - Last Number Dialled (LND): True
+	Service 14 - Cell Broadcast Message Identifier: True
+	Service 17 - Service Provider Name: True
+	Service 18 - Service Dialling Numbers (SDN): True
+	Service 23 - enhanced Multi-Level Precedence and Pre-emption Service: True
+	Service 24 - Automatic Answer for eMLPP: True
+	Service 25 - Data download via SMS-CB: True
+	Service 26 - Data download via SMS-PP: True
+	Service 27 - Menu selection: True
+	Service 28 - Call control: True
+	Service 29 - Proactive SIM: True
+	Service 30 - Cell Broadcast Message Identifier Ranges: True
+	Service 31 - Barred Dialling Numbers (BDN): True
+	Service 32 - Extension4: True
+	Service 33 - De-personalization Control Keys: True
+	Service 34 - Co-operative Network List: True
+	Service 41 - USSD string data object supported in Call Control: True
+	Service 42 - RUN AT COMMAND command: True
+	Service 43 - User controlled PLMN Selector with Access Technology: True
+	Service 44 - Operator controlled PLMN Selector with Access Technology: True
+	Service 49 - MExE: True
+	Service 50 - Reserved and shall be ignored: True
+	Service 51 - PLMN Network Name: True
+	Service 52 - Operator PLMN List: True
+	Service 53 - Mailbox Dialling Numbers: True
+	Service 54 - Message Waiting Indication Status: True
+	Service 55 - Call Forwarding Indication Status: True
+	Service 56 - Service Provider Display Information: True
+	Service 57 - Multimedia Messaging Service (MMS): True
+	Service 58 - Extension 8: True
+	Service 59 - MMS User Connectivity Parameters: True
 Done !
 
diff --git a/pysim-testdata/Wavemobile-SIM.ok b/pysim-testdata/Wavemobile-SIM.ok
index 03191b3..e72599f 100644
--- a/pysim-testdata/Wavemobile-SIM.ok
+++ b/pysim-testdata/Wavemobile-SIM.ok
@@ -50,5 +50,45 @@
 ACC: abce
 MSISDN: Not available
 AD: 00ffff02
+SIM Service Table: ff33ff0f3c00ff0f000cf0c0f0030000
+	Service 1 - CHV1 disable function: True
+	Service 2 - Abbreviated Dialling Numbers (ADN): True
+	Service 3 - Fixed Dialling Numbers (FDN): True
+	Service 4 - Short Message Storage (SMS): True
+	Service 5 - Advice of Charge (AoC): True
+	Service 6 - Capability Configuration Parameters (CCP): True
+	Service 7 - PLMN selector: True
+	Service 8 - RFU: True
+	Service 9 - MSISDN: True
+	Service 10 - Extension1: True
+	Service 13 - Last Number Dialled (LND): True
+	Service 14 - Cell Broadcast Message Identifier: True
+	Service 17 - Service Provider Name: True
+	Service 18 - Service Dialling Numbers (SDN): True
+	Service 19 - Extension3: True
+	Service 20 - RFU: True
+	Service 21 - VGCS Group Identifier List (EFVGCS and EFVGCSS): True
+	Service 22 - VBS Group Identifier List (EFVBS and EFVBSS): True
+	Service 23 - enhanced Multi-Level Precedence and Pre-emption Service: True
+	Service 24 - Automatic Answer for eMLPP: True
+	Service 25 - Data download via SMS-CB: True
+	Service 26 - Data download via SMS-PP: True
+	Service 27 - Menu selection: True
+	Service 28 - Call control: True
+	Service 35 - Short Message Status Reports: True
+	Service 36 - Network's indication of alerting in the MS: True
+	Service 37 - Mobile Originated Short Message control by SIM: True
+	Service 38 - GPRS: True
+	Service 49 - MExE: True
+	Service 50 - Reserved and shall be ignored: True
+	Service 51 - PLMN Network Name: True
+	Service 52 - Operator PLMN List: True
+	Service 53 - Mailbox Dialling Numbers: True
+	Service 54 - Message Waiting Indication Status: True
+	Service 55 - Call Forwarding Indication Status: True
+	Service 56 - Service Provider Display Information: True
+	Service 57 - Multimedia Messaging Service (MMS): True
+	Service 58 - Extension 8: True
+	Service 59 - MMS User Connectivity Parameters: True
 Done !
 
diff --git a/pysim-testdata/fakemagicsim.ok b/pysim-testdata/fakemagicsim.ok
index 4ee5c7f..fc5bcdf 100644
--- a/pysim-testdata/fakemagicsim.ok
+++ b/pysim-testdata/fakemagicsim.ok
@@ -16,5 +16,40 @@
 ACC: ffff
 MSISDN: Not available
 AD: 000000
+SIM Service Table: ff3fff0f0300f003000c
+	Service 1 - CHV1 disable function: True
+	Service 2 - Abbreviated Dialling Numbers (ADN): True
+	Service 3 - Fixed Dialling Numbers (FDN): True
+	Service 4 - Short Message Storage (SMS): True
+	Service 5 - Advice of Charge (AoC): True
+	Service 6 - Capability Configuration Parameters (CCP): True
+	Service 7 - PLMN selector: True
+	Service 8 - RFU: True
+	Service 9 - MSISDN: True
+	Service 10 - Extension1: True
+	Service 11 - Extension2: True
+	Service 12 - SMS Parameters: True
+	Service 13 - Last Number Dialled (LND): True
+	Service 14 - Cell Broadcast Message Identifier: True
+	Service 17 - Service Provider Name: True
+	Service 18 - Service Dialling Numbers (SDN): True
+	Service 19 - Extension3: True
+	Service 20 - RFU: True
+	Service 21 - VGCS Group Identifier List (EFVGCS and EFVGCSS): True
+	Service 22 - VBS Group Identifier List (EFVBS and EFVBSS): True
+	Service 23 - enhanced Multi-Level Precedence and Pre-emption Service: True
+	Service 24 - Automatic Answer for eMLPP: True
+	Service 25 - Data download via SMS-CB: True
+	Service 26 - Data download via SMS-PP: True
+	Service 27 - Menu selection: True
+	Service 28 - Call control: True
+	Service 33 - De-personalization Control Keys: True
+	Service 34 - Co-operative Network List: True
+	Service 53 - Mailbox Dialling Numbers: True
+	Service 54 - Message Waiting Indication Status: True
+	Service 55 - Call Forwarding Indication Status: True
+	Service 56 - Service Provider Display Information: True
+	Service 57 - Multimedia Messaging Service (MMS): True
+	Service 58 - Extension 8: True
 Done !
 
diff --git a/pysim-testdata/sysmoISIM-SJA2.ok b/pysim-testdata/sysmoISIM-SJA2.ok
index 0ccb8e9..205cddf 100644
--- a/pysim-testdata/sysmoISIM-SJA2.ok
+++ b/pysim-testdata/sysmoISIM-SJA2.ok
@@ -55,5 +55,49 @@
 ACC: 0001
 MSISDN (NPI=1 ToN=1): +1234
 AD: 00000002
+SIM Service Table: ff33ffff3f003f0f300cf0c3f00000
+	Service 1 - CHV1 disable function: True
+	Service 2 - Abbreviated Dialling Numbers (ADN): True
+	Service 3 - Fixed Dialling Numbers (FDN): True
+	Service 4 - Short Message Storage (SMS): True
+	Service 5 - Advice of Charge (AoC): True
+	Service 6 - Capability Configuration Parameters (CCP): True
+	Service 7 - PLMN selector: True
+	Service 8 - RFU: True
+	Service 9 - MSISDN: True
+	Service 10 - Extension1: True
+	Service 13 - Last Number Dialled (LND): True
+	Service 14 - Cell Broadcast Message Identifier: True
+	Service 17 - Service Provider Name: True
+	Service 18 - Service Dialling Numbers (SDN): True
+	Service 19 - Extension3: True
+	Service 20 - RFU: True
+	Service 21 - VGCS Group Identifier List (EFVGCS and EFVGCSS): True
+	Service 22 - VBS Group Identifier List (EFVBS and EFVBSS): True
+	Service 23 - enhanced Multi-Level Precedence and Pre-emption Service: True
+	Service 24 - Automatic Answer for eMLPP: True
+	Service 25 - Data download via SMS-CB: True
+	Service 26 - Data download via SMS-PP: True
+	Service 27 - Menu selection: True
+	Service 28 - Call control: True
+	Service 29 - Proactive SIM: True
+	Service 30 - Cell Broadcast Message Identifier Ranges: True
+	Service 31 - Barred Dialling Numbers (BDN): True
+	Service 32 - Extension4: True
+	Service 33 - De-personalization Control Keys: True
+	Service 34 - Co-operative Network List: True
+	Service 35 - Short Message Status Reports: True
+	Service 36 - Network's indication of alerting in the MS: True
+	Service 37 - Mobile Originated Short Message control by SIM: True
+	Service 38 - GPRS: True
+	Service 49 - MExE: True
+	Service 50 - Reserved and shall be ignored: True
+	Service 51 - PLMN Network Name: True
+	Service 52 - Operator PLMN List: True
+	Service 53 - Mailbox Dialling Numbers: True
+	Service 54 - Message Waiting Indication Status: True
+	Service 57 - Multimedia Messaging Service (MMS): True
+	Service 58 - Extension 8: True
+	Service 59 - MMS User Connectivity Parameters: True
 Done !
 
diff --git a/pysim-testdata/sysmoUSIM-SJS1.ok b/pysim-testdata/sysmoUSIM-SJS1.ok
index 0299e3f..89123a0 100644
--- a/pysim-testdata/sysmoUSIM-SJS1.ok
+++ b/pysim-testdata/sysmoUSIM-SJS1.ok
@@ -55,5 +55,51 @@
 ACC: 0008
 MSISDN (NPI=1 ToN=1): +77776336143
 AD: 00000002
+SIM Service Table: ff3fffff3f003f1ff00c00c0f00000
+	Service 1 - CHV1 disable function: True
+	Service 2 - Abbreviated Dialling Numbers (ADN): True
+	Service 3 - Fixed Dialling Numbers (FDN): True
+	Service 4 - Short Message Storage (SMS): True
+	Service 5 - Advice of Charge (AoC): True
+	Service 6 - Capability Configuration Parameters (CCP): True
+	Service 7 - PLMN selector: True
+	Service 8 - RFU: True
+	Service 9 - MSISDN: True
+	Service 10 - Extension1: True
+	Service 11 - Extension2: True
+	Service 12 - SMS Parameters: True
+	Service 13 - Last Number Dialled (LND): True
+	Service 14 - Cell Broadcast Message Identifier: True
+	Service 17 - Service Provider Name: True
+	Service 18 - Service Dialling Numbers (SDN): True
+	Service 19 - Extension3: True
+	Service 20 - RFU: True
+	Service 21 - VGCS Group Identifier List (EFVGCS and EFVGCSS): True
+	Service 22 - VBS Group Identifier List (EFVBS and EFVBSS): True
+	Service 23 - enhanced Multi-Level Precedence and Pre-emption Service: True
+	Service 24 - Automatic Answer for eMLPP: True
+	Service 25 - Data download via SMS-CB: True
+	Service 26 - Data download via SMS-PP: True
+	Service 27 - Menu selection: True
+	Service 28 - Call control: True
+	Service 29 - Proactive SIM: True
+	Service 30 - Cell Broadcast Message Identifier Ranges: True
+	Service 31 - Barred Dialling Numbers (BDN): True
+	Service 32 - Extension4: True
+	Service 33 - De-personalization Control Keys: True
+	Service 34 - Co-operative Network List: True
+	Service 35 - Short Message Status Reports: True
+	Service 36 - Network's indication of alerting in the MS: True
+	Service 37 - Mobile Originated Short Message control by SIM: True
+	Service 38 - GPRS: True
+	Service 49 - MExE: True
+	Service 50 - Reserved and shall be ignored: True
+	Service 51 - PLMN Network Name: True
+	Service 52 - Operator PLMN List: True
+	Service 53 - Mailbox Dialling Numbers: True
+	Service 54 - Message Waiting Indication Status: True
+	Service 57 - Multimedia Messaging Service (MMS): True
+	Service 58 - Extension 8: True
+	Service 59 - MMS User Connectivity Parameters: True
 Done !
 
diff --git a/pysim-testdata/sysmosim-gr1.ok b/pysim-testdata/sysmosim-gr1.ok
index 04e4965..b231f00 100644
--- a/pysim-testdata/sysmosim-gr1.ok
+++ b/pysim-testdata/sysmosim-gr1.ok
@@ -16,5 +16,38 @@
 ACC: 0008
 MSISDN: Not available
 AD: 000000
+SIM Service Table: ff3fff0f0f0000030000
+	Service 1 - CHV1 disable function: True
+	Service 2 - Abbreviated Dialling Numbers (ADN): True
+	Service 3 - Fixed Dialling Numbers (FDN): True
+	Service 4 - Short Message Storage (SMS): True
+	Service 5 - Advice of Charge (AoC): True
+	Service 6 - Capability Configuration Parameters (CCP): True
+	Service 7 - PLMN selector: True
+	Service 8 - RFU: True
+	Service 9 - MSISDN: True
+	Service 10 - Extension1: True
+	Service 11 - Extension2: True
+	Service 12 - SMS Parameters: True
+	Service 13 - Last Number Dialled (LND): True
+	Service 14 - Cell Broadcast Message Identifier: True
+	Service 17 - Service Provider Name: True
+	Service 18 - Service Dialling Numbers (SDN): True
+	Service 19 - Extension3: True
+	Service 20 - RFU: True
+	Service 21 - VGCS Group Identifier List (EFVGCS and EFVGCSS): True
+	Service 22 - VBS Group Identifier List (EFVBS and EFVBSS): True
+	Service 23 - enhanced Multi-Level Precedence and Pre-emption Service: True
+	Service 24 - Automatic Answer for eMLPP: True
+	Service 25 - Data download via SMS-CB: True
+	Service 26 - Data download via SMS-PP: True
+	Service 27 - Menu selection: True
+	Service 28 - Call control: True
+	Service 33 - De-personalization Control Keys: True
+	Service 34 - Co-operative Network List: True
+	Service 35 - Short Message Status Reports: True
+	Service 36 - Network's indication of alerting in the MS: True
+	Service 57 - Multimedia Messaging Service (MMS): True
+	Service 58 - Extension 8: True
 Done !
 

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Id28a35727adbaaa9df19b1adc621a0c51ad0e51b
Gerrit-Change-Number: 17831
Gerrit-PatchSet: 5
Gerrit-Owner: herlesupreeth <herlesupreeth at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: herlesupreeth <herlesupreeth at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200417/1a26d769/attachment.htm>


More information about the gerrit-log mailing list