Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

Using variables to compare

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?

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Using variables to compare

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.

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

Re: Using variables to compare

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

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

7 REPLIES
Red

Re: Using variables to compare

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

http://htluo.blogspot.com

Re: Using variables to compare

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.

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

Community Member

Re: Using variables to compare

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?

Re: Using variables to compare

When you use the "set" step for variable myrange you can use the expression builder to add the string manipulation.

Regards,

Bill

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

Community Member

Re: Using variables to compare

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?

Re: Using variables to compare

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

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

Community Member

Re: Using variables to compare


Mr William: Thank you. The Script It´s working !!!!

241
Views
27
Helpful
7
Replies
CreatePlease to create content