06-19-2010 03:58 PM - edited 03-15-2019 11:18 PM
Hi all,
In need compare called number with a variable. For example, variable is: "extension". If "extension" is "3234" go to label "numbers begin with 32", but if "extension" is "3520" go to label "numbers begin with 35". I know what can i do to identiefied called number and make go to.
I need to know how compare the called number with a range extension.
What can i do?
Solved! Go to Solution.
06-19-2010 05:43 PM
Could you please identify the product and version that you are trying to use to accomplish this task?
IF UCCX, then you could use the expression builder and something like this:
Set myextension="32567" /*insert and use your existing process to collect these digits
Set myrange = {myextension.substr(0,2)}
Switch (Str myrange)
...etc...
Check this link for more info on the string functions available to you via the expression builder:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html
And here for syntax requirements of the .substr() method:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#substring%28int,%20int%29
HTH.
Regards,
Bill
Please remember to rate helpful posts.
Please remember to rate helpful responses and identify
06-22-2010 08:26 AM
Yes, you will need both the myextension and myrange variables declared as type String. I also double checked the syntax on my CRS editor. Looks like the expression builder is looking for .substring as the method as opposed to .substr. My apologies for the confusion. Also, the curly braces aren't necessary. I was trying to show that you would use the expression builder.
Anyway, take a look at this screen shot:
This can be applied without catching a syntax error and should work for you. Try it out and let us know.
HTH.
Regards,
Bill
Please remember to rate helpful responses and identify
06-19-2010 05:23 PM
It sounds like you're asking for a programming technique. It depends on what programming language you're using.
For example, in Visual Basic, you may use Left(strVar, 2) or strVar.Substring(0, 2) to extract the first two digits.
Michael
06-19-2010 05:43 PM
Could you please identify the product and version that you are trying to use to accomplish this task?
IF UCCX, then you could use the expression builder and something like this:
Set myextension="32567" /*insert and use your existing process to collect these digits
Set myrange = {myextension.substr(0,2)}
Switch (Str myrange)
...etc...
Check this link for more info on the string functions available to you via the expression builder:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html
And here for syntax requirements of the .substr() method:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#substring%28int,%20int%29
HTH.
Regards,
Bill
Please remember to rate helpful posts.
Please remember to rate helpful responses and identify
06-21-2010 05:59 AM
Hi all.
I´m working with Uccx 7.0
I try to identified around 400 extensions. Let me try with William´s recomendation.
William: it´s posible follow your recomendation using editor script to uccx 7?
06-21-2010 06:56 AM
When you use the "set" step for variable myrange you can use the expression builder to add the string manipulation.
Regards,
Bill
Please remember to rate helpful responses and identify
06-22-2010 07:04 AM
In expression builder i´m using
Set myrange = {myextension.substr(0,2)}, but i have an error.
Unable to parse expression; undefinied method: substr for class:java.lang.String (line:1, col:2)
myrange variable could be type: String?
06-22-2010 08:26 AM
Yes, you will need both the myextension and myrange variables declared as type String. I also double checked the syntax on my CRS editor. Looks like the expression builder is looking for .substring as the method as opposed to .substr. My apologies for the confusion. Also, the curly braces aren't necessary. I was trying to show that you would use the expression builder.
Anyway, take a look at this screen shot:
This can be applied without catching a syntax error and should work for you. Try it out and let us know.
HTH.
Regards,
Bill
Please remember to rate helpful responses and identify
06-22-2010 09:04 AM
Mr William: Thank you. The Script It´s working !!!!
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: