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
This commit is contained in:
Supreeth Herle 2020-03-20 18:50:39 +01:00
parent 441c4a768f
commit e26331ef72
8 changed files with 264 additions and 2 deletions

View File

@ -28,7 +28,7 @@ import os
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 @@ if __name__ == '__main__':
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")

View File

@ -188,7 +188,15 @@ class Card(object):
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

View File

@ -43,5 +43,47 @@ HPLMNAcT:
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 !

View File

@ -50,5 +50,45 @@ HPLMNAcT: Can't read file -- SW match failed! Expected 9000 and got 6a82.
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 !

View File

@ -16,5 +16,40 @@ HPLMNAcT: Can't read file -- SW match failed! Expected 9000 and got 9404.
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 !

View File

@ -55,5 +55,49 @@ HPLMNAcT:
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 !

View File

@ -55,5 +55,51 @@ HPLMNAcT:
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 !

View File

@ -16,5 +16,38 @@ HPLMNAcT: Can't read file -- SW match failed! Expected 9000 and got 9404.
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 !