diff --git a/pySim-prog.py b/pySim-prog.py index 601f980c..85475732 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -147,6 +147,9 @@ def parse_options(): parser.add_option("--acc", dest="acc", help="Set ACC bits (Access Control Code). not all card types are supported", ) + parser.add_option("--epdgid", dest="epdgid", + help="Set Home Evolved Packet Data Gateway (ePDG) Identifier. (Only FQDN format supported)", + ) parser.add_option("--read-imsi", dest="read_imsi", action="store_true", help="Read the IMSI from the CARD", default=False ) @@ -442,6 +445,7 @@ def gen_parameters(opts): 'acc' : acc, 'pin_adm' : pin_adm, 'msisdn' : opts.msisdn, + 'epdgid' : opts.epdgid, } diff --git a/pySim/cards.py b/pySim/cards.py index eeeae822..8835cc97 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -1160,6 +1160,15 @@ class SysmoISIMSJA2(UsimCard): sw = self.update_ehplmn(p['mcc'], p['mnc']) if sw != '9000': print("Programming EHPLMN failed with code %s"%sw) + + # update EF.ePDGId in ADF.USIM + if self.file_exists(EF_USIM_ADF_map['ePDGId']): + if p.get('epdgid'): + sw = self._scc.update_binary( + EF_USIM_ADF_map['ePDGId'], enc_epdgid(p['epdgid'])) + if sw != '9000': + print("Programming ePDGId failed with code %s"%sw) + return