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

Check calling number start with +1 and second digit is not 8 in CCX

Hi,

Is it possible to check if the ANI that is seen by the CCX script start with for example +1 and the second digit isn't an 8? We have today a section that looks like this with in an if statement.

 

ANI.startsWith("+10") || ANI.startsWith("+12")

 

What I'd like to achieve is something similar to what can be done in CM, aka match +1[^8] on for example TPs.

 

I'd also like to get input to if you can do this check in a more effective way or more to the point nicer looking from a script perspective. Today we have quite a large block of numbers within many different if statements that map to separate language sections later on in the script.

 

/Roger

Please remember to rate helpful responses and identify helpful or correct answers.
1 ACCEPTED SOLUTION

Accepted Solutions

Hi,on second thought, this

Hi,

on second thought, this would be even better:

ANI.matches("\\+1[^8].*")

This would return true if the number starts with anything but +18, otherwise false.

G.

6 REPLIES

Hi,try!ANI.startsWith("+18")G

Hi,

try

!ANI.startsWith("+18")

G.

Thanks Gergely,Super fast as

Thanks Gergely,

Super fast as ever. yes

Just to be clear, will that match all numbers that start with +1, but not +18?

 

/Roger

Please remember to rate helpful responses and identify helpful or correct answers.

Hi,on second thought, this

Hi,

on second thought, this would be even better:

ANI.matches("\\+1[^8].*")

This would return true if the number starts with anything but +18, otherwise false.

G.

Thank you Gergerly,This

Thank you Gergerly,

This sounds exactly as what I'm looking for. I will test it out on a test version of the production script and get back to you.

R

Please remember to rate helpful responses and identify helpful or correct answers.

Greg does that Regular

Greg does that Regular Expression actually work for you with the 2 Back slashes (in the version of CCX you are using)?..if so then in CCX 9.0.2SU1 that expression doesn't work..but it's not too far away from being "correct" (apparently as I read what you have there..you are "escaping the escape character").

ANI.matches("\+1[^8].*")

Just seeking clarification..

The image demonstrates

The image demonstrates another method you could use..but if you ever have an ANI that looks like the following: +1754+18xxx then the logic breaks on this function..however, I don't know of any numbering plans that do things like the above...

323
Views
5
Helpful
6
Replies
CreatePlease to create content