12-19-2018 07:07 AM - edited 03-14-2019 06:40 PM
Hi All,
I have been asked to edit our existing CCX script, that I wrote by pulling together various examples without any formal training on the subject and I need a little bit of help with writing an IF step.
We are running CUCM version 10.5.2.13901-2 and UCCX version 10.6.1.10000-39.
My script, currently has a bunch of nested IF steps to determine the CSQ the call is assigned to based on what the calling number starts with (below) but there is a small error with this.
The condition string for one of these IF steps is:
CLID.startsWith("0164545") || CLID.startsWith("057932774") || CLID.startsWith("05261898") || CLID.startsWith("45") || CLID.startsWith("74") || CLID.startsWith("98")
The problem is that some of our logged out extensions being with 45 i.e. 45123 so some calls are being routed incorrectly to these CSQs. I am looking for a way to check for the length of the CLID variable but I cannot seem to find any API for it. In my head something like CLID.length("4") might be used to look for CLID strings with a length of 4 to help my correctly filter these calls.
Ultimately, in this case I need to split this into stages where the pseudo code would be:
IF CLID.startsWith("0164545") || CLID.startsWith("057932774") || CLID.startsWith("05261898")
THEN do X
IF CLID.startsWith("45") || CLID.startsWith("74") || CLID.startsWith("98") AND CLID.length("4")
THEN also do X
ELSE do Y
Could someone help me with the formatting of this or point me to an API?
Cheers,
Gordon
Solved! Go to Solution.
12-20-2018 01:11 AM
12-19-2018 08:46 AM
You're looking for CLID.length() >4
So, it would look something like:
((CLID.startsWith("45") || CLID.startsWith("74") || CLID.startsWith("98")) && CLID.length() > 4)
12-20-2018 12:25 AM
Thanks for the response Brian, that is very helpful.
I'm assuming the string of CLID.length() >4 is looking for length of more than four so that 45123 would register as TRUE and 4512 would register as False?
If that's the case would CLID.length() =4 look for length of exactly four so that 4512 would register as TRUE, while 45123 would register as FALSE, essentially reversing the results from above?
One final question. Is there a NOT operator for this? Say, something like CLID.length() !=4, which would register 45123 as TRUE as it has 5 digits and 4512 as FALSE, given that it has 4?
Cheers,
12-20-2018 01:11 AM
12-20-2018 01:16 AM
Thank you so much Brian. I couldn't have asked for more.
All the best and have a great holiday period.
12-20-2018 10:09 AM
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