11-26-2009 06:55 AM - edited 03-14-2019 04:54 AM
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.
12-10-2009 08:42 AM
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
...
12-11-2009 02:44 AM
That's brilliant! Thanks very much.
10-08-2011 04:52 PM
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?
12-05-2011 03:08 AM
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.
12-05-2011 06:40 AM
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!
12-07-2011 11:42 PM
No problem, glad that helped you.
11-19-2015 04:29 AM
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
12-16-2020 11:25 AM
Thanks for this guidance Anthony +5. On UCCX 11.6.2 I wasn't able to get the
Play Prompt (--Triggering Contact--, P[missingprompt.wav] || P[realprompt.wav])
but was able to with
Play Prompt (--Triggering Contact--, P[missingprompt.wav] ||| P[realprompt.wav])
I'm not quite sure why this is, after reading through the UCCX Scripting and Development Guide I don't think I'm understanding the differences between the Prompt Escalation Operator || and the Prompt Substitution Operator |||. I know UCCX is very particular with the conversion and syntax of prompt/string values in Menu/Play Prompt steps (P[], etc). I'll keep researching to see if I can hash this out.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide