UCCX - Check for existence of file?

Unanswered Question
Nov 26th, 2009

Hi all,

I'm wondering if there is a step(s) I can use in a script to check for the existence of a wav file in a particular subdirectory of the prompts folder on the server and if this file exists to play it?

Any help appreciated.

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (5 ratings)
Loading.
Anthony Holloway Thu, 12/10/2009 - 08:42

What would you do if it wasn't there?  Play a different prompt?

If so, this is a built in feature:

     Play Prompt (--Triggering Contact--, P[missingprompt.wav] || P[realprompt.wav])

This will see that the first prompt does not exist, and play the second prompt.  If the first prompt did exist, then it would play the first prompt and not the second.

There is another solution that is more complex, but basically, you do this:

On Exception UndefinedPromptException Goto MyPrompt1Failure

Play Prompt (--Triggering Contact--, P[myprompt1.wav])

...

Label MyPrompt1Failure

Clear Exception UndefinedPromptException

...

Jeffrey Ness Sat, 10/08/2011 - 16:52

I'm looking to check for the existance of a prompt to make a prompt management script. I have the On Exception com.cisco.prompt.UndefinedPromptException Goto NextLabel but it doesn't catch the Exception (on UCCX 8.0(2)SU3 at least...). In the debugger it is showing this is the exception I am hitting when trying to cast the prompt to a Document (to make a backup copy.) When the file exists it casts to the document and creates the backup copy just fine, but I need it to handle new prompts too (preferably without playing it and trying to catch it on the play step). Any ideas?

tornikezedginidze Mon, 12/05/2011 - 03:08

Hi Jeffrey,
I'm not sure if this is what you want, but you can check prompt existance without actually playing it this way:

Write following expression in new IF statement:

{ try {  check_prompt = (Document)ivr;   return True; } catch (Exception e) { return False;} }

- where, check_prompt is an empty Document variable, and ivr is a prompt variable. Application will execute true statement if ok, or false if any exception.

Thanks.

Jeffrey Ness Mon, 12/05/2011 - 06:40

Very nice I had tried to make it work originally with a try/catch block, but couldn't get the syntax right. Your solution worked like a charm and lets me get rid of the workaround solution I had written to have a 2nd script that just answers a call and lets the play prompt step play it and let it get caught with the UCCX Exception. Thanks!

gorourke Thu, 11/19/2015 - 04:29

The IF Statement is always resolving to true for me, even if the file doesn't exist. Is there anything you recommend to assist in troubleshooting why this might be happening?

Gerry

Actions

This Discussion