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

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

Glenn Jordan
Beginner
Beginner

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
Rising star
Rising star

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
Rising star
Rising star

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"

 

Thomas G. Johannesen
Contributor
Contributor

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 all useful posts and mark as answer if it solves your issue

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

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: