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?
Solved! Go to Solution.
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)
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?
Thank you so much Brian. I couldn't have asked for more.
All the best and have a great holiday period.