cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1998
Views
25
Helpful
6
Replies

Get xml document data and compare with calling number variable in UCCX script

Glenn Jordan
Level 1
Level 1

I have a script where I want to compare the calling number (variable) with a list of directors and above in an xml document then prioritize them and send them to a queue. I have everything setup but i can't get my expression to compare the calling number with the numbers in the document. It always pulls the first vipNumber in the xml document. I've seen other post on this subject but none that matches exactly what I'm trying to do. Any help is appreciated.

2 Accepted Solutions

Accepted Solutions

Sean Lynch
Level 7
Level 7

This post is a bit old... but it had no replies, so here is a sample solution:

020-0402-script.png

 

Variables used:

020-0402-variables.png

 

I created a subflow that provides the logic to sort through the XML file, and search for matching entries based upon the Calling Number (variable sANI).

Your script does not contain any logic to loop through the entries in the XML document to find the Name for a matching calling number, if present.

It only searches for the first entry in the XML data.  You need to create the logic to search all entries for a match against Calling Number.

Also, your XPath statements can be abbreviated... 

Let me know if this helps.

-Sean

View solution in original post

I would submit the following solution which requires no looping and does the matching in XPATH rather than in more script steps:

CallersName = Get XML Document Data(xml, "//vip[vipNumber='" + CallingNumber + "']/CallersName")
If (CallersName != null && CallersName.trim() != "")
True
/* This is a VIP Caller */
False

I wouldn't think it would be necessary to check beyond a first match, because you shouldn't have more than one entry sharing the same phone number.  So, my solution, just like yours, only pulls one match out of a potential pool of matches, but I don't see that as a problem.

View solution in original post

6 Replies 6

Sean Lynch
Level 7
Level 7

This post is a bit old... but it had no replies, so here is a sample solution:

020-0402-script.png

 

Variables used:

020-0402-variables.png

 

I created a subflow that provides the logic to sort through the XML file, and search for matching entries based upon the Calling Number (variable sANI).

Your script does not contain any logic to loop through the entries in the XML document to find the Name for a matching calling number, if present.

It only searches for the first entry in the XML data.  You need to create the logic to search all entries for a match against Calling Number.

Also, your XPath statements can be abbreviated... 

Let me know if this helps.

-Sean

I would submit the following solution which requires no looping and does the matching in XPATH rather than in more script steps:

CallersName = Get XML Document Data(xml, "//vip[vipNumber='" + CallingNumber + "']/CallersName")
If (CallersName != null && CallersName.trim() != "")
True
/* This is a VIP Caller */
False

I wouldn't think it would be necessary to check beyond a first match, because you shouldn't have more than one entry sharing the same phone number.  So, my solution, just like yours, only pulls one match out of a potential pool of matches, but I don't see that as a problem.

Thank you, this is very helpful.

Is there a limit for number of XML data which can execute on UCCX? 

When I tried this, it is successfully working for a small XML data base ( less number of xml data base), whereas if i try with 300 or 400 xml entries it doesnt work on UCCX. Both case I can execute the query on http://xpather.com

On UCCX when I debug reactive script it stoped on166 th iLoopCount and stuck on "Goto NextValue" and gave an exception error " No. of executed steps:1000"

 

By defaut the CCX script has the limit of 1000 execution steps. 

So each time you loop you use x number of execution steps.

One execution step is one step in the script.

You can change this value in the sustem paramters on the ccx appadmin page

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

Issue solved after making the UCCX system parameter value for Max Number of Executed Steps to 4000. Change effected after Restarting Cisco Unified CCX Engine

1 ++ On the ccx appadmin system > syetm paramters >Max Number of Executed Steps

2 ++ UCCX serviceability> Control Center - Network Services > Restart : Cisco Unified CCX Engine