Use of Time in UCCX scripting

Answered Question
Apr 13th, 2010
User Badges:

Hi,

    We are working on UCCX7.0(1) and have a scripting question. The requirement I have is to play a prompt for a defined set of time, say 5 minutes, in a loop. On the expiry of the time, the call should end. Following is the steps that I need to achieve-


1) Play a message , Prompt1, asking the user to enter a digit.

2) On timeout or invalid entry, loop through the Prompt1 unlimited number of times.

3) But once the duration of the play reaches 5 minutes, end the call.


I am not aware of checking this timer/duration within the script. This seems pretty basic but Iam a novice to scripting, so any help is highly appreciated.


Thanks,

DM

Correct Answer by Anthony Holloway about 7 years 2 weeks ago

i don't fully understand what you need but here is an example that may get you going in the right direction.  keep in mind that ending the script at exactly 5 minutes will be nearly impossible, unless you can control exactly how long the prompt playback lasts.  i.e.g, 30 second prompt, loops 10 times.



Pseudo Code

set start_time = d[now].getTime()


label loop_prompt_playback


play prompt(--triggering contact--, p[some_prompt])


set current_time = d[now].getTime()


if (current_time - start_time < 300000)

     true

          goto loop_prompt_playback

     false


terminate(--triggering contact--)


end

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
Anthony Holloway Wed, 04/14/2010 - 10:30
User Badges:
  • Purple, 4500 points or more

i don't fully understand what you need but here is an example that may get you going in the right direction.  keep in mind that ending the script at exactly 5 minutes will be nearly impossible, unless you can control exactly how long the prompt playback lasts.  i.e.g, 30 second prompt, loops 10 times.



Pseudo Code

set start_time = d[now].getTime()


label loop_prompt_playback


play prompt(--triggering contact--, p[some_prompt])


set current_time = d[now].getTime()


if (current_time - start_time < 300000)

     true

          goto loop_prompt_playback

     false


terminate(--triggering contact--)


end

dmurthy74 Wed, 04/14/2010 - 13:24
User Badges:

It works!! You are right, I will not be able to time it to exactly 5 minutes but the customer is fine with it.


I just had to tweek the code a tiny but in oder to compare 2 Long values :


if (EndTime - StartTime) >= (300000.longvalue()) then

     Goto End

Else

     Goto Prompt_Label.



Thanks a ton!!


DM

Actions

This Discussion