CRS Script Question

Unanswered Question
Feb 10th, 2010

Hi all....

Hopefully a quick one... well two:

1) When you use a "Get Reporting Statistic" step and want to pull "Current Wait Duration" from the CSQ database, does the current wait time for a caller include time on hold? I'm using hold in my queue to play MOH to callers rather than playing music prompts but the timers dont seem to be working. I've set up thresholds that if the wait duration is more than 240 secs it should transfer the caller somewhere else but this isnt kicking in... Ever...

2) I have a Call Hold step > Delay 30 > Call Unhold > Prompt > Call Hold > Delay 30 > Call Unhold. On the first Hold the caller hears MOH, on the second Hold the caller gets dead air, happens evey time, can't figure out why.

If anyone can help point me in the right direction with either of these issues i would appreciate it!



  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Nathan Luk Wed, 02/10/2010 - 21:05

How are you doing the check if wait time > 240 seconds? It is a once off check so you need to include the check as part of the looping logic. Also remember to take the call off hold before redirecting the call


  • Queued
    • LABEL: QueueLoop
    • Hold
    • Delay 30
    • Unhold
    • Get reporting statistic: Current Wait Duration = currentwait_var
    • If currentwait_var > 240 then
      • Dequeue call
      • Redirect to wherever you want it to go
    • Play Prompt: InQueuePrompt
    • Goto: QueueLoop



ritsonr Thu, 02/11/2010 - 08:00

I'm using the output of the Current Wait Time with an IF step:

Queue Loop:


  • Queue Length: Get Reporting Statistic "Current Wait Duration"
  • IF Queue Length >= Queue Length Threshold
    • True: Call Redirect to Voice Mail
    • False
  • Queue Depth: Get Reporting Statistic " Contacts Waiting"
  • IF Queue Depth >= Queue Depth Threshold
    • True: Call Redirect to Voice Mail
    • False
  • Call Hold
  • Delay 30
  • Call Unhold
  • Play Prompt: QueuePrompt
  • Call Hold
  • Delay 30
  • Call Unhold
  • Play Prompt: QueuePrompt
  • Goto Queue Loop

The length threshold is an integer set to 240 (secs) and the depth is an integer set to 3 (queued callers). Each prompt is about 10 secs so i thought two of them plus two delays of 30 = 80 secs, therefore three loops would be about 240 secs at which time the length threshold would kick in and send the caller to voice mail.

So first problem is that the timers dont seem to work, in fact from the reporting it looks like a caller who queues for 4 minutes disappears from the queue and then reappears 15 secs later with the timer wait duration timer reset.

Second Problem is the second "On Hold" step you see above doesnt play MOH to the caller!

I'ma  bit of a nube with CRS scripting so any advice you've got will be gratefully received!


bsugamele1 Thu, 02/11/2010 - 08:08

I would start by running through your script with the debug function to find the step that is hanging you up. To get through the queueing process you may have to make a couple of test calls and get them queued then run your debug. HTH!

ritsonr Thu, 02/11/2010 - 09:19

Unfortunately it's a live environment so hard to test but so far all i can see with the debug is the queue length check being ignored indefinitely. Now that's either because the step is configured wrong which i doubt or some back end issue is resetting the current wait time timer every four minutes or so.

bsugamele1 Thu, 02/11/2010 - 10:32

You need a test script, application, and agent then. Make a copy of the script you are working with, apply it to your test application, then log in with a test agent. That will make debugging your scripts a whole lot easier and you don't have to worry about messing with your production apps. When you make a change to an application or script, just open appadmin and refresh your applications for the changes to take effect. This will have no impact on your production applications.

Nathan Luk Thu, 02/11/2010 - 15:24

Hi Richard,

Sorry, just wanted to check. Is your Queue Label under the Queued branch of your select step? From your steps listed it looks like the label is before it which may be an issue. As bsugamele1 mentioned, you should make a copy of the script, load it on a test RP and chuck it in reactive mode. Keep an eye on your variables in the bottom left pane when stepping through. You should be able to see what value your QueueLength variable is being assigned after the Get Reporting Statistic steps.




This Discussion