cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1684
Views
0
Helpful
12
Replies

How to get the first 3 digits from Calling number?

solomonluke
Level 4
Level 4

Customer has UCCX v8.5 Standard license.

How can I get the first 3 digits from Calling number to be able to do a search in xml with area codes?

I have done some reading and finding this statement

SET area_code = calling_number.substring(0, 3)

The problem is this does not work with standard license.

Is there another method that will give me the first 3 digits of the calling number?

Thanks,
Solomon

1 Accepted Solution

Accepted Solutions

You should be able to simply use set step to convert string to integer, here is snippet of an example,

ANI is the string varaibale and calling_number is the integer.

View solution in original post

12 Replies 12

solomonluke
Level 4
Level 4

Any one out there that can point me in the right direction?

Thanks,

Solomon

Solomon,

The syntax you posted is normally what one would use, but since Java is not available in Standard I suppose this may not work though this surprises me.  I don't have any other solution except for perhaps trying some math on it, i.e. calling_number / 10000000 (assuming this is US and all calls come in as 10 digits), if the calling_number is an integer it should work, one thing you may need to verify is to ensure it rounds it down and not up, i.e. 847-888-1234 is 847 not 848.

HTH,

Chris

Chris,

Thanks for the reply.

So I should convert the calling_number to an integer and then do some math?

Can you provide me with an example syntax?

Thanks,

Solomon

You should be able to simply use set step to convert string to integer, here is snippet of an example,

ANI is the string varaibale and calling_number is the integer.

Chris,

Your method works perfect up to 9 digits of ANI. As soon as the ANI = 10 digits I get the following error. Do you you why?

Hmm, must be some limitation, you can try converting it first to float or long and then to integer.

Chris

max range for an int is 2147483647

Brian

I thought I was close! Since I cannot use the integer because of the max range, any other ideas?

Thanks,

Solomon

Chris Deren
Hall of Fame
Hall of Fame

did you try long or float per my previous suggestion.

Sent from Cisco Technical Support iPhone App

Yes, it changes the ANI completely.

So, looks like float is the same value with period, so not to get the final area code instead of dividing it by 10000000 simply multiple it by 100.

Chris

Thanks Chris, Got it working using the long variable.

Thanks,

Solomon