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

Script Help to determine calling region for CSQ routing

Contact Center Express 7.01 - Premium

US client who has separated the states into three regions and wants to deliver calls to each of the three regions based on calling number.

I have a database of 255 area codes across US that is separated into 3 xml files.  I have the script parse through the xml files one at a time, one line at a time to look for the calling area code.  Once a match is determined it sets the CSQ and routes, if it never matches it takes a default route.  (The script is similar to the Holiday.xml checking sample most people are familar with)

Based on this long looping script the steps exceed the normal 1000 and this had to be bumped for it to work.  But when I test the script it works as designed.  I get some trouble calls, however, that claim that some calls are mis-routed.  For example calls that should be for the west region are ending up in the east region.  I have double checked my xml files for the area codes, but find no problems.  And each time I debug it works as expected.

I am wondering if this long script is causing the problem and creating these issues.  Anyone have a shorter way to do this?

I will rate helpful replies.

Everyone's tags (2)
4 REPLIES

Re: Script Help to determine calling region for CSQ routing

Does this example help?

 

    612

    763

 

 

    305

    786

 

xpath = "//region[npa='" + npa + "']/@id"

switch region

  region 1

    /* do something for region 1 callers */

  region 2

    /* do something for region 2 callers */

  default

    /* default region 3 */

You could even make the XML foot print even smaller, if you don't plan to have human's read it:

612763305786

xpath = "//b[d='" + npa + "']/@c"
Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
Community Member

Re: Script Help to determine calling region for CSQ routing

This sounds interesting, but I don't understand how to use the xpath.  Is that what saves steps or makes it more efficient?  Can you point me at something that helps me understand that?  Thanks for the reply!

Re: Script Help to determine calling region for CSQ routing

Yes, it helps you save steps.

The XML parser supports xpath dom node selections.  It's pretty powerful too.

You would use this xpath syntax in your get xml document data step.  it will output the numeric value of the region for which the NPA is a descendent of.

Here's a break down:

"//region[npa='" + npa + "']/@id"

The two slashes are like a search

"//region[npa='" + npa + "']/@id"

This is a node selection

"//region[npa='" + npa + "']/@id"

This is a predicate match.  Kind of like filtering.  I am using a string concatenation to use the calling party's NPA here.

"//region[npa='612']/@id"

This is what the resulting string would look like with the variable replaced with a static value

"//region[npa='" + npa + "']/@id"

This is an attribute selector.  It returns the value of id for the matched region node

I used this as an example to get you thinking in the right direction.  The way you actually implement this is up to you.  That's the fun part.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
Community Member

Re: Script Help to determine calling region for CSQ routing

Thanks for the help (points).

Just for follow up, I wanted to mention that the changes were not necessary after I introduced a 1 second delay at the beginning of my script.

As it turns out, that is enough time for UCCX to pull the correct caller-id from the original caller and not the Unity port.  Once this was correct, the client did not require any further changes and I closed the issue.

462
Views
15
Helpful
4
Replies
CreatePlease to create content