cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
699
Views
5
Helpful
6
Replies

String Partial Match

Hi,

Does anybody know how to do a partial match on a string? it's IPCC 7 and I like to select the call based on the first 4 digits of the calling number.

Any help will be appreciated

Regards,

Guilherme

1 Accepted Solution

Accepted Solutions

Hello Guilherme,

You could try something like this:

new string variable: ANI
new string variable: 4digitANI

ANI = Get Call Contact Info (--Triggering Contact--, Calling Number)
Set 4digitANI = ANI .substring(4)

You can then match on the substring 4digitANI.

I hope that works!


Pablo

View solution in original post

6 Replies 6

Express/Enterprise?  If enterprise use the left() function.

david

it's express.

Hello Guilherme,

You could try something like this:

new string variable: ANI
new string variable: 4digitANI

ANI = Get Call Contact Info (--Triggering Contact--, Calling Number)
Set 4digitANI = ANI .substring(4)

You can then match on the substring 4digitANI.

I hope that works!


Pablo

Thanks a lot for the reply but this didn't work, didn't match, did`t go VIP as the script below
Do you know whats wrong?

Calling number was 6004

Where
VIP1 is String Parameter (60)
Calling_Prefix is String
Calling1 is String

Calling1 = Get Call Contact Info(--Triggering contact--, Calling Number)
Set Calling_Prefix = Calling1.substring(2)
If (Calling_prefix == VIP1) Then
    True
        Goto VIP
    False
Select Resource........Normal_CSQ

Vip
Select Resource........CSQ_VIP

Thanks again

Regards,

Hello, I just tested something similar on my side and it worked. Could you run a reactive debug on the script to see if the Calling1 and Calling_Prefix variables are being populated properly?

Thanks

For this application, I would suggest using the String.startsWith() method, and not hard code the number 4 in the substring method call.

What would happen if he tried to match a different length string? How much work would it take to convert it? What if the length was dynamic?

Example:

if (calling_number.startsWith(match_pattern))

True

...

False

...

Sent from Cisco Technical Support iPhone App