Today I’m going to show you the step-by-step to create a Script on UCCX, where you can record your own Audio Prompt. The audio is automatically saved in a Folder on UCCX.
It’s not an advanced Script, but it’s very useful.
Audio will be saved with the User’s ID, plus the date/time. I found this way easy to be found in the Folder, for instance: 1234567_07_19 – 10018am.wav.
Let’s see the steps to create the Script:
- Defining Date/Time
We are going to get the current Date and Time, and then, split it into 4 variables: second, minutes, hour, month and day. Then, add then in a variable sSlotTime, which will be part of the name of the Audio.
These steps Switch are add the “0” in a number. For example, from “1” to “01”, so we keep all with 2 digits. We do the same for day, month, hour, minutes and second (always from 0 to 9).
For the period, the result will give us 1 or 0. If it’s 1, I set the period to pm. If it’s 0, I set the period to am.
- Getting User ID
Now we will ask the user to enter their ID’s. The only reason here is to name the audio according to the ID. If you want, you can ask the user to enter ID and PIN as an authentication.
You are saving the ID in a variable called ID.
Then, we are setting the variable sFileType with ID + “_”.
Time now to Record the audio. To do that, there is a step called Recording, where you indicate which variable you will save the result, audio, maximum duration, etc..
So we are saving it in a variable called Result.
- Manipulating the Result
After recording the audio(with success), I’m giving 3 options to the user, through a Menu:
Press 1 to Listen the recorded audio – The audio saved in the variable Result will be played.
Press 2 to Save – We will give a full name to the audio. Variable sFileName will receive the Folder + sFileType + sSlotTime + “.wav”
Press 3 to Record it again – Go back to the Recording Step
To be able to save the audio to UCCX, we need authenticate, with an admin credential.
So firstly, we need to Get the User, then you have to authenticate it.
- Saving the audio
After authenticating, we have to save the file in the audio repository.
We use the step Upload Prompt to send the audio to the Server. If the Upload is done successfully, user will listen to a Menu, asking to press 1 to Record another audio, or any digit to finish.
The file name is that variable sFileName we’ve prepared, and the Document is the audio saved in the variable Result.
Basically, this is the code!
YOU CAN NOW DOWNLOAD THE SCRIPT HERE!!
I hope you enjoyed!