cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4228
Views
2
Helpful
7
Replies

ISE Guest Portal phone number modification

dkalinsky
Level 1
Level 1

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

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

Jason Kunst
Cisco Employee
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

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.

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

Yeah, we only care about prefix 8

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

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?

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>

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: