cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3905
Views
60
Helpful
29
Replies

Route calls to specific number based on Date and Time

elijah.walsh
Level 1
Level 1

Hi,

UCCX 8.5.1.11001-22

I am trying to create a script that will route calls to a specific number after-hours.  The only catch is the number changes every week and rotates among 4 or 5 people.  I have seen several scripts and xml documents up that give me a good start but I just cant seem to figure out the process with the xml document and call flow of this one.  I do realize this is basically a programing question but if you could get me headed in the right direction it would help.

I am no stranger to UCCX scripting but a novice to xml integration.

2 Accepted Solutions

Accepted Solutions

Anthony Holloway
Cisco Employee
Cisco Employee

You don't need an XML document.  A simple plain text file would be enough.

You could even host it on any web server in your organization.

Say for example you had the following file located at:

HTTP Location

http://someserver.internal.company.com/uccx/helpdesk/oncall.txt

File Contents

916125551212

You could easily get that into a script like this:

Variables

Document http_url = URL[http://someserver.internal.company.com/uccx/helpdesk/oncall.txt]

String oncall_number = ""

Script

...

Set oncall_number = http_url

Call Redirect (--Triggering Contact--, oncall_number)

...

You could then just manage the file contents however you would like to on that web server.  E.g., FTP, SSH, RDP, Web Based Form, etc.

If you wanted a 100% UCCX solution, you could create a new IVR which authenticates the caller and then asks them to either review or change the oncall number.  You would still use a plain text file, but you would read/write it from/to the repository.

Reading from repository (Could be menu option 1 in the new IVR)

Variables

Document oncall_doc = DOC[oncall.txt]

String oncall_number = ""

Script

...

Set oncall_number = DOC[oncall.txt]

Play Prompt (--Triggering Contact--, S[oncall_number])

...

Writing to the repository (Could be menu option 2 in the new IVR)

Variables

Document oncall_doc = DOC[oncall.txt]

String oncall_filename = "oncall.txt"

String oncall_number = ""

User repo_account = USER[avholloway]

Script

...

oncall_number = Get Digit String (--Triggering Contact--, P[enter_oncall_number])

  Successful

    repo_account = Authenticate User (repo_account, PIN = "12345")

      Successful

        Upload Document (TEXT[oncall_number] to L[en_US], oncall_filename)

          Successful

            /* oncall number changed! */

          Unsuccessful

            /* Something went wrong uploading document */

      Unsuccessful

        /* Something went wrong authenticating the user */

  Timeout

    /* User did not entere any or enough digits */

  Unsuccessful

    /* Something went wrong asking the user for the new oncall number */

...

Hope that helps.

EDIT: Fixed my reading from repo example.  It was using the Call Redirect step, and it now uses the Play Prompt step.  I realize that could be confusing, but it was a simply copy/paste oversight on my part.

Anthony Holloway

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

View solution in original post

I'm not sure what the SM toolkit is.  Could you explain it or provide a link?

If you and your collegaue are admins, then I would say skip the overhead of an XML document for now and just manage the schedule in a subflow.

Example:

Subflow Variables

String oncall_number_current = ""

String oncall_number_avholloway = "916125551212"

String oncall_number_jsmith = "916125551313"

String oncall_number_default = "916125551000"

Date today = D[now]

Subflow Script

Start

Switch int (today.month)

  January (value == 1)

    /* In Jan, from the first to the fifteenth, Anthony is on call */

    If (today.date >= 1 && today.date <= 15)

      True

        Set oncall_number_current = oncall_number_avholloway

        Goto End of Script

      False

    /* In Jan, from the sixthteenth to the thirty-first, John is on call */

    If (today.date >= 16 && today.date <= 31)

      True

        Set oncall_number_current = oncall_number_jsmith

        Goto End of Script

      False

  Febraury (value == 2)

    /* In Feb, from the first to the sixth, Anthony is on call */

    If (today.date >= 1 && today.date <= 6)

      True

        Set oncall_number_current = oncall_number_avholloway

        Goto End of Script

      False

    /* In Feb, on the seventh, from midnight to noon, Anthony is on call */

    If (today.date == 7 && today.hod >= 0 && today.hod <= 11)

      True

        Set oncall_number_current = oncall_number_avholloway

        Goto End of Script

      False

    /* In Feb, on the seventh, from noon to midnight, John is on call */

    If (today.date == 6 && today.hod >= 12 && today.hod <= 23)

      True

        Set oncall_number_current = oncall_number_jsmith

        Goto End of Script

      False

    /* In Feb, from the eighth to the twenty-nineth, John is on call */

    If (today.date >= 8 && today.date <= 29)

      True

        Set oncall_number_current = oncall_number_jsmith

        Goto End of Script

      False

  March (value == 3)

    ..etc, etc, building out the whole year...

  Default

    /* Set the default on call number */

    Set oncall_number_current = oncall_number_default

    Goto End of Script

Label End of Script

End

Main Script Variables

String oncall_number = ""

Main Script Script

...

oncall_number = Call Subflow (SCRIPT[oncall-sublfow.aef], oncall_number_current)

Call Redirect (--Triggering Contact--, oncall_number)

...

In the example of January 3rd, the subflow would execute 4 steps.  That's not much at all.  Of course you would only call the subflow if the hours called for it.  This would eliminate unecessary calls to the subflow.

To update the oncall, just update the script, save, upload, refresh, and then refresh the apps which call it.  No down time at all!

I hope that makes sense.  If not, ask questions.

Anthony Holloway

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

View solution in original post

29 Replies 29

Anthony Holloway
Cisco Employee
Cisco Employee

You don't need an XML document.  A simple plain text file would be enough.

You could even host it on any web server in your organization.

Say for example you had the following file located at:

HTTP Location

http://someserver.internal.company.com/uccx/helpdesk/oncall.txt

File Contents

916125551212

You could easily get that into a script like this:

Variables

Document http_url = URL[http://someserver.internal.company.com/uccx/helpdesk/oncall.txt]

String oncall_number = ""

Script

...

Set oncall_number = http_url

Call Redirect (--Triggering Contact--, oncall_number)

...

You could then just manage the file contents however you would like to on that web server.  E.g., FTP, SSH, RDP, Web Based Form, etc.

If you wanted a 100% UCCX solution, you could create a new IVR which authenticates the caller and then asks them to either review or change the oncall number.  You would still use a plain text file, but you would read/write it from/to the repository.

Reading from repository (Could be menu option 1 in the new IVR)

Variables

Document oncall_doc = DOC[oncall.txt]

String oncall_number = ""

Script

...

Set oncall_number = DOC[oncall.txt]

Play Prompt (--Triggering Contact--, S[oncall_number])

...

Writing to the repository (Could be menu option 2 in the new IVR)

Variables

Document oncall_doc = DOC[oncall.txt]

String oncall_filename = "oncall.txt"

String oncall_number = ""

User repo_account = USER[avholloway]

Script

...

oncall_number = Get Digit String (--Triggering Contact--, P[enter_oncall_number])

  Successful

    repo_account = Authenticate User (repo_account, PIN = "12345")

      Successful

        Upload Document (TEXT[oncall_number] to L[en_US], oncall_filename)

          Successful

            /* oncall number changed! */

          Unsuccessful

            /* Something went wrong uploading document */

      Unsuccessful

        /* Something went wrong authenticating the user */

  Timeout

    /* User did not entere any or enough digits */

  Unsuccessful

    /* Something went wrong asking the user for the new oncall number */

...

Hope that helps.

EDIT: Fixed my reading from repo example.  It was using the Call Redirect step, and it now uses the Play Prompt step.  I realize that could be confusing, but it was a simply copy/paste oversight on my part.

Anthony Holloway

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

Not even my post, but +5 for great ideas/examples. 

Man, that is crazy good stuff but it's the date time manipulation I am having the most trouble with.  How can I have the script call that OnCall tech that is in the rotation for that week and time automatically with out us having to make changes very often. Thing is if i did do a xml the only thing I can't come up with without getting extensive is having every day on the schedule pointing to variables that have the oncall techs numbers in the paramaters.  I would like to shorten that somehow and try to say between specific dates go to that variable.  Wow, that confused me a little so I hope you understand what i'm getting at.

If you went with the first example of the web server, then you would manage your schedule out side of UCCX as well.  The only thing you would manage within UCCX is the open/closed status of the Call Center.

However, if you were to mange the entire schedule within UCCX, then we're talking something slightly different.

Who will manage the oncall schedule?  You?  Supervisors?  Oncall people themselves?

Anthony Holloway

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

It would essentially be myself and another collegue.  Currently they go in every week and change the forwarding number but they want it to be set it stone as much as possible. I have been through the UCCX-SM-Toolkit and it was very helpful especiallly with the open/closed determination essentially saying call the on-call or not. Thanks there.

I'm not sure what the SM toolkit is.  Could you explain it or provide a link?

If you and your collegaue are admins, then I would say skip the overhead of an XML document for now and just manage the schedule in a subflow.

Example:

Subflow Variables

String oncall_number_current = ""

String oncall_number_avholloway = "916125551212"

String oncall_number_jsmith = "916125551313"

String oncall_number_default = "916125551000"

Date today = D[now]

Subflow Script

Start

Switch int (today.month)

  January (value == 1)

    /* In Jan, from the first to the fifteenth, Anthony is on call */

    If (today.date >= 1 && today.date <= 15)

      True

        Set oncall_number_current = oncall_number_avholloway

        Goto End of Script

      False

    /* In Jan, from the sixthteenth to the thirty-first, John is on call */

    If (today.date >= 16 && today.date <= 31)

      True

        Set oncall_number_current = oncall_number_jsmith

        Goto End of Script

      False

  Febraury (value == 2)

    /* In Feb, from the first to the sixth, Anthony is on call */

    If (today.date >= 1 && today.date <= 6)

      True

        Set oncall_number_current = oncall_number_avholloway

        Goto End of Script

      False

    /* In Feb, on the seventh, from midnight to noon, Anthony is on call */

    If (today.date == 7 && today.hod >= 0 && today.hod <= 11)

      True

        Set oncall_number_current = oncall_number_avholloway

        Goto End of Script

      False

    /* In Feb, on the seventh, from noon to midnight, John is on call */

    If (today.date == 6 && today.hod >= 12 && today.hod <= 23)

      True

        Set oncall_number_current = oncall_number_jsmith

        Goto End of Script

      False

    /* In Feb, from the eighth to the twenty-nineth, John is on call */

    If (today.date >= 8 && today.date <= 29)

      True

        Set oncall_number_current = oncall_number_jsmith

        Goto End of Script

      False

  March (value == 3)

    ..etc, etc, building out the whole year...

  Default

    /* Set the default on call number */

    Set oncall_number_current = oncall_number_default

    Goto End of Script

Label End of Script

End

Main Script Variables

String oncall_number = ""

Main Script Script

...

oncall_number = Call Subflow (SCRIPT[oncall-sublfow.aef], oncall_number_current)

Call Redirect (--Triggering Contact--, oncall_number)

...

In the example of January 3rd, the subflow would execute 4 steps.  That's not much at all.  Of course you would only call the subflow if the hours called for it.  This would eliminate unecessary calls to the subflow.

To update the oncall, just update the script, save, upload, refresh, and then refresh the apps which call it.  No down time at all!

I hope that makes sense.  If not, ask questions.

Anthony Holloway

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

Yes... score... thanks.  So just for future ref.,. When would someone use an xml and why would it be considered overhead. here is the link for the toolkit.  Check it out.

http://10104.x.rootbsd.net/~jyoung/netpro/UCCX-SM-Toolkit.zip

in this discussion

https://supportforums.cisco.com/message/3469272#3469272

To be honest, overhead wasn't the best word to use.  I simply meant: voice engineers are not always web developers, and therefore, adding XML and XPATH in to the mix just complicates things.  The major problem I have with XML documents is that the syntax is easily messed up by non technical supervisor and sometimes by voice engineers.  By using standard scripting steps, not only do you keep the learning curve within the UCCX park, you get immediate feedback with script validation errors.

XML documents get used all the time in places where simple script steps or even plain text files would suffice.

Example: Holiday Checking - For some reason the idea that having your holidays in an XML document is the superior way of doing this.  When all that does is cause a new technology to be introduced, XML, and limits who can update it.  When all you really need is something like this:  https://supportforums.cisco.com/message/3759523#3759523

I am a fan of XML when it comes to web services.  And example would be reading in ticket information from a ticketing system, so you don't have to buy UCCX Premium licenses.

E.g., This works well as XML and would be a pain to parse as plain text comma delimited

 

    avholloway

    User cannot check voicemail

   

     

        04/15/2013

       

        avholloway

        Asked the user if they could reboot and try again

     

   

 

Not to be a tease, but I am working on a XML based holiday/business hours hybrid JTAPI/HTTP triggered application.  The beauty is, you never have to look at the XML.  The documents are generated on the fly, and managed behind the scenes.  You just interface with the IVR or with the genrated web interface if you have UCCX Premium.  Why do I say that, because I don't want anyone to think that I dislike XML.  I simply think it gets used when there are better options available.

Anthony Holloway

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

Thanks for the insight and the help.  I am now working on making a loop that will just count the days and rotate the oncall tech as oppossed to going in every year and putting in the ranges.  It should take the day and assign the the tech to it until it hits 8 then it starts back at 1 and incremements the next integer in the variable.  It also reads if there is no number in the tech varaible string or it is set to "0" then it skips and goes to the next one.  That way it is continuous and all they have to change is the paramater.  Pulling from a text file would be the next step so no one would have to touch UCCX at all.

Thank you again you will definitely see me on here again.

That is brilliant!  Nice job on the idea and equally on the execution if all goes as planned.  Glad you were able to get some value from the forum.  Please do post back, we love a good conversation here.  Take care.

Anthony Holloway

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

This is exactly what I need to implement, were you able to get this scripted?

 

EDIT: Referring to incrementing the number of days and looping to the next number/object in the list on the 8th day. I only have two numbers to rotate between though, so maybe there is an easier way?

 

I know this is an old post, but thank you in advance to anyone who responds.

GadgetFood
Level 1
Level 1

I know this is an old post. I just wanted to say thanks as I was looking for a solution and this is exactly what I needed to get the job done. This was explained very well for me

James,

That's great to hear.  What version of UCCX are you working in?

I am working in 10.6 in mix mode

I also may use your other advice to setup a text file so when the team switch weeks then can go in there and make a change without me having to touch anything.

The one thing I was curious about if there was a way to set it to look for what month it is and do 7 days and automatically go to the next person this way I don't have to worry about filling out for each month.

Maybe got to use int or something?

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: