AAA, NAC, Guest Access & BYOD

How to prevent users from entering '+' or '0' in front of country code in the phone number field?

Aruba Employee
Requirement:

How can I prevent guest users from entering '+' sign or '0' in front of country-code in the visitor phone number field during self registration?

 

Few SMS service providers are not looking for '+' sign or '0' or '00' in front of the international phone numbers to trigger the sms. Providing these values in front of country code during self-registration may fail to deliver the sms to recipient.

 

 



Solution:

Using a simple regular expression, you can validate the entered phone number during the guest registration. 

The below regular expression will help you to validate the phone number and allows to register only  when the phone number is not staring with '+' or '0'. 

^[1-9][0-9](\d{7}|\d{8}|\d{9}|\d{10}|\d{11}|\d{12})$

It also performs the below validations.

  • only numbers are allowed.
  • first digit of the entered phone number should be 1 to 9, so '+' or '0' is not allowed. 
  • numbers from 0 to 9 are allowed from the second digit.
  • also validates phone number length, the length of the phone number should be 9 to 14.

 

 

 

 



Configuration:

To add the above regex in the visitor_phone number filed, please navigate to ClearPass Guest >> Configuration >> (Pages)Guest Self-Registration >> select the self-registration page and go to Edit >> Register Page >> Form >>  select the filed visitor_phone and set the Validator to " ISRegexMatch" and enter the above regex in the Validator Argument filed as shown below.

 

Note:  Edit the Validation Error as per your requirement.



Verification

Adding the given regex will validate the phone number and prevent the guest user from registering the phone number starts with '+' or '0'.

 

Please find below the sample outputs for your reference.

Result when phone number starts with '+' or '0'.

 

 

Successful registration.

Version history
Revision #:
2 of 2
Last update:
‎06-25-2015 11:25 AM
Updated by:
 
Labels (1)
Contributors
Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: 
Is this a frequent problem?

Request an official Aruba knowledge base article to be written by our experts.