04-08-2011 12:49 PM - edited 03-14-2019 07:44 AM
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
Solved! Go to Solution.
04-08-2011 06:06 PM
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
04-08-2011 01:13 PM
04-08-2011 01:14 PM
it's express.
04-08-2011 06:06 PM
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
04-08-2011 07:39 PM
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,
04-11-2011 09:27 AM
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
04-12-2011 04:33 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide