cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

This community is for technical, feature, configuration and deployment questions.
For production deployment issues, please contact the TAC! We will not comment or assist with your TAC case in these forums.
Please see How to Ask the Community for Help for other best practices.

2002
Views
2
Helpful
7
Replies
Highlighted
Beginner

ISE Guest Portal phone number modification

Dear experts,

Do we have any possibility to change the phone number variable before send it to SMS gateway?

For example, we have to ask end users to input their phone number in format 8XXXXXXXXXX, but our SMS provider expects from us phone number in format 7XXXXXXXXXX.

So we have to change the first number in the phone number variable '8' -> '7' or just cut out '8' and add '7' into the POST configuration of the SMS provider.

Please give advice

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Could you please try this one?

<script>

$('[id="ui_self_reg_submit_button"]').on('click', function(evt){

    cisco.ise.validation.setPhoneRegex();

    cisco.ise.validation.setPhoneNumberMessage();

    var phoneInput = $('#guestUser\\.fieldValues\\.ui_phone_number');

    var phoneNumber = phoneInput.val();

    var regPhone = new RegExp(/^8[0-9]{10}$/)

    if (regPhone.test(phoneNumber)) {

      var regexped = phoneNumber.replace(/^8/, '7');

      phoneInput.val(regexped);

    }else { 

      cisco.ise.validation.setPhoneRegex(/^8[0-9]{10}$/);

      cisco.ise.validation.setPhoneNumberMessage("Please provide your phone number in format 8XXXXXXXXXX");

    }

  });    

</script>

View solution in original post

7 REPLIES 7
Highlighted
Cisco Employee

Why is this required, can you explain why you require one way and SMS provider wants another?

Is it that your reports need the 8?

If the rewrite was done on the page using JavaScript i think this would defeat the purpose as the logs would show a 7

Seems to me this rewrite would have to happen on backend after the number is registered on ise but before sent to provider

If that's the case you will need to open an enhancement through the tac

Highlighted

Russian international country code is +7 , our provider expects from us the format '7XXXXXXXXXX' of the phone number.

However, inside the country the format 8XXXXXXXXXX is commonly used to make calls and for most of users it's not comfortable to input their phone in 7XXXXXXXXXX format.

We want to create a handy portal and fit provider's API.

It doesn't really matter which format will be in our reports.

Highlighted

Ok it sounds like if the user entered the 8 and then we replace with a 7 somehow but hide to the user then this will work

I guess you don't care about any other type numbers

Highlighted

Yeah, we only care about prefix 8

Highlighted

Hi Dmitry,

Is that script works for you?

You have to insert that script for Registration page with phone number.

I tested on "Self-registration portal" for Self registered page" and it works fine.

<script>

(function(){

jQuery(document).ready(function() {

setTimeout(function(){

cisco.ise.validation.setPhoneRegex(/^8[0-9]{10}$/);

cisco.ise.validation.setPhoneNumberMessage("Please provide your phone number in format 8XXXXXXXXXX");

}, 100);

});

})();

</script>

Thanks

Highlighted

Hi Serhii,

Yes, this script works fine.

But we have to verify and then change the number from 8XXXXXXXXXX->7XXXXXXXXXX.

How can we make this change after submitting the form?

Highlighted

Could you please try this one?

<script>

$('[id="ui_self_reg_submit_button"]').on('click', function(evt){

    cisco.ise.validation.setPhoneRegex();

    cisco.ise.validation.setPhoneNumberMessage();

    var phoneInput = $('#guestUser\\.fieldValues\\.ui_phone_number');

    var phoneNumber = phoneInput.val();

    var regPhone = new RegExp(/^8[0-9]{10}$/)

    if (regPhone.test(phoneNumber)) {

      var regexped = phoneNumber.replace(/^8/, '7');

      phoneInput.val(regexped);

    }else { 

      cisco.ise.validation.setPhoneRegex(/^8[0-9]{10}$/);

      cisco.ise.validation.setPhoneNumberMessage("Please provide your phone number in format 8XXXXXXXXXX");

    }

  });    

</script>

View solution in original post

Content for Community-Ad