Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

UCCX - Check for existence of file?

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.

7 REPLIES

Re: UCCX - Check for existence of file?

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

...

Anthony Holloway

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

Re: UCCX - Check for existence of file?

That's brilliant! Thanks very much.

New Member

UCCX - Check for existence of file?

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?

New Member

UCCX - Check for existence of file?

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.

New Member

Re: UCCX - Check for existence of file?

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!

New Member

UCCX - Check for existence of file?

No problem, glad that helped you.

New Member

The IF Statement is always

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

1381
Views
30
Helpful
7
Replies