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

ISE Guest Portal phone number modification

dkalinsky
Beginner
Beginner

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