01-30-2012 03:25 PM - edited 03-14-2019 09:16 AM
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
Solved! Go to Solution.
01-31-2012 07:42 AM
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.
01-31-2012 06:15 AM
Any one out there that can point me in the right direction?
Thanks,
Solomon
01-31-2012 06:36 AM
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
01-31-2012 07:22 AM
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
01-31-2012 07:42 AM
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.
01-31-2012 11:35 AM
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?
01-31-2012 11:41 AM
Hmm, must be some limitation, you can try converting it first to float or long and then to integer.
Chris
01-31-2012 12:25 PM
max range for an int is 2147483647
Brian
01-31-2012 12:32 PM
I thought I was close! Since I cannot use the integer because of the max range, any other ideas?
Thanks,
Solomon
01-31-2012 01:04 PM
did you try long or float per my previous suggestion.
Sent from Cisco Technical Support iPhone App
01-31-2012 01:51 PM
Yes, it changes the ANI completely.
01-31-2012 03:26 PM
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
01-31-2012 07:13 PM
Thanks Chris, Got it working using the long variable.
Thanks,
Solomon
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide