cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
725
Views
5
Helpful
1
Replies

UCCX Auto Attendant Script with Office Branch Look-up

tlwoodstx
Level 1
Level 1

I'm trying to build an AA for a toll free line for my company.  We have Unity and UCCX available.  I'm familiar with Unity AA for building simple menus and transferring callers.  My need for this number goes a little deeper than simple menus.  After going to a second menu/script(ie. pressing 2), I would like to caller to enter via the numberpad the county they live in.  The response they enter dictates to which branch office they are directed to.  I feel like this is possible in UCCX with some XML files.  I'll include some example of the two XML files I've created and hopefully someone can point in me in the right direction on how to accomplish this in UCCX.  Fairly new to UCCX scripting. Any help is much appreciated and rated!

Excerpt from County XML file to correlate county to Branch Office:

<BranchCodes>

     <BranchCode county="Anderson">Tyler</BranchCode>

     <BranchCode county="Andrews">Odessa</BranchCode>

     <BranchCode county="Angelina">Tyler</BranchCode>

     <BranchCode county="Aransas">Corpus</BranchCode>

<BranchCode county="Archer">Fort Worth</BranchCode>

</BranchCodes>

Excerpt from Branch XML file with On-Net number to transfer to:

-<SiteNumbers>

     <SiteNumber site="Tyler">2063344</SiteNumber>

     <SiteNumber site="Corpus">2084433</SiteNumber>

</SiteNumbers>

1 Reply 1

Anthony Holloway
Cisco Employee
Cisco Employee
I would like to caller to enter via the numberpad the county they live in.

If you are imagining that the caller will spell out the county name via DTMF, you have a lot of work ahead of you.  On the other hand, if you have some sort of code that aligns with your counties, then that will be served well by DTMF.

If you have a small number of items to deal with, then a simple Switch step would work.

Script

CED = Get Digit String()

Switch (CED)

  Case 001

    Set transfer_to = "2063344"

  Case 002

    Set transfer_to = "2084433"

  ...etc..

  Default

    Set transfer_to = default_route

However, if you list is longer, you could use a HashMap.

Variables

java.util.HashMap county_codes = {

  java.util.HashMap m = new java.util.HashMap();

  m.put("001", "2063344"); // Tyler

  m.put("002", "2084433"); // Corpus

  ...etc...

  return m;

}

Script

...

CED = Get Digit String()

If (county_codes.containsKey(CED))

  True

    Set transfer_to = (String) county_codes.get(CED)

  False

    Set transfer_to = default_route

...

If you are really wanting to use an XML document, then it would look like this.

Document

  2063344

  2084433

  ...etc...

Variables

Document county_codes = DOC[county_codes.xml]

String xpath_code = ""

String xpath_result = ""

Script

...

CED = Get Digit String()

county_codes = Create XML Document(county_codes)

xpath_code = "//code[@value='" + CED +'"]"

xpath_result = Get XML Document Data(county_codes, xpath_code)

If (xpath_result != null && xpath_result.trim() != "")

  True

    Set transfer_to = xpath_result

  False

    Set transfer_to = default_route

...

Just keep in mind that there's never one way of solving a problem.  I hope these examples helped.

Anthony Holloway

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