diff --git a/sysmo_usimsjs1.py b/sysmo_usimsjs1.py index 789a052..d569b72 100644 --- a/sysmo_usimsjs1.py +++ b/sysmo_usimsjs1.py @@ -292,8 +292,16 @@ def sysmo_usim_show_auth_params(sim): # Program new authentication parameters def sysmo_usim_write_auth_params(sim, algo_2g_str, algo_3g_str): - algo_2g = sysmo_usim_str_to_algo(algo_2g_str) - algo_3g = sysmo_usim_str_to_algo(algo_3g_str) + + if algo_2g_str.isdigit(): + algo_2g = int(algo_2g_str) + else: + algo_2g = sysmo_usim_str_to_algo(algo_2g_str) + + if algo_3g_str.isdigit(): + algo_3g = int(algo_2g_str) + else: + algo_3g = sysmo_usim_str_to_algo(algo_3g_str) print " * New algorithm setting:" print " 2G: %d=%s" % (algo_2g, sysmo_usim_algo_to_str(algo_2g))