aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/gsm/protocol/gsm_23_003.h3
-rw-r--r--src/gsm/gsm23003.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h b/include/osmocom/gsm/protocol/gsm_23_003.h
index be1b157..3e5c3e5 100644
--- a/include/osmocom/gsm/protocol/gsm_23_003.h
+++ b/include/osmocom/gsm/protocol/gsm_23_003.h
@@ -20,6 +20,9 @@
#define GSM23003_MME_CODE_NUM_BYTES 1
#define GSM23003_MME_GROUP_NUM_BYTES 2
#define GSM23003_MTMSI_NUM_BYTES 4
+/* Chapter 3.2 */
+#define GSM23003_MSISDN_MAX_DIGITS 15 /* ITU-T Rec. E.164 6.1 */
+#define GSM23003_MSISDN_MIN_DIGITS 1
/* Chapter 6.2.1 */
#define GSM23003_IMEI_TAC_NUM_DIGITS 8
#define GSM23003_IMEI_SNR_NUM_DIGITS 6
diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c
index 2252f70..a97ed07 100644
--- a/src/gsm/gsm23003.c
+++ b/src/gsm/gsm23003.c
@@ -69,7 +69,7 @@ bool osmo_imsi_str_valid(const char *imsi)
*/
bool osmo_msisdn_str_valid(const char *msisdn)
{
- return is_n_digits(msisdn, 1, 15);
+ return is_n_digits(msisdn, GSM23003_MSISDN_MIN_DIGITS, GSM23003_MSISDN_MAX_DIGITS);
}
/*! Determine whether the given IMEI is valid according to 3GPP TS 23.003,